aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapter_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/adapter_test.rb')
-rw-r--r--activerecord/test/cases/adapter_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapter_test.rb b/activerecord/test/cases/adapter_test.rb
index 3942e7bb41..94497e37c7 100644
--- a/activerecord/test/cases/adapter_test.rb
+++ b/activerecord/test/cases/adapter_test.rb
@@ -151,7 +151,20 @@ class AdapterTest < ActiveRecord::TestCase
else
@connection.execute "INSERT INTO fk_test_has_fk (fk_id) VALUES (0)"
end
+ # should deleted created record as otherwise disable_referential_integrity will try to enable contraints after executed block
+ # and will fail (at least on Oracle)
+ @connection.execute "DELETE FROM fk_test_has_fk"
end
end
end
+
+ def test_deprecated_visitor_for
+ visitor_klass = Class.new(Arel::Visitors::ToSql)
+ Arel::Visitors::VISITORS['fuuu'] = visitor_klass
+ pool = stub(:spec => stub(:config => { :adapter => 'fuuu' }))
+ visitor = assert_deprecated {
+ ActiveRecord::ConnectionAdapters::AbstractAdapter.visitor_for(pool)
+ }
+ assert visitor.is_a?(visitor_klass)
+ end
end