diff options
author | Rajarshi Das <rajarshid@cybage.com> | 2014-04-02 16:19:57 +0530 |
---|---|---|
committer | Rajarshi Das <rajarshid@cybage.com> | 2014-04-02 16:19:57 +0530 |
commit | ee36af1b773f1a6a58ff976b95d56dcce2d3c690 (patch) | |
tree | c92a53f88e30a04d3cf3b0f26f2bc23f78ddeb91 /activerecord | |
parent | def60710ad74132a322fe8a08b0a6f0bbd3a3eed (diff) | |
download | rails-ee36af1b773f1a6a58ff976b95d56dcce2d3c690.tar.gz rails-ee36af1b773f1a6a58ff976b95d56dcce2d3c690.tar.bz2 rails-ee36af1b773f1a6a58ff976b95d56dcce2d3c690.zip |
We can conditional define the tests depending on the adapter or
connection.
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/adapter_test.rb | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/activerecord/test/cases/adapter_test.rb b/activerecord/test/cases/adapter_test.rb index ed4d0d503d..90953ce6cd 100644 --- a/activerecord/test/cases/adapter_test.rb +++ b/activerecord/test/cases/adapter_test.rb @@ -144,9 +144,9 @@ module ActiveRecord @connection.execute "INSERT INTO subscribers(nick) VALUES('me')" end end - - def test_foreign_key_violations_are_translated_to_specific_exception - unless current_adapter?(:SQLite3Adapter) + + unless current_adapter?(:SQLite3Adapter) + def test_foreign_key_violations_are_translated_to_specific_exception assert_raises(ActiveRecord::InvalidForeignKey) do # Oracle adapter uses prefetched primary key values from sequence and passes them to connection adapter insert method if @connection.prefetch_primary_key? @@ -157,10 +157,8 @@ module ActiveRecord end end end - end - - def test_foreign_key_violations_are_translated_to_specific_exception_with_validate_false - unless current_adapter?(:SQLite3Adapter) + + def test_foreign_key_violations_are_translated_to_specific_exception_with_validate_false klass_has_fk = Class.new(ActiveRecord::Base) do self.table_name = 'fk_test_has_fk' end |