Adapt consumer/shopping/orders_spec to use an order with a nil user to test a guest checkout, which is what happens in the real checkout

This commit is contained in:
Luis Ramos
2020-03-07 20:00:40 +00:00
parent ffe814ce6b
commit 7daa68a8bc

View File

@@ -31,7 +31,14 @@ feature "Order Management", js: true do
end
context "when checking out as an anonymous guest" do
let(:user) { Spree::User.anonymous! }
let!(:customer) { nil }
let!(:order) do
create(:order_with_credit_payment,
user: nil,
email: "guest@user.com",
distributor: distributor,
order_cycle: order_cycle)
end
it "allows the user to see the details" do
# Cannot load the page without token