Commit Graph

70 Commits

Author SHA1 Message Date
luisramos0
86b0d71c7e Result of rubocop auto-correct and rebuilding rubocop_manual_todo 2019-05-28 12:57:29 +01:00
Luis Ramos
3b2e614c57 Merge pull request #3734 from luisramos0/2-0-validate-distribution
Removing a variant from OC will prevent user with that variant in the cart from checking out
2019-05-02 16:12:41 +01:00
luisramos0
fce3d69345 Add flash and warning to the cart page when item becomes unavailable 2019-04-13 21:39:41 +01:00
luisramos0
87327f7aa9 Fix specs testing order cancelation email. The email template now needs a order distributor for the signoff part 2019-04-04 13:41:07 +01:00
luisramos0
c1d14686a6 Merge branch 'master' into 2-0-stable-Mar22 2019-03-22 10:55:17 +00:00
Maikel Linke
d62908fd2d Add spec for registration link on Spree pages
The `registration_path` helper resolves to `/signup` in Spree
controllers due to spree_auth_device > config > routes.rb.
We worked around that in:
https://github.com/openfoodfoundation/openfoodnetwork/pull/3174

Here we add a spec for this so that we can test more easily if we
remove that workaround or detect it's accidental removal.
2019-03-21 10:06:15 +11:00
luisramos0
d840fa7b77 Improve order factories:
- Make order_with_totals_and_distribution shorter by inheriting from order_with_distributor
- Make completed_order_with_fees more correct by inheriting only from order_with_distributor: this removes the line_item_with_shipment of order_with_totals_and_distribution that was causing an extra shipping adjustment to be kept in the order. This adjustment was being tested in the order controller spec (fixed the explanation comment in the spec which was wrong, there was no enterprise fee in this order)
2019-03-01 20:00:58 +00:00
Luis Ramos
edd1da7d50 Update spec/controllers/spree/orders_controller_spec.rb
Fix typo in doc

Co-Authored-By: sauloperez <saulopefa@gmail.com>
2019-02-12 09:12:03 +01:00
Pau Perez
f998748634 Clarify why we end up with 3 adjustments
And the second one is open.
2019-02-08 18:16:00 +01:00
Pau Perez
cde465edad Fix orders controller spec 2019-02-07 16:05:18 +01:00
Pau Perez
f4b790eefa Restore adjustments state after updating
We don't know exactly if all adjustments are closed in all
circumstances, so it's better to be conservative until we figure out.
Chances are that non-completed orders have them open.
2019-01-29 09:40:54 +01:00
Pau Perez
c9429760cd Trigger the appropriate callbacks from controller 2019-01-29 09:40:54 +01:00
Pau Perez
0b62b4621f Make expectation easier to reason about 2019-01-29 09:40:54 +01:00
Pau Perez
9d1d8513e7 Make controller req. params a bit more obvious 2019-01-29 09:40:54 +01:00
Pau Perez
f589d4125d Restore distributor in test that relies on it 2019-01-29 09:40:54 +01:00
Pau Perez
1bceb0748a Do not modify config's state in test 2019-01-29 09:40:53 +01:00
luisramos0
b40c0e5b80 Fix order controller spec with enterprise fees by adapting to new order factory with 5 line items by default 2018-11-17 12:11:23 +00:00
luisramos0
9b894c6a55 Fix orders controller spec when removing line items from order. Improved spec and adapted to the fact that in spree 2 the default number of line items in this factory is 5 2018-11-13 19:51:26 +00:00
luisramos0
fcdb5cd7af Merge branch 'master' into 2-0-stable-nov-8th 2018-11-08 11:18:54 +00:00
Maikel Linke
e6adb8a3b9 Extract email setup in specs for easy upgrade
The way we set up email sending completely changes with Spree 2. This
change encapsulates that code in a single method so that it can be
changed easily and doesn't create further merge conflicts while we are
still working on the master branch and the Spree upgrade.
2018-10-25 13:53:22 +11:00
luisramos0
87cd73ddba Merge branch 'master' into 2-0-stable-oct 2018-10-15 17:09:26 +01:00
Pau Pérez Fabregat
5a11af9118 Merge pull request #2668 from luisramos0/2-0-ship-method-order-spec
[Spree 2 Upgrade] Fixed models/order_spec issues related to order.shipping_method
2018-09-10 11:18:10 +02:00
Maikel
bce2c1cfd5 Merge pull request #2588 from luisramos0/spree2_mail_method_specs
Spree 2 Upgrade - MailMethod - Fix "undefined mail method" error in specs
2018-09-10 11:28:34 +10:00
luisramos0
73512d3591 Replaced order.shipping_method with order.shipments in models.order_spec.
Fixed factory completed_order_with_fees used in order_spec and also in line_items_controller_spec and orders_controller_spec.
2018-09-09 23:13:32 +01:00
Kristina Lim
cd41498da9 Ask to login when not authenticated for order page
Redirect the user to the login page, instead of responding with HTTP
401.
2018-09-06 16:26:48 +08:00
Kristina Lim
3bf9e95511 Add specs for existing behaviour in order page 2018-09-06 16:26:45 +08:00
Kristina Lim
28d2bb3d47 Wrap controller specs for viewing cart 2018-09-06 15:04:11 +08:00
luisramos0
b5038fa5dc Changed calls to MailMethod in specs to calls to Spree::Config[:mails_from] 2018-08-27 21:02:54 +01:00
luisramos0
ec069b1e3e Converted specs to latest rspec syntax 2018-08-23 12:39:58 +01:00
luisramos0
6caa361354 Moved Spree::OrderController.populate to new CartController.
This was done to make order populate independent of Spree::OrdersController
2018-08-23 12:37:52 +01:00
Pau Perez
daf12d1300 Revert "Refactor Order#current_order argument"
This reverts commit ae935202be.
2018-06-05 18:42:41 +02:00
Pau Perez
89c2733f50 Revert "Removing redundant curly braces"
This reverts commit 03173d4f7b.
2018-06-05 18:42:31 +02:00
Pau Perez
32069cffe1 Revert "Removing useless spaces"
This reverts commit d81b6be259.
2018-06-05 18:42:19 +02:00
Hugo Daniel
595a622d5b Removing useless spaces 2018-04-17 16:10:41 +02:00
Hugo Daniel
d9f451b6fe Removing redundant curly braces 2018-04-17 16:10:41 +02:00
Hugo Daniel
abe5d3596c Refactor Order#current_order argument 2018-04-17 16:10:41 +02:00
Enrico Stano
01b0a033fd Merge pull request #1904 from oeoeaio/spree-test-config
Use Spree's approach for preventing config caching when testing
2017-12-04 15:57:11 +11:00
Rob Harrington
82072c8970 Explicitly specifying 'type: :controller' for all controller specs 2017-11-10 08:47:12 +11:00
Matt-Yorkley
01647c3df9 Disable allow_backorders by default in test environment 2017-11-02 17:43:46 +11:00
Enrico Stano
7874d96003 Set MailMethod for test environment when needed 2017-09-08 23:55:50 +10:00
Enrico Stano
8e5b94b5ca Fixing orders controller issue by setting data up correctly 2017-09-08 23:55:49 +10:00
Rob Harrington
77c8c85775 Memoizing the result of OrdersController#order_to_update 2017-05-12 16:11:16 +10:00
Rob Harrington
56c2350d36 Updating enterprise fees on completed order from OrdersController#update 2017-05-10 12:04:32 +10:00
Rob Harrington
3df629bc6e Prevent users from removing the final line item of an order, suggest cancelling instead 2017-05-05 14:20:57 +10:00
Rob Harrington
0dd8959bf7 Use an actual completed order for OrdersController#order_to_update spec 2017-05-05 14:20:57 +10:00
Rob Harrington
c6afa1849c Basic routing for front-end OrdersController#cancel action 2017-05-05 14:19:32 +10:00
Rob Harrington
eec3a21c89 Allow editing of completed orders from confirmation page where distributor allows it 2017-05-05 14:19:32 +10:00
Rob Harrington
630b8a2577 Add OrdersController#order_to_update method, to allow updating a complete order where appropriate 2017-05-05 14:19:32 +10:00
Rohan Mitchell
f691636c75 Fix spec 2016-04-27 14:47:45 +10:00
Rohan Mitchell
a26266159c Fix timing issue: change in client-side value during server update 2016-04-22 10:47:20 +10:00