-
-
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
allow multiple taxons on product creation #2840
allow multiple taxons on product creation #2840
Conversation
context "adding taxons to a product" do | ||
let!(:product) { create(:product) } | ||
let!(:first_taxon) { create(:taxon) } | ||
let!(:second_taxon) { create(:taxon) } |
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.
This taxon is needlessly created for the first spec. let!
can also be problematic in creating records when you don't need them and can slow test suites down. Using let
will solve this.
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 the feedback @BenMorganIO, changes made. Let me know if there is anything else you can think of!
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. A spec for creating products would be 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.
I'm not a fan of adding this kind of callbacks in controllers but this whole file needs some love that should not be part of this PR, so for now 👍
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
add private methods for splitting up taxons and option_type_ids on the products controller, addressing a bug that only allowed for one of each to be applied on product creation
refs #2791