Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Started implemented specs. Got AR set up
- Loading branch information
Brendan Loudermilk
committed
Oct 26, 2011
1 parent
da8b1cf
commit f7178d5
Showing
8 changed files
with
71 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class AsyncModel < ActiveRecord::Base | ||
acts_as_async | ||
end | ||
|
||
class BareModel < ActiveRecord::Base | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ActiveRecord::Schema.define :version => 0 do | ||
create_table :async_models, :force => true do |t| | ||
t.string :name | ||
end | ||
|
||
create_table :bare_models, :force => true do |t| | ||
t.string :name | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,33 @@ | ||
require "rspec" | ||
# Load up the test environment | ||
Bundler.setup(:default, :test) | ||
Bundler.require(:default, :test) | ||
|
||
lib_path = File.expand_path("../../lib", __FILE__) | ||
$LOAD_PATH.unshift lib_path unless $LOAD_PATH.include? lib_path | ||
|
||
require "acts_as_async" | ||
|
||
ActiveRecord::Base.establish_connection({ | ||
:adapter => "sqlite3", | ||
:database => ":memory:" | ||
}) | ||
|
||
ActiveRecord::Base.silence do | ||
ActiveRecord::Migration.verbose = false | ||
|
||
load(File.expand_path "../schema.rb", __FILE__) | ||
load(File.expand_path "../models.rb", __FILE__) | ||
end | ||
|
||
RSpec.configure do |config| | ||
config.mock_with :rspec | ||
|
||
config.before(:suite) do | ||
DatabaseCleaner.strategy = :truncation | ||
DatabaseCleaner.clean | ||
end | ||
|
||
config.after(:each) do | ||
DatabaseCleaner.clean | ||
end | ||
end |