aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/multiple_db_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/multiple_db_test.rb')
-rw-r--r--activerecord/test/cases/multiple_db_test.rb24
1 files changed, 16 insertions, 8 deletions
diff --git a/activerecord/test/cases/multiple_db_test.rb b/activerecord/test/cases/multiple_db_test.rb
index a802cfbf31..06d6596725 100644
--- a/activerecord/test/cases/multiple_db_test.rb
+++ b/activerecord/test/cases/multiple_db_test.rb
@@ -86,17 +86,25 @@ class MultipleDbTest < ActiveRecord::TestCase
end
def test_arel_table_engines
- assert_equal Entrant.arel_engine, Bird.arel_engine
+ assert_not_equal Entrant.arel_engine, Bird.arel_engine
+ assert_not_equal Entrant.arel_engine, Course.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
+ def test_connection
+ assert_equal Entrant.arel_engine.connection, Bird.arel_engine.connection
+ assert_not_equal Entrant.arel_engine.connection, Course.arel_engine.connection
+ end
+
+ 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