Add failing spec for payment and shipment states bug

The order was being left in an unexpected condition here, it's states are not set and there seem to be some weird issues.
This commit is contained in:
Matt-Yorkley
2021-04-27 13:15:44 +01:00
parent f6f1cf9e41
commit 8d19bcdcf2

View File

@@ -35,4 +35,33 @@ feature '
expect(page).to have_content I18n.t(:new_payment)
end
end
context "creating an order's first payment via admin", js: true do
before do
order.update_columns(
state: "payment",
payment_state: nil,
shipment_state: nil,
completed_at: nil
)
end
xit "creates the payment, completes the order, and updates payment and shipping states" do
login_as_admin_and_visit spree.new_admin_order_payment_path order
expect(page).to have_content "New Payment"
within "#new_payment" do
find('input[type="radio"]').click
end
click_button "Update"
expect(page).to have_content "Payments"
order.reload
expect(order.state).to eq "complete"
expect(order.payment_state).to eq "balance_due"
expect(order.shipment_state).to eq "pending"
end
end
end