From 7daa68a8bc05429aaf1bc801db29b8b83ff9f0a6 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Sat, 7 Mar 2020 20:00:40 +0000 Subject: [PATCH] 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 --- spec/features/consumer/shopping/orders_spec.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spec/features/consumer/shopping/orders_spec.rb b/spec/features/consumer/shopping/orders_spec.rb index e9b342c1c7..2bb40d6dd5 100644 --- a/spec/features/consumer/shopping/orders_spec.rb +++ b/spec/features/consumer/shopping/orders_spec.rb @@ -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