mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-11 23:17:48 +00:00
For some reason in rails 4/spree 2.1 setting the line item as adjustable on the adjustment is not enough to populate line_item.adjustments. Here we make this assignment explicit fixing the spec in rails 4
This commit is contained in:
@@ -40,10 +40,13 @@ module Spree
|
||||
|
||||
describe "finding line items with and without tax" do
|
||||
let(:tax_rate) { create(:tax_rate, calculator: Spree::Calculator::DefaultTax.new) }
|
||||
let!(:adjustment1) { create(:adjustment, adjustable: li1, originator: tax_rate, label: "TR", amount: 123, included_tax: 10.00) }
|
||||
let!(:adjustment2) { create(:adjustment, adjustable: li1, originator: tax_rate, label: "TR", amount: 123, included_tax: 10.00) }
|
||||
let!(:adjustment1) { create(:adjustment, originator: tax_rate, label: "TR", amount: 123, included_tax: 10.00) }
|
||||
|
||||
before { li1; li2 }
|
||||
before do
|
||||
li1
|
||||
li2
|
||||
li1.adjustments << adjustment1
|
||||
end
|
||||
|
||||
it "finds line items with tax" do
|
||||
expect(LineItem.with_tax).to eq([li1])
|
||||
|
||||
Reference in New Issue
Block a user