mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
verify that connection caching fixes outstanding bug
This commit is contained in:
parent
4a5399ee1e
commit
c209f17052
2 changed files with 6 additions and 3 deletions
|
@ -42,9 +42,13 @@ if orm && strategy
|
||||||
DatabaseCleaner.app_root = "#{File.dirname(__FILE__)}/../.."
|
DatabaseCleaner.app_root = "#{File.dirname(__FILE__)}/../.."
|
||||||
orm_sym = orm.gsub(/(.)([A-Z]+)/,'\1_\2').downcase.to_sym
|
orm_sym = orm.gsub(/(.)([A-Z]+)/,'\1_\2').downcase.to_sym
|
||||||
|
|
||||||
if orm_sym == :mongo_mapper
|
case orm_sym
|
||||||
|
when :mongo_mapper
|
||||||
DatabaseCleaner[ orm_sym, {:connection => 'database_cleaner_test_one'} ].strategy = strategy.to_sym
|
DatabaseCleaner[ orm_sym, {:connection => 'database_cleaner_test_one'} ].strategy = strategy.to_sym
|
||||||
DatabaseCleaner[ orm_sym, {:connection => 'database_cleaner_test_two'} ].strategy = strategy.to_sym
|
DatabaseCleaner[ orm_sym, {:connection => 'database_cleaner_test_two'} ].strategy = strategy.to_sym
|
||||||
|
when :active_record
|
||||||
|
DatabaseCleaner[:active_record, {:connection => ActiveRecordWidgetUsingDatabaseOne} ].strategy = strategy.to_sym
|
||||||
|
DatabaseCleaner[:active_record, {:connection => ActiveRecordWidgetUsingDatabaseTwo} ].strategy = strategy.to_sym
|
||||||
else
|
else
|
||||||
DatabaseCleaner[ orm_sym, {:connection => :one} ].strategy = strategy.to_sym
|
DatabaseCleaner[ orm_sym, {:connection => :one} ].strategy = strategy.to_sym
|
||||||
DatabaseCleaner[ orm_sym, {:connection => :two} ].strategy = strategy.to_sym
|
DatabaseCleaner[ orm_sym, {:connection => :two} ].strategy = strategy.to_sym
|
||||||
|
|
|
@ -17,5 +17,4 @@ Feature: multiple database cleaning
|
||||||
| DataMapper | truncation |
|
| DataMapper | truncation |
|
||||||
| MongoMapper | truncation |
|
| MongoMapper | truncation |
|
||||||
| DataMapper | transaction |
|
| DataMapper | transaction |
|
||||||
# Not working...
|
| ActiveRecord | transaction |
|
||||||
#| ActiveRecord | transaction |
|
|
||||||
|
|
Loading…
Reference in a new issue