mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-30 21:27:17 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user