mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Merge pull request #11573 from mkllnk/flaky-invoice-spec
Compare adjustments in deterministic order for invoices
This commit is contained in:
@@ -16,7 +16,7 @@ class Invoice
|
||||
has_many :all_eligible_adjustments, serializer: Invoice::AdjustmentSerializer
|
||||
|
||||
def all_eligible_adjustments
|
||||
object.all_adjustments.eligible
|
||||
object.all_adjustments.eligible.order(:id)
|
||||
end
|
||||
|
||||
def completed_at
|
||||
|
||||
@@ -51,7 +51,7 @@ describe OrderInvoiceComparator do
|
||||
end
|
||||
end
|
||||
|
||||
it "returns returns true" do
|
||||
it "returns true" do
|
||||
Spree::TaxRate.first.update!(amount: 0.15)
|
||||
order.create_tax_charge!
|
||||
order.reload
|
||||
@@ -69,7 +69,7 @@ describe OrderInvoiceComparator do
|
||||
end
|
||||
end
|
||||
|
||||
it "returns returns true" do
|
||||
it "returns true" do
|
||||
Spree::TaxRate.first.update!(amount: 0.15)
|
||||
order.create_tax_charge!
|
||||
order.reload
|
||||
@@ -79,7 +79,7 @@ describe OrderInvoiceComparator do
|
||||
|
||||
context "shipping method changes" do
|
||||
let(:shipping_method) { create(:shipping_method) }
|
||||
it "returns returns true" do
|
||||
it "returns true" do
|
||||
Spree::ShippingRate.first.update(shipping_method_id: shipping_method.id)
|
||||
expect(subject).to be true
|
||||
end
|
||||
@@ -145,7 +145,7 @@ describe OrderInvoiceComparator do
|
||||
}
|
||||
|
||||
context "changes on the order object" do
|
||||
it "returns true if the order didn't change" do
|
||||
it "returns false if the order didn't change" do
|
||||
expect(subject).to be false
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user