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

3217 [Enterprise Fee Summary] Move setup code in tests to factories #3312

Conversation

kristinalim
Copy link
Member

Move setup code in Enterprise Fee Summary tests to factories.

What? Why?

Closes #3217

This cleans up the code, and allows customization and reuse of setup logic in the tests.

What should we test?

No user-observable changes expected.

Release notes

  • Add more factories and factory traits for tests.

Changelog Category: Added

Dependencies

This requires #3115 to be merged to the transitional branch first.

@kristinalim kristinalim self-assigned this Jan 11, 2019
@kristinalim kristinalim changed the title 3217 Move setup code in Enterprise Fee Summary tests to factories 3217 [Enterprise Fee Summary] Move setup code in tests to factories Jan 13, 2019
@kristinalim kristinalim force-pushed the feature-enterprise_fees_report-move_setup_to_factories branch from eef993f to 73e15c1 Compare January 13, 2019 02:02
Copy link
Contributor

@luisramos0 luisramos0 left a comment

Choose a reason for hiding this comment

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

Awesome @kristinalim we finally have /spec/factories/ 🎉
It's also good you are just adding new stuff, moving things from factories.rb to here will be better done after v2 :-)

I approve the PR, please follow my suggestions below if you agree, otherwise ignore.

spec/factories/calculators.rb Outdated Show resolved Hide resolved
spec/factories/orders.rb Outdated Show resolved Hide resolved
spec/factories/variants.rb Outdated Show resolved Hide resolved
@kristinalim
Copy link
Member Author

kristinalim commented Jan 16, 2019

Thanks for your feedback, @luisramos0!

I renamed the files in spec/factories/ to:

  1. calculable_object_factory.rb
  2. order_factory.rb
  3. variant_factory.rb

Make these follow the "#{SINGULAR_OBJECT}_factory.rb" convention.
@kristinalim kristinalim force-pushed the feature-enterprise_fees_report-move_setup_to_factories branch from d2ac046 to 2e14251 Compare January 16, 2019 08:36
@luisramos0
Copy link
Contributor

awesome, ready for testing.

@sigmundpetersen
Copy link
Contributor

And it's a no-test so even ready to go? @luisramos0

@luisramos0
Copy link
Contributor

ah, yes, thanks for the heads up @sigmundpetersen
lets just wait and confirm the build is green.

@mkllnk mkllnk merged commit b7131b4 into openfoodfoundation:feature/enterprise_fee_summary Jan 16, 2019
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.

4 participants