8000 perform_database_query_matcher should be truthy as long as one query … · activeadmin/activeadmin@1477e90 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1477e90

Browse files
perform_database_query_matcher should be truthy as long as one query matches (#8471)
* perform_database_query_matcher should be truthy as long as one query matches Before this commit the order or SQL queries matter: - match, not match results in a false matching when it should be true * Update spec/support/matchers/perform_database_query_matcher.rb Co-authored-by: Javier Julio <JJfutbol@gmail.com> --------- Co-authored-by: Javier Julio <JJfutbol@gmail.com>
1 parent 7117d59 commit 1477e90

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spec/support/matchers/perform_database_query_matcher.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
@match = nil
88

99
callback = lambda do |_name, _started, _finished, _unique_id, payload|
10-
@match = query_regexp.match?(payload[:sql])
10+
if query_regexp.match?(payload[:sql])
11+
@match = true
12+
end
1113
end
1214

1315
ActiveSupport::Notifications.subscribed(callback, "sql.active_record", &block)

0 commit comments

Comments
 (0)
0