A FeatureToggle could be switched via a class_eval in an initializer.
The initializer was installed via ofn-install. We want to get rid of
custom, untracked initializers. Here I'm changing the FeatureToggle
class to use environment variables instead.
This change needs to be followed up with a change in ofn-install to use
the new environment variable. It affects only Australian production.
This groups the Customer Totals report by variant too (among others,
including by product), and then changes the report to use the variant
SKU not the product SKU.
This adds a spec for customer totals grouping and details, which
replaces the test specific to the SKU column.
This conversion is done by Transpec 3.4.0 with the following command:
transpec spec/lib/open_food_network/orders_and_fulfillments_report_spec.rb
* 8 conversions
from: == expected
to: eq(expected)
* 8 conversions
from: obj.should
to: expect(obj).to
* 1 conversion
from: obj.stub(:message)
to: allow(obj).to receive(:message)
For more details: https://github.com/yujinakayama/transpec#supported-conversions
We keep tests running by default without cache, keeping it as it was before 10a79d5a65
Additionally, cached_products_renderer no longer depends on Rails.env, so here we remove that dependency from it's spec.
Spree changed their way of soft-deleting products, variants and
some other models. `#destroy` is now soft-deleting and replaces
`#delete`.
This commit considers only products. Variants will follow in another
commit. The other models can be ignored, because we don't call `delete`
on them.
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
...