Commit Graph

146 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
luisramos0
6dcc0b1d68 Run transpec for spec/jobs 2019-05-09 23:29:11 +01:00
Kristina Lim
71f379a318 Uncomment passing specs for SubscriptionPlacementJob 2019-05-01 07:16:55 +08:00
Maikel Linke
6f12eee8ae Reduce the override of Order for subscriptions
Orders belonging to subscriptions get completed without payment. That
requires overriding Spree's functionality.

In Spree 2, an order in payment state without pending orders is invalid.
Instead we skip the payment state by not requiring a payment for
automatically generated orders until the order cycle is closed.
2019-04-16 10:30:14 +10:00
Kristina Lim
f0746eb643 Use :performing_deliveries in spec 2019-03-28 02:04:13 +08:00
Kristina Lim
2aad5baac5 Make code style changes for SubscriptionConfirmJob specs 2019-03-25 22:22:11 +08:00
Kristina Lim
18fe35e130 Address spec failures for SubscriptionConfirmJob 2019-03-25 21:55:38 +08:00
Pau Pérez Fabregat
846e6fdd90 Merge pull request #3560 from kristinalim/fix/2788-shipping_method_id_in_shipments
2696,2788 [Spree Upgrade] Fix use of shipping method ID for subscriptions
2019-03-22 11:08:23 +01:00
luisramos0
60ee17204b Merge branch 'master' into 2-0-stable-Mar16 2019-03-16 16:17:38 +00:00
Pau Perez
e60437c6a2 Refactor test to execute public API instead 2019-03-14 18:53:11 +01:00
Pau Perez
b9636b975a Refactor test to stop using .any_instance
Although might be useful in very particular cases its use is discourage
by RSpec itself. See https://relishapp.com/rspec/rspec-mocks/docs/working-with-legacy-code/any-instance
2019-03-14 18:53:11 +01:00
Pau Perez
bc34d04c31 Do not retry when refreshing cache on deleted OC 2019-03-14 18:53:11 +01:00
Kristina Lim
0cfee37567 Fix setup records for SubscriptionPlacementJob specs 2019-03-13 12:45:56 +08:00
luisramos0
b325cea6cb Merge branch 'master' into 2-0-stable-Mar6 2019-03-06 09:19:53 +00:00
Luis Ramos
72e9c1d002 Merge pull request #3321 from luisramos0/2-0-delete-acct-invoices
[Spree Upgrade] Delete Accounts and Billing dead feature code until we decide we want to start using it again
2019-03-04 15:54:09 +00:00
luisramos0
36e2786a1e Delete Accounts and Billing dead feature code 2019-02-25 14:37:16 +00:00
Matt-Yorkley
627b101be9 Don't process proxy_order if the order has been cancelled 2019-02-24 12:06:58 +00:00
luisramos0
f0842fcbe5 Convert all calls to variant.count_on_hand to variant.on_hand 2019-02-18 21:54:07 +00:00
luisramos0
bd24d3e27a Remove setting the now inexistent global config allow_backorders to false in subs specs because the default value for on_demand (set through stocklocation.backorderabl_default) is false in all specs 2019-01-25 22:12:13 +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
7ae5a615b2 Move all specs in update_account_invoices_spec and finalize_account_invoices_spec.rb temporarily to pending 2018-10-21 22:09:21 +01:00
luisramos0
b0ffb0f91a Move all specs in subscription_confirm_job_spec temporarily to pending 2018-10-21 22:07:23 +01:00
luisramos0
1d49edb194 Making SubsPlacementJobSpec pending, 6 tests to be fixed in issue #2793 2018-09-30 00:10:31 +01:00
Pau Pérez Fabregat
0f118baa4e Merge pull request #2615 from mkllnk/2575-variant-on-hand-api
2575 variant on hand api
2018-09-03 11:16:02 +02:00
Maikel Linke
cebcdea40c Replace obsolete count_on_hand call for variant
The variant factory supports only `on_hand` now.
2018-08-30 13:55:12 +10:00
luisramos0
efcf680094 Fixed bulk_line_items_controller_spec by setting shipment on test line_items and by allowing shipment decorator to allow no adjustments in the shipment
Fixed 5 out of 7 tests in orders_and_fulfillments_report_spec by providing target_shipment in test line_items
Fixed 12 out of 44 broken tests in bulk_order_management_spec.rb by providing target_shipment in test line_items.” “The remaining 32 failing tests are now failing with the very common: undefined method on_hand= on Spree::Variant
Improved 1 test in reports_spec.rb by providing target_shipment in test line_items. Test now fails with undefined method Spree::Order.shipping_method
Fixed 9 tests in orders_controller_spec by providing target_shipment in test line_items
Fixed 4 tests in packing_report_spec.rb by providing target_shipment in test line_items. Failing tests are now failing with undefined product.on_hand? method
Fixed 8 tests in line_items_controller_spec by providing target_shipment in test line_items
Fixed 1 test in update_billable_periods_spec by providing target_shipment in test line_items
Fixed 4 tests in bulk_coop_report_spec by providing target_shipment in test line_items. The 2 failing tests are now failing with undefined product.on_hand? method
Improved 1 test in line_items_controller_spec by providing target_shipment in test line_items. Test is still failing with an unexpected method call
Fixed 1 test in order_and_distributor_report_spec by providing target_shipment in test line_items
2018-08-30 00:33:15 +01:00
Rob Harrington
3dacd06b6b Reload order before sending emails to ensure state is up to date 2018-07-05 19:26:12 +10:00
Pau Pérez Fabregat
7ff7fe4891 Merge pull request #2122 from oeoeaio/subs-unplaced-fees
Subs: prevent fees from displaying in email when subscription order cannot be fulfilled
2018-06-06 07:57:18 +02:00
Rob Harrington
e3ea60fda5 Process proxy orders even if underlying subscription has been paused or cancelled 2018-06-01 16:57:56 +10:00
Rob Harrington
6a71aafce1 Update totals for empty order before sending email 2018-04-16 17:07:07 +10:00
Rob Harrington
f5e77cdcec Ensure order total for uplaced subscription orders is zero 2018-04-16 17:07:07 +10:00
Rob Harrington
50ffd7ca01 Clear adjustments on subs orders when no items are able to be fulfilled
This prevents shipping and payment fees from being displayed in the notification email
2018-04-16 17:07:07 +10:00
Pau Perez
aa4bd7f397 Improve code style and docs of job 2018-02-09 09:53:39 +01:00
Rob Harrington
b7876ebfbf Replace references to 'standing order' with 'subscription' (spec) 2018-02-09 14:44:14 +11:00
Rob Harrington
902802594f Renaming standing order files (lib, spec) 2018-02-09 14:44:13 +11:00
Rob Harrington
fe7b86ff60 Fix broken call to log_order which should have been record_order 2018-02-09 14:44:12 +11:00
Rob Harrington
ceab1fe16a Reduce cognitive complexity of StandingOrderPaymentUpdater 2018-02-09 14:44:11 +11:00
Rob Harrington
7ca60e1990 Use activerecord error translations properly 2018-02-09 14:44:09 +11:00
Rob Harrington
8ba1a909ca Use summarizer for standing order confirm job 2018-02-09 14:44:08 +11:00
Rob Harrington
b49c44f7ce Generalise record_failure method to record_and_log_error 2018-02-09 14:44:08 +11:00
Rob Harrington
818af47613 Move rescue clause to process method
This prevents a placement email from being sent unless the order is processed successfully
2018-02-09 14:44:08 +11:00
Rob Harrington
ef6c9ec0f0 Integrate standing order summarizer into placement job 2018-02-09 14:44:08 +11:00
Rob Harrington
fb28940952 Use Time.zone.now instead of Time.now 2018-02-09 14:44:07 +11:00
Rob Harrington
03f1980b1b Auto-correct rubocop offences for standing-orders 2018-02-09 14:44:07 +11:00
Rob Harrington
26a325e6e0 Handle payment processing errors for standing orders 2018-02-09 14:44:07 +11:00
Rob Harrington
6e83c6dc86 Move standing order emails to a dedicated StandingOrderMailer 2018-02-09 14:44:07 +11:00
Rob Harrington
d6a9d63de5 Replace StandingOrderSyncJob with ProxyOrderSyncer service object 2018-02-09 14:44:06 +11:00
Rob Harrington
3aee0b5e70 Allow proxy order syncer to accept both ActiveRecord::Relation or StandingOrder 2018-02-09 14:44:06 +11:00
Rob Harrington
6d5c920a95 Split proxy order sync logic out into dedicated service object 2018-02-09 14:44:06 +11:00