Skip to content
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

Conversation

jacobherrington
Copy link
Contributor

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

context "adding taxons to a product" do
let!(:product) { create(:product) }
let!(:first_taxon) { create(:taxon) }
let!(:second_taxon) { create(:taxon) }
Copy link
Contributor

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.

Copy link
Contributor Author

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!

Copy link
Member

@tvdeyen tvdeyen left a 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

Copy link
Member

@kennyadsl kennyadsl left a 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 👍

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@kennyadsl kennyadsl merged commit 7c626c2 into solidusio:master Oct 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants