From 780ec598d6892ee8bd02e261ac4b836c99491024 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Fri, 4 Mar 2016 11:31:18 +1100 Subject: [PATCH] Use preferred_currency instead of preferences[:currency]. Use constant for currency instead of config var. Conflicts: spec/models/spree/shipping_method_spec.rb --- spec/models/spree/shipping_method_spec.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/spec/models/spree/shipping_method_spec.rb b/spec/models/spree/shipping_method_spec.rb index 135b0b0092..33c44b8b6d 100644 --- a/spec/models/spree/shipping_method_spec.rb +++ b/spec/models/spree/shipping_method_spec.rb @@ -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