Add test for maintaining hub selection after order completion

This commit is contained in:
Matt-Yorkley
2022-01-14 19:29:12 +00:00
parent 0f154de235
commit 2f7ef33caf

View File

@@ -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