未验证 提交 6bf2e59b 编写于 作者: R Ryuta Kamizono 提交者: GitHub

Merge pull request #37170 from eugeneius/insert_all_query_cache_test

Skip insert all tests when features are unavailable
......@@ -651,6 +651,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
......@@ -658,7 +660,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
......@@ -666,6 +670,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.
先完成此消息的编辑!
想要评论请 注册