-
Notifications
You must be signed in to change notification settings - Fork 9
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
Stop preconditions from being executed twice #130
Conversation
a1c92ed
to
b163b33
Compare
@toptal-anvil ping reviewers |
spec/spec_helper.rb
Outdated
@@ -13,7 +13,7 @@ | |||
require 'rspec/matchers/fail_matchers' | |||
require 'simplecov' | |||
SimpleCov.start do | |||
minimum_coverage 99.66 | |||
minimum_coverage 99.43 |
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.
I think it would be good to add a new spec to ensure the preconditions are only called once, I think you can call a spy/mock in
precondition { decline_with(:message) if login == '' } |
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.
Spec added 👍
@toptal-anvil ping reviewers |
@toptal-anvil ping reviewers |
60a1cb5
to
3fce264
Compare
I've converted to draft to hide from seal. I'll get back to this once I have a moment, or after oncall |
When running an action with
#try_perform!
, preconditions are being run twice. This PR fixes this.https://github.com/toptal/platform/pull/78833 is a platform PR run against this patch, with successfull unit tests and features:
How to test
TestAction.as_system.new(RoleStep.new).try_perform!
RUNNING PRECONDITION
twiceReview
Pre-merge checklist
master
(if not - rebase it).