Fix failing specs

This commit is contained in:
Gaetan Craig-Riou
2023-04-04 13:36:50 +10:00
committed by Maikel Linke
parent bb9d835bd8
commit a1ad25f217
2 changed files with 3 additions and 1 deletions

View File

@@ -275,7 +275,7 @@ describe SplitCheckoutController, type: :controller do
context "when adding fails" do
it "returns 422 and an error message" do
# Makes adding the voucher fails
allow(voucher).to receive(:compute_amount).and_return(0)
allow(voucher).to receive(:create_adjustment).and_return(nil)
allow(Voucher).to receive(:find_by).and_return(voucher)
put :update, params: params

View File

@@ -1115,6 +1115,8 @@ describe "As a consumer, I want to checkout my order" do
before do
# Add voucher to the order
voucher.create_adjustment(voucher.code, order)
# Update order so voucher adjustment is properly taken into account
order.update_order!
visit checkout_step_path(:summary)
end