Skip to content

Commit

Permalink
Shipping method factory should respect currency config
Browse files Browse the repository at this point in the history
  • Loading branch information
Sinetheta committed Jul 12, 2017
1 parent 530d578 commit 696ff76
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

transient do
cost 10.0
currency 'USD'
currency { Spree::Config[:currency] }
end

before(:create) do |shipping_method, _evaluator|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
shipping_method = create(factory)
expect(shipping_method.calculator.calculable).to eq(shipping_method)
end

context 'store using alternate currency' do
before { Spree::Config[:currency] = 'CAD' }

it "should configure the calculator correctly" do
shipping_method = create(factory)
expect(shipping_method.calculator.preferences[:currency]).to eq('CAD')
end
end
end

describe 'base shipping method' do
Expand Down

0 comments on commit 696ff76

Please sign in to comment.