提交 45a398cf 编写于 作者: R Ryuta Kamizono 提交者: Eugene Kenny

Merge pull request #37170 from eugeneius/insert_all_query_cache_test

Skip insert all tests when features are unavailable
上级 e29372ac
......@@ -655,6 +655,8 @@ def test_insert
end
def test_insert_all
skip unless supports_insert_on_duplicate_skip?
assert_called(ActiveRecord::Base.connection, :clear_query_cache, times: 2) do
Task.cache { Task.insert({ starting: Time.now }) }
end
......@@ -662,7 +664,9 @@ def test_insert_all
assert_called(ActiveRecord::Base.connection, :clear_query_cache, times: 2) do
Task.cache { Task.insert_all([{ starting: Time.now }]) }
end
end
def test_insert_all_bang
assert_called(ActiveRecord::Base.connection, :clear_query_cache, times: 2) do
Task.cache { Task.insert!({ starting: Time.now }) }
end
......@@ -670,6 +674,10 @@ def test_insert_all
assert_called(ActiveRecord::Base.connection, :clear_query_cache, times: 2) do
Task.cache { Task.insert_all!([{ starting: Time.now }]) }
end
end
def test_upsert_all
skip unless supports_insert_on_duplicate_update?
assert_called(ActiveRecord::Base.connection, :clear_query_cache, times: 2) do
Task.cache { Task.upsert({ starting: Time.now }) }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册