Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip insert all tests when features are unavailable #37170

Merged
merged 1 commit into from Sep 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions activerecord/test/cases/query_cache_test.rb
Expand Up @@ -651,21 +651,29 @@ 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

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

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 }) }
Expand Down