Merge pull request #11573 from mkllnk/flaky-invoice-spec

Compare adjustments in deterministic order for invoices
This commit is contained in:
Filipe
2023-09-21 11:34:29 +01:00
committed by GitHub
2 changed files with 5 additions and 5 deletions

View File

@@ -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

View File

@@ -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