* 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
...
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.
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
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.
* 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
...
* 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
...