mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Add test for maintaining hub selection after order completion
This commit is contained in:
@@ -221,6 +221,25 @@ describe "As a consumer, I want to checkout my order", js: true do
|
||||
expect(page).to have_content("Select a shipping method")
|
||||
end
|
||||
end
|
||||
|
||||
context "summary step" do
|
||||
let(:order) { create(:order_ready_for_confirmation, distributor: distributor) }
|
||||
|
||||
describe "completing the checkout" do
|
||||
it "keeps the distributor selected for the current user after completion" do
|
||||
visit checkout_step_path(:summary)
|
||||
|
||||
expect(page).to have_content "Shopping @ #{distributor.name}"
|
||||
|
||||
click_on "Complete order"
|
||||
|
||||
expect(page).to have_content "Back To Store"
|
||||
expect(order.reload.state).to eq "complete"
|
||||
|
||||
expect(page).to have_content "Shopping @ #{distributor.name}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "when I have an out of stock product in my cart" do
|
||||
|
||||
Reference in New Issue
Block a user