verify that connection caching fixes outstanding bug

This commit is contained in:
Ben Mabey 2012-08-25 12:14:22 -06:00
parent 4a5399ee1e
commit c209f17052
2 changed files with 6 additions and 3 deletions

View file

@ -42,9 +42,13 @@ if orm && strategy
DatabaseCleaner.app_root = "#{File.dirname(__FILE__)}/../.."
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_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
DatabaseCleaner[ orm_sym, {:connection => :one} ].strategy = strategy.to_sym
DatabaseCleaner[ orm_sym, {:connection => :two} ].strategy = strategy.to_sym

View file

@ -17,5 +17,4 @@ Feature: multiple database cleaning
| DataMapper | truncation |
| MongoMapper | truncation |
| DataMapper | transaction |
# Not working...
#| ActiveRecord | transaction |
| ActiveRecord | transaction |