-
-
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
Add factory_bot lint test to core #3647
Conversation
388a336
to
83d8889
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.
Do we want this as part of our RSpec core tests or do we want it as a separate task? I don't have a particular opinion either way, but I thought it worth considering.
Side note: I'm going to refrain from approving this PR since technically I sponsored it, even though @seand7565 selected this task himself.
I think it's okay for this to be part of the test suite, just left a couple of minor comments! |
Adds a test that lints FactoryBot. Also makes changes to two tests to conform to the lint - store_credit_event_factory needs to have an action, even if the action is replaced with one of the sub factories. store_credit_reason_factory tripped the linter because of a uniqueness contraint for the name - should not come up in normal testing, but I added a sequencer to account for it in the linter anyway. The linter ignores just one factory - customer_return_without_return_items this factory is intentionally invalid (see: /core/spec/lib/spree/core/testing_support/factories/customer_return_factory_spec.rb#L37 )
83d8889
to
92a5e3b
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.
@seand7565 thank you 👍
THIS PR SPONSORED BY Super Good Software
Description
Adds a test that lints FactoryBot. Also makes changes to two tests to
conform to the lint - store_credit_event_factory needs to have an
action, even if the action is replaced with one of the sub factories.
store_credit_reason_factory tripped the linter because of a uniqueness
contraint for the name - should not come up in normal testing, but I
added a sequencer to account for it in the linter anyway.
The linter ignores just one factory - customer_return_without_return_items
this factory is intentionally invalid (see:
customer_return_factory_spec.rb
).. though I think we should re-evaluate that, maybe open an issue for changing it.
This PR is attempting to close (at the time of writing) the oldest issue for Solidus, #568
Checklist: