Skip to content

Commit

Permalink
add expectation for lock
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan Krage <[email protected]>
  • Loading branch information
rkrage and Ryan Krage committed Nov 21, 2023
1 parent e55f9f1 commit e202818
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spec/safe_statements_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,8 @@ def up

expect do
test_migration.suppress_messages { test_migration.migrate(:up) }
end.to make_database_queries(matching: /CREATE INDEX "index_foos_on_bar"/, count: 1)
end.to make_database_queries(matching: /LOCK "public"\."foos" IN SHARE MODE/, count: 1)
.and(make_database_queries(matching: /CREATE INDEX "index_foos_on_bar"/, count: 1))

indexes = ActiveRecord::Base.connection.indexes("foos")
expect(indexes.size).to eq(1)
Expand Down

0 comments on commit e202818

Please sign in to comment.