This commit is contained in:
Ernesto Tagwerker 2015-06-29 11:36:06 -03:00
parent ccf49bd3bf
commit 46e82b967e

View file

@ -232,7 +232,7 @@ RSpec.configure do |config|
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do |example|
config.before(:each) do |example|
DatabaseCleaner.strategy= example.metadata[:js] ? :truncation : :transaction
DatabaseCleaner.start
end
@ -305,10 +305,10 @@ DatabaseCleaner[:active_record].strategy = :transaction
DatabaseCleaner[:mongo_mapper].strategy = :truncation
#How to specify particular connections
DatabaseCleaner[:active_record,{:connection => :two}]
DatabaseCleaner[:active_record, { :connection => :two }]
# You may also pass in the model directly:
DatabaseCleaner[:active_record,{:model => ModelWithDifferentConnection}]
DatabaseCleaner[:active_record, { :model => ModelWithDifferentConnection }]
```
Usage beyond that remains the same with `DatabaseCleaner.start` calling any setup on the different configured connections, and `DatabaseCleaner.clean` executing afterwards.