Commit Graph

11293 Commits

Author SHA1 Message Date
Pau Pérez Fabregat
fb412cd9cd Merge pull request #3299 from luisramos0/2-0-admin-capture-payment
[Spree Upgrade] Fix order_with_totals_and_distribution factory by updating shipping fees
2019-02-15 18:37:43 +01:00
Pau Perez
4e35ea9149 Merge branch '2-0-stable' into 2-0-admin-capture-payment
* 2-0-stable:
  Perform delivery when checking deliveries in specs
2019-02-15 17:21:09 +01:00
Pau Pérez Fabregat
e67793b204 Merge pull request #3497 from coopdevs/fix-user-confirmation-spec
Perform delivery when checking deliveries in specs
2019-02-15 16:52:52 +01:00
Pau Perez
f29707fea3 Perform delivery when checking deliveries in specs
Otherwise checking `ActionMailer::Base.deliveries.count` won't see any.
2019-02-14 18:24:33 +01:00
Pau Perez
e5dadd1ab1 Merge branch '2-0-stable' into 2-0-admin-capture-payment
* 2-0-stable: (121 commits)
  Stub default value for other calls to File.exist?
  Add specs for error cases in shipments_controller_spec
  Move features/admin/reports/enterprise_fee_summaries_spec to xdescribe (will be fixed as part of spree upgrade phase 2)
  Add missing translation to fix shipping methods spec
  Test tagging polymorphism on a payment method
  Workaround Rails inheritance bug in Spree::Gateway
  Improve method names in shipments_controller_spec
  Move ProductImporter spec to xdescribe until all its specs are green (spree upgrade phase 2)
  Make bulk invoices part of spree upgrade phase 2
  Make Api::ShipmentsController#create re-use order.shipment if it exists Improve code and add specs to this controller
  Decorate spree api shipments controller to scope variants as they are added/removed from shipments
  Delete all Spree::Admin::LineItemsController customizations as they are no longer used
  Update spec/controllers/spree/orders_controller_spec.rb
  Fix broken spec from refactored method
  Wait for button to disappear before checking flash
  Use flash matcher in shipping method feature specs
  Add RSpec matchers for flash messages
  Do not expect modal open when checking spinner gone
  Fix layout violation in Spree::Ability decorator
  Fix description for feature flag example groups
  ...
2019-02-14 17:41:54 +01:00
Pau Perez
caf4441fa3 Do not mutate config's state in specs 2019-02-14 17:01:43 +01:00
Pau Perez
609ff737ca Fix and simplify feature spec 2019-02-14 17:01:43 +01:00
Pau Perez
e9173f440f Associate shipment to appropriate order in specs 2019-02-14 17:01:43 +01:00
Pau Pérez Fabregat
fce92090db Merge pull request #3479 from luisramos0/2-0-stable-Feb12
[Spree Upgrade] Merging master into 2-0-stable (2nd run in Feb2019)
2019-02-14 09:40:28 +01:00
Pau Pérez Fabregat
2d2e25b9fa Merge pull request #3484 from coopdevs/fix-invoices-controller-spec
Stub default value for other calls to File.exist?
2019-02-13 20:32:13 +01:00
Luis Ramos
c6cd1b7ef2 Merge pull request #3471 from luisramos0/2-0-bulk-invoices-phase2
[Spree Upgrade] Make Bulk Invoices part of spree upgrade phase 2
2019-02-13 12:37:15 +00:00
Luis Ramos
576c203679 Merge pull request #3370 from mkllnk/3121-spree-gateway-inheritance
[Spree upgrade] Workaround Rails inheritance bug in Spree::Gateway
2019-02-13 12:27:59 +00:00
Pau Perez
59e27ffc0e Stub default value for other calls to File.exist?
This fixes the following error

```
 1) Spree::Admin::InvoicesController#poll when the file is available returns true
     Failure/Error: spree_get :poll, invoice_id: invoice_id

       #<File (class)> received :exist? with unexpected arguments
         expected: ("tmp/invoices/479186263.pdf")
              got: ("/home/pau/dev/openfoodnetwork/tmp/cache/paralleltests/3B7/CD1/spree%2Fapp_configuration%2Fredirect_https_to_http")
        Please stub a default value first if message might be received with other args as well.
     # ./spec/controllers/spree/admin/invoices_controller_spec.rb:28:in `block (4 levels) in <top (required)>'
     # -e:1:in `<main>'
```

`paralleltests` also relies on `File.exist?` and so stubbing it breaks
it unless we purposefully allow other calls.
2019-02-13 13:16:28 +01:00
Pau Pérez Fabregat
1b7edab3d6 Merge pull request #3441 from luisramos0/2-0-shipments-api
[Spree Upgrade] Adapt api shipments controller to OFN by scoping variants before each action
2019-02-13 12:36:08 +01:00
luisramos0
5ccbf7b3ca Add specs for error cases in shipments_controller_spec 2019-02-13 10:37:21 +00:00
luisramos0
728ed2c202 Move features/admin/reports/enterprise_fee_summaries_spec to xdescribe (will be fixed as part of spree upgrade phase 2) 2019-02-13 09:06:10 +00:00
luisramos0
ff2bf76e38 Add missing translation to fix shipping methods spec 2019-02-13 09:05:35 +00:00
Maikel Linke
3b9fdfa7ac Test tagging polymorphism on a payment method 2019-02-13 16:31:38 +11:00
Maikel Linke
9044bf60b9 Workaround Rails inheritance bug in Spree::Gateway
Due to a bug in ActiveRecord we need to load the tagging code in Gateway which
should have inherited it from its parent PaymentMethod.
We have to call it before loading the PaymentMethod decorator because the
tagging code won't load twice within the inheritance chain.

https://github.com/openfoodfoundation/openfoodnetwork/issues/3121
2019-02-13 14:47:44 +11:00
luisramos0
ba8096ff85 Improve method names in shipments_controller_spec 2019-02-12 17:31:58 +00:00
luisramos0
c652cfe4d5 Merge branch 'master' into 2-0-stable-Feb12 2019-02-12 16:03:33 +00:00
Pau Pérez Fabregat
1f72eb9f68 Merge pull request #3378 from kevinchristianson/active-products-translation-fix
Add missing 'active products' translation on dashboard
2019-02-12 14:15:53 +01:00
Pau Pérez Fabregat
a0c144fd0c Merge pull request #3415 from openfoodfoundation/feature/enterprise_fee_summary
[Enterprise Fee Summary] Merge "Enterprise Fee Summary" report to master
2019-02-12 13:58:47 +01:00
Pau Pérez Fabregat
b6ca0ba24f Merge pull request #3456 from coopdevs/fix-last-orders-controller-spec
Fix orders controller spec
2019-02-12 12:47:15 +01:00
Pau Perez
24189ca88e Create shipping_rate earlier for callback to work
If the shipping_rate is not created at the time the `#after_save`'s
`#ensure_correct_adjustment` callback is executed its call to
`shipping_method.create_adjustment` won't be executed either.

As a result, the OrderUpdater wasn't able to see any adjustments related
to the shipment causing the order total to be outdated.
2019-02-12 12:11:55 +01:00
luisramos0
935c8cb0ce Move ProductImporter spec to xdescribe until all its specs are green (spree upgrade phase 2) 2019-02-12 10:38:03 +00:00
luisramos0
7c0b21eb83 Make bulk invoices part of spree upgrade phase 2 2019-02-12 10:37:22 +00:00
Pau Perez
ab0b759567 Merge branch '2-0-stable' into 2-0-admin-capture-payment
* 2-0-stable: (208 commits)
  Re implement orders ctrl update method so we can change redirection logic and add specs for it
  Improve readability in admin/orders_spec
  Add line items adjustments (order.price_adjustments) to the order edit page so that user is aware of adjustments included in the price like for example tax rates
  Adapt variants auto complete to spree v2 code with shipments
  Adapt customer search override to spree v2 and fix customer details spec in admin orders spec
  Fix distributor change spec in admin orders spec
  Fix admin orders spec non tax adjustments by adapting to new view
  Fix failing specs due to Spree 2's new order admin page Add missing form tag and OC and shops injectors on order form to make the OC field, the distributor field and the update button work
  Use Spree routes
  Fix shop accidentally becoming order coordinator
  Match date format in spec with import date filter
  Make in_stock? work for both variants and overrides by moving it from VariantStock to variant_decorator.
  Add unit test for VariantStock.can_supply?
  Remove rescue from products_reset_strategy in product import: if setting count_on_hand fails the import will raise a RuntimeError
  Change product import's product_reset_strategy from depending on the inexistent variant.count_on_hand DB field and instead make individual calls to variant.count_on_hand= defined in VariantStock. Also, added spec to test return value of the reset method: it should return number of updated records.
  Upgrade views to Spree 2 and apply overrides
  Updating translations for config/locales/en_US.yml
  Update name spaces for rake tasks to shorter 'ofn'.
  Refactor checking no preview image in specs
  Refactor checking of preview image path in specs
  ...
2019-02-12 11:12:40 +01:00
luisramos0
58ea28ebb4 Make Api::ShipmentsController#create re-use order.shipment if it exists
Improve code and add specs to this controller
2019-02-12 10:09:00 +00:00
luisramos0
77b390a836 Decorate spree api shipments controller to scope variants as they are added/removed from shipments 2019-02-12 10:09:00 +00:00
luisramos0
0f44beb477 Delete all Spree::Admin::LineItemsController customizations as they are no longer used 2019-02-12 10:09:00 +00:00
Pau Pérez Fabregat
a6c5e3423f Merge pull request #3474 from Matt-Yorkley/pi/broken_build
Fix broken spec from refactored method
2019-02-12 11:03:28 +01:00
Pau Pérez Fabregat
0cc2bd052e Merge pull request #3436 from luisramos0/2-0-orders-edit
[Spree Upgrade] Fix admin new order page flow (from order details to customer details)
2019-02-12 10:35:25 +01:00
Pau Pérez Fabregat
b51ad35cb1 Merge pull request #3445 from luisramos0/2-0-order-adjusts
[Spree Upgrade] Fix adjustments sections in admin order edit page
2019-02-12 10:16:30 +01:00
Pau Pérez Fabregat
92dca0cdfa Merge pull request #3194 from HugsDaniel/3109-fix-orders-new
[Spree Upgrade] Fix admin new order page
2019-02-12 09:58:29 +01: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
Matt-Yorkley
097ffba323 Fix broken spec from refactored method 2019-02-11 23:57:13 +00:00
Pau Pérez Fabregat
4165ba5cdb Merge pull request #3463 from coopdevs/enable-catalan
Import Catalan translation from Transifex
2019-02-11 18:13:50 +01:00
Luis Ramos
dd44d6a0ca Merge pull request #3355 from luisramos0/2-0-pord-importer-spec
[Spree Upgrade] Phase 2 - Fix product_importer spec
2019-02-11 15:28:47 +00:00
Pau Perez
990de63728 Merge branch 'master' into active-products-translation-fix
* master: (46 commits)
  Wait for button to disappear before checking flash
  Use flash matcher in shipping method feature specs
  Add RSpec matchers for flash messages
  Do not expect modal open when checking spinner gone
  Update issue templates
  Update all locales with the latest Transifex translations
  Do not show table until first time dereferencing is done
  Remove unused have_no_selector argument in feature test
  Compile row ID with higher priority
  Compile edit link with higher priority
  Support selecting date in next months
  Improve sync between keyword filter and selecting all
  Wait for datepicker to associate and open before selecting date
  Update cancan permissions for second iteration of bulk invoices
  Fix shop accidentally becoming order coordinator
  Match date format in spec with import date filter
  Update name spaces for rake tasks to shorter 'ofn'.
  Refactor checking no preview image in specs
  Refactor checking of preview image path in specs
  Fix race condition in enterprise image feature specs
  ...
2019-02-11 16:12:52 +01:00
Pau Pérez Fabregat
9d065c8a0b Merge pull request #3233 from Matt-Yorkley/pi/inventories
Pi/inventories
2019-02-11 16:10:33 +01:00
Pau Pérez Fabregat
da09c8f86c Merge pull request #3467 from kristinalim/fix/3455-intermittent_spec_failure
3455 [Flaky Spec] Do not expect modal still open when checking that the spinner is gone
2019-02-11 15:58:22 +01:00
Pau Pérez Fabregat
b508d51406 Merge pull request #3469 from kristinalim/fix/3468-intermittent_spec_failures
3468 [Flaky Spec] Check for presence of flash div before trying to get its text
2019-02-11 15:54:33 +01:00
luisramos0
ad0e5bb093 Re implement orders ctrl update method so we can change redirection logic and add specs for it 2019-02-10 15:31:01 +00:00
Kristina Lim
0032a237a2 Wait for button to disappear before checking flash 2019-02-10 22:08:18 +08:00
Kristina Lim
175264f41f Use flash matcher in shipping method feature specs 2019-02-10 22:08:18 +08:00
Kristina Lim
e14c60c1c1 Add RSpec matchers for flash messages 2019-02-10 22:08:18 +08:00
Kristina Lim
f143540d0c Do not expect modal open when checking spinner gone
The element referenced in the following might no longer be visible:

  within "div.reveal-modal"
2019-02-09 22:40:40 +08:00
Kristina Lim
b6be8c48d1 Fix layout violation in Spree::Ability decorator 2019-02-08 21:26:39 +00:00
Kristina Lim
de30cf1198 Fix description for feature flag example groups 2019-02-08 21:26:39 +00:00