提交 c82483a1 编写于 作者: R Rafael Mendonça França

Merge pull request #14565 from rajcybage/conditional_test_cases

We can conditional define the tests depending on the adapter or connection.
......@@ -144,9 +144,9 @@ def test_uniqueness_violations_are_translated_to_specific_exception
@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 @@ def test_foreign_key_violations_are_translated_to_specific_exception
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册