Skip to content

Commit 0569c31

Browse files
committed
Check that 2 queries are matched
1 parent 83cd6f0 commit 0569c31

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/cases/pessimistic_locking_test_sqlserver.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class PessimisticLockingTestSQLServer < ActiveRecord::TestCase
8989
eager_ids_sql = /SELECT\s+DISTINCT \[people\].\[id\] FROM \[people\] WITH\(UPDLOCK\) LEFT OUTER JOIN \[readers\] WITH\(UPDLOCK\)\s+ON \[readers\].\[person_id\] = \[people\].\[id\]\s+ORDER BY \[people\].\[id\] ASC OFFSET @0 ROWS FETCH NEXT @1 ROWS ONLY/
9090
loader_sql = /SELECT.*FROM \[people\] WITH\(UPDLOCK\).*WHERE \[people\]\.\[id\] IN/
9191

92-
assert_queries_match(/#{eager_ids_sql}|#{loader_sql}/) do
92+
assert_queries_match(/#{eager_ids_sql}|#{loader_sql}/, count: 2) do
9393
people = Person.lock(true).limit(5).offset(10).includes(:readers).references(:readers).to_a
9494
_(people[0].first_name).must_equal "Thing_10"
9595
_(people[1].first_name).must_equal "Thing_11"

0 commit comments

Comments
 (0)