mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Update test sentences to fit new PriceSack behavior
This commit is contained in:
committed by
Maikel Linke
parent
213456f4d9
commit
5ec89dde42
@@ -66,7 +66,7 @@ describe EnterpriseFee do
|
||||
|
||||
describe "scopes" do
|
||||
describe "finding per-item enterprise fees" do
|
||||
it "does not return fees with FlatRate and FlexiRate calculators" do
|
||||
it "does not return fees with FlatRate, FlexiRate and PriceSack calculators" do
|
||||
create(:enterprise_fee, calculator: Spree::Calculator::FlatRate.new)
|
||||
create(:enterprise_fee, calculator: Spree::Calculator::FlexiRate.new)
|
||||
create(:enterprise_fee, calculator: Spree::Calculator::PriceSack.new)
|
||||
@@ -84,7 +84,7 @@ describe EnterpriseFee do
|
||||
end
|
||||
|
||||
describe "finding per-order enterprise fees" do
|
||||
it "returns fees with FlatRate and FlexiRate calculators" do
|
||||
it "returns fees with FlatRate, FlexiRate and PriceSack calculators" do
|
||||
ef1 = create(:enterprise_fee, calculator: Spree::Calculator::FlatRate.new)
|
||||
ef2 = create(:enterprise_fee, calculator: Spree::Calculator::FlexiRate.new)
|
||||
ef3 = create(:enterprise_fee, calculator: Spree::Calculator::PriceSack.new)
|
||||
|
||||
@@ -13,14 +13,14 @@ describe Spree::Calculator::PriceSack do
|
||||
|
||||
context 'when the order amount is below preferred minimal' do
|
||||
let(:price) { 2 }
|
||||
it "computes with a line item object" do
|
||||
it "uses the preferred normal amount" do
|
||||
expect(calculator.compute(line_item)).to eq(10)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the order amount is above preferred minimal' do
|
||||
let(:price) { 6 }
|
||||
it "computes with a line item object" do
|
||||
it "uses the preferred discount amount" do
|
||||
expect(calculator.compute(line_item)).to eq(1)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user