diff options
Diffstat (limited to 'activerecord/test/cases/multiple_db_test.rb')
-rw-r--r-- | activerecord/test/cases/multiple_db_test.rb | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/activerecord/test/cases/multiple_db_test.rb b/activerecord/test/cases/multiple_db_test.rb index a802cfbf31..917a03bb34 100644 --- a/activerecord/test/cases/multiple_db_test.rb +++ b/activerecord/test/cases/multiple_db_test.rb @@ -89,14 +89,16 @@ class MultipleDbTest < ActiveRecord::TestCase assert_equal Entrant.arel_engine, Bird.arel_engine end - def test_associations_should_work_when_model_has_no_connection - begin - ActiveRecord::Model.remove_connection - assert_nothing_raised ActiveRecord::ConnectionNotEstablished do - College.first.courses.first + unless in_memory_db? + def test_associations_should_work_when_model_has_no_connection + begin + ActiveRecord::Model.remove_connection + assert_nothing_raised ActiveRecord::ConnectionNotEstablished do + College.first.courses.first + end + ensure + ActiveRecord::Model.establish_connection 'arunit' end - ensure - ActiveRecord::Model.establish_connection 'arunit' end end end |