mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
Attempt to spec for error
It didn't catch the error I was looking for. I'm not sure if it is a valid use case, but it still seems helpful to add coverage for current functionality.
This commit is contained in:
@@ -328,6 +328,23 @@ RSpec.describe CheckoutController, type: :controller do
|
||||
expect_cable_ready_redirect(response)
|
||||
end
|
||||
end
|
||||
|
||||
context "with existing invalid payments" do
|
||||
let(:invalid_payments) { [
|
||||
create(:payment, state: :failed),
|
||||
create(:payment, state: :void),
|
||||
] }
|
||||
|
||||
before do
|
||||
order.payments = invalid_payments
|
||||
end
|
||||
|
||||
it "deletes invalid payments" do
|
||||
expect{
|
||||
put(:update, params:)
|
||||
}.to change { order.payments.to_a }.from(invalid_payments)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "with no payment source" do
|
||||
|
||||
Reference in New Issue
Block a user