From c209f17052aabe2f7dd0b39492502c2f99c9cae4 Mon Sep 17 00:00:00 2001 From: Ben Mabey Date: Sat, 25 Aug 2012 12:14:22 -0600 Subject: [PATCH] verify that connection caching fixes outstanding bug --- examples/features/support/env.rb | 6 +++++- features/cleaning_multiple_dbs.feature | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/features/support/env.rb b/examples/features/support/env.rb index 2edcef9..1ba5553 100644 --- a/examples/features/support/env.rb +++ b/examples/features/support/env.rb @@ -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 diff --git a/features/cleaning_multiple_dbs.feature b/features/cleaning_multiple_dbs.feature index 23cc375..a426b5c 100644 --- a/features/cleaning_multiple_dbs.feature +++ b/features/cleaning_multiple_dbs.feature @@ -17,5 +17,4 @@ Feature: multiple database cleaning | DataMapper | truncation | | MongoMapper | truncation | | DataMapper | transaction | -# Not working... -#| ActiveRecord | transaction | + | ActiveRecord | transaction |