mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Use preferred_currency instead of preferences[:currency]. Use constant for currency instead of config var.
Conflicts: spec/models/spree/shipping_method_spec.rb
This commit is contained in:
@@ -38,26 +38,27 @@ module Spree
|
||||
|
||||
describe "availability" do
|
||||
let(:sm) { create(:shipping_method) }
|
||||
let(:currency) { 'AUD' }
|
||||
|
||||
before do
|
||||
sm.calculator.preferences[:currency] = Spree::Config.currency
|
||||
sm.calculator.preferred_currency = currency
|
||||
end
|
||||
|
||||
it "is available to orders that match its distributor" do
|
||||
o = create(:order, ship_address: create(:address),
|
||||
distributor: sm.distributors.first, currency: Spree::Config.currency)
|
||||
distributor: sm.distributors.first, currency: currency)
|
||||
sm.should be_available_to_order o
|
||||
end
|
||||
|
||||
it "is not available to orders that do not match its distributor" do
|
||||
o = create(:order, ship_address: create(:address),
|
||||
distributor: create(:distributor_enterprise), currency: Spree::Config.currency)
|
||||
distributor: create(:distributor_enterprise), currency: currency)
|
||||
sm.should_not be_available_to_order o
|
||||
end
|
||||
|
||||
it "is available to orders with no shipping address" do
|
||||
o = create(:order, ship_address: nil,
|
||||
distributor: sm.distributors.first, currency: Spree::Config.currency)
|
||||
distributor: sm.distributors.first, currency: currency)
|
||||
sm.should be_available_to_order o
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user