-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Enable partial doubles verification for RSpec (part 2) #3015
Enable partial doubles verification for RSpec (part 2) #3015
Conversation
frontend/spec/support/example_groups/partial_double_verification_example_group.rb
Outdated
Show resolved
Hide resolved
backend/spec/support/example_groups/partial_double_verification_example_group.rb
Outdated
Show resolved
Hide resolved
f1413ef
to
92e82c3
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, just left a question to DRY a little bit the RSpec helper.
@@ -0,0 +1,16 @@ | |||
# frozen_string_literal: true | |||
|
|||
module PartialDoubleVerificationExampleGroup |
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.
Can't we share the support file introduced in core via #3005 ? Maybe moving the module in core/lib
into the testing_support
folder?
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.
Other than @kennyadsl's comment to DRY this a little bit, LGTM! 💪
92e82c3
to
0ec2707
Compare
Allow mocking of `LineItem` user provided attributes through the `options` parameter.
Allows mocking of URL helpers in the footer view tests.
When mocking an authenticated user in a Backend or Frontend controller, use the `try_spree_current_user` method, instead of `spree_current_user`.
Disables RSpec partial double verification for Frontend checkout specs depending on the Order state machine, which is not supported.
Mocking dynamically defined methods is not supported when having `verify_partial_doubles` enabled.
0ec2707
to
ce85e17
Compare
Pushed some changes that DRYes the partial double verification support file as per @kennyadsl suggestion. |
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.
@cedum Thanks, I think your idea to keep the whole config in the same file is great.
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.
Good changes, 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.
Thanks for this @cedum! 🍰
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.
Looks good. Thanks for doing this!
This is a follow up of #3005 and enables the partial double verification for RSpec also in Solidus API, Frontend and Backend.