mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Fix rebase issue
Fix test by creating a variant instead of relying on some random data from the database.
This commit is contained in:
@@ -136,7 +136,9 @@ end
|
||||
|
||||
RSpec.shared_examples "associated attribute changes - line items" do |boolean, type|
|
||||
context "line item changes" do
|
||||
let(:line_item){ order.line_items.first }
|
||||
let(:line_item) { order.line_items.first }
|
||||
let(:variant) { create(:variant) }
|
||||
|
||||
context "on quantitity" do
|
||||
before { line_item.update!(quantity: line_item.quantity + 1) }
|
||||
it "returns #{boolean} if a #{type} attribute changes" do
|
||||
@@ -146,7 +148,7 @@ RSpec.shared_examples "associated attribute changes - line items" do |boolean, t
|
||||
end
|
||||
|
||||
context "on variant id" do
|
||||
before { line_item.update!(variant_id: Spree::Variant.first.id) }
|
||||
before { line_item.update!(variant_id: variant.id) }
|
||||
it "returns #{boolean} if a #{type} attribute changes" do
|
||||
order.reload
|
||||
expect(subject).to be boolean
|
||||
|
||||
Reference in New Issue
Block a user