Skip to content

Commit

Permalink
Update mocks for Rails 7+
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot committed Nov 23, 2023
1 parent 8315e4e commit 82aff4d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/fetch_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/index_cache_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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([], []))

Expand Down

0 comments on commit 82aff4d

Please sign in to comment.