From 82aff4d9a35bedde00fe0a36b652aa9b0f12fce7 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Thu, 23 Nov 2023 10:29:18 +0100 Subject: [PATCH] Update mocks for Rails 7+ --- test/fetch_test.rb | 2 +- test/index_cache_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/fetch_test.rb b/test/fetch_test.rb index 08b4d06d..b512779e 100644 --- a/test/fetch_test.rb +++ b/test/fetch_test.rb @@ -238,7 +238,7 @@ def test_fetch_by_title_hit end # Id not found, use sql, SELECT id FROM records WHERE title = '...' LIMIT 1" - Item.connection.expects(:exec_query).returns(ActiveRecord::Result.new(["id"], [[1]])) + Item.connection.expects(:internal_exec_query).returns(ActiveRecord::Result.new(["id"], [[1]])) result = Item.fetch_by_title("bob") assert_instance_of(Item, result) diff --git a/test/index_cache_test.rb b/test/index_cache_test.rb index f2892239..f8616464 100644 --- a/test/index_cache_test.rb +++ b/test/index_cache_test.rb @@ -34,7 +34,7 @@ def test_fetch_with_garbage_input def test_fetch_with_unique_adds_limit_clause Item.cache_index(:title, :id, unique: true) - Item.connection.expects(:exec_query) + Item.connection.expects(:internal_exec_query) .with(regexp_matches(/ LIMIT [1?]\Z/i), any_parameters) .returns(ActiveRecord::Result.new([], []))