-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[Rails 7] Get rid of db-query-matchers gem #7232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Rails 7] Get rid of db-query-matchers gem #7232
Conversation
ab242b6
to
e6df0bc
Compare
Interesting. This dependency was introduced by #5811 The latest publisher of |
Is this dependency worth though? It is only used in two tests, which can be easily rewritten to check the same thing. For example we could subscribe to the |
If we can do the same thing through ActiveRecord notification subscription, I'd be ok with that and would approve. Ideally, we'd still want the database query check for these test cases. |
That is how db-query-matchers is implemented. I agree we should keep the SQL check. @alejandroperea do you want to improve the test to use the |
@rafaelfranca Sure! I'll take a look this weekend 👍 |
2ae618b
to
f7cdccc
Compare
@rafaelfranca Done! It is the first time I use I've added an Rspec matcher for doing this, just in case we want to use it in another place in the future. |
f7cdccc
to
da69461
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a very small feedback that you're free to address but I'm good with the current version too. Thanks so much!
da69461
to
0c08626
Compare
I agree @deivid-rodriguez ! Change applied 👍 Thanks for the review! :) |
Thanks so much!! |
I've seen in this issue #7196 that
db-query-matchers
gem is incompatible with Rails 7 and looks no longer maintained.I've introduced a custom Rspec matcher that subscribes to
sql.active_record
event and checks if the passed query matches (or not) with the executed ones.