aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapter_test.rb
diff options
context:
space:
mode:
authorRaimonds Simanovskis <raimonds.simanovskis@gmail.com>2011-08-08 22:32:26 +0300
committerRaimonds Simanovskis <raimonds.simanovskis@gmail.com>2011-08-08 22:32:26 +0300
commit58af0d46cfa4481800bb1c4c26950c717ea1ebdd (patch)
tree9cd6bcb23fe6e9cd70bf83556de0546d4b42bae0 /activerecord/test/cases/adapter_test.rb
parent8360d7196515ba66fe5d535f6dbeeea5394e966a (diff)
downloadrails-58af0d46cfa4481800bb1c4c26950c717ea1ebdd.tar.gz
rails-58af0d46cfa4481800bb1c4c26950c717ea1ebdd.tar.bz2
rails-58af0d46cfa4481800bb1c4c26950c717ea1ebdd.zip
Fixed test_disable_referential_integrity on Oracle
On Oracle disable_referential_integrity before execution of block will disable foreign key constraints and after block will enable them but when constraints are enabled then they are validated. Therefore created record with invalid foreign key should be deleted before enabling foreign key constraints.
Diffstat (limited to 'activerecord/test/cases/adapter_test.rb')
-rw-r--r--activerecord/test/cases/adapter_test.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapter_test.rb b/activerecord/test/cases/adapter_test.rb
index 3942e7bb41..f1023ed7ef 100644
--- a/activerecord/test/cases/adapter_test.rb
+++ b/activerecord/test/cases/adapter_test.rb
@@ -151,6 +151,9 @@ 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