1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

We can conditional define the tests depending on the adapter or

connection.
This commit is contained in:
Rajarshi Das 2014-04-02 16:19:57 +05:30
parent def60710ad
commit ee36af1b77

View file

@ -145,8 +145,8 @@ module ActiveRecord
end
end
def test_foreign_key_violations_are_translated_to_specific_exception
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)
klass_has_fk = Class.new(ActiveRecord::Base) do
self.table_name = 'fk_test_has_fk'
end