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

Improve order factories #3611

Open
luisramos0 opened this issue Mar 16, 2019 · 0 comments
Open

Improve order factories #3611

luisramos0 opened this issue Mar 16, 2019 · 0 comments

Comments

@luisramos0
Copy link
Contributor

luisramos0 commented Mar 16, 2019

What we should change and why (this is tech debt)

There's so much stuff happening on the order workflow that in specs we should never set order.state. The order.state should be achieved through the workflow order.next.

This task is to remove all uses of order state in spec tests, for example:
let!(:order1) { create(:order, state: 'complete', completed_at: 1.day.ago, distributor: dist1, billing_address: create(:address) ) }

Some specs where this is done:

  • spec/controllers/admin/bulk_line_items_controller_spec.rb
  • spec/controllers/api/orders_controller_spec.rb:
  • spec/controllers/spree/api/line_items_controller_spec.rb
  • spec/features/admin/adjustments_spec.rb
  • spec/features/admin/bulk_order_management_spec.rb
  • spec/lib/open_food_network/order_and_distributor_report_spec.rb
  • spec/mailers/producer_mailer_spec.rb
  • spec/serializers/order_serializer_spec.rb

Impact and timeline

Better and more correct specs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: All the things
Development

No branches or pull requests

1 participant