提交 47b17f29 编写于 作者: A Abhay Nikam

Skip test cases for upsert_all on relation if database adapter doesn't support...

Skip test cases for upsert_all on relation if database adapter doesn't support update on duplicate records
上级 358ac36e
......@@ -373,6 +373,8 @@ def test_insert_all_has_many_through
end
def test_upsert_all_on_relation
skip unless supports_insert_on_duplicate_update?
author = Author.create!(name: "Jimmy")
assert_difference "author.books.count", +1 do
......@@ -381,6 +383,8 @@ def test_upsert_all_on_relation
end
def test_upsert_all_on_relation_precedence
skip unless supports_insert_on_duplicate_update?
author = Author.create!(name: "Jimmy")
second_author = Author.create!(name: "Bob")
......@@ -390,6 +394,8 @@ def test_upsert_all_on_relation_precedence
end
def test_upsert_all_create_with
skip unless supports_insert_on_duplicate_update?
assert_difference "Book.where(format: 'X').count", +2 do
Book.create_with(format: "X").upsert_all([ { name: "A" }, { name: "B" } ])
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册