Skip to content

Commit 3b1ae8c

Browse files
committed
Coverage: Test nil order in Flexi Rate calculator
1 parent d98106d commit 3b1ae8c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

promotions/spec/models/solidus_promotions/calculators/flexi_rate_spec.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,21 @@
188188

189189
subject { calculator.compute(price, { order: order, quantity: quantity }) }
190190

191+
context "with no order given" do
192+
let(:order) { nil }
193+
194+
context "when first_item and additional_item have values" do
195+
let(:first_item) { 1.13 }
196+
let(:additional_item) { 2.11 }
197+
198+
context "with quantity 2" do
199+
let(:quantity) { 2 }
200+
201+
it { is_expected.to eq(1.62) }
202+
end
203+
end
204+
end
205+
191206
context "if nothing is in the cart" do
192207
let(:line_item_quantity) { 0 }
193208

0 commit comments

Comments
 (0)