From 914751842258fe025246cf2ddb056777bf4273b3 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Fri, 17 Apr 2020 14:51:06 +0100 Subject: [PATCH] Remove some unnecessary code --- spec/models/spree/calculator/price_sack_spec.rb | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/spec/models/spree/calculator/price_sack_spec.rb b/spec/models/spree/calculator/price_sack_spec.rb index 751f337cee..921b657f88 100644 --- a/spec/models/spree/calculator/price_sack_spec.rb +++ b/spec/models/spree/calculator/price_sack_spec.rb @@ -27,19 +27,16 @@ describe Spree::Calculator::PriceSack do end context "preferred discount amount is float" do - let(:float_calculator) do - float_calculator = Spree::Calculator::PriceSack.new - float_calculator.preferred_minimal_amount = 5 - float_calculator.preferred_normal_amount = 10.4 - float_calculator.preferred_discount_amount = 1.2 - float_calculator + before do + calculator.preferred_normal_amount = 10.4 + calculator.preferred_discount_amount = 1.2 end context 'when the order amount is below preferred minimal' do let(:price) { 2 } it "uses the float preferred normal amount" do - expect(float_calculator.compute(line_item)).to eq(10.4) + expect(calculator.compute(line_item)).to eq(10.4) end end @@ -47,7 +44,7 @@ describe Spree::Calculator::PriceSack do let(:price) { 6 } it "uses the float preferred discount amount" do - expect(float_calculator.compute(line_item)).to eq(1.2) + expect(calculator.compute(line_item)).to eq(1.2) end end end