From 818c0306c6d85f0f3a10d2587b1a8e5f534845dc Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Fri, 17 May 2024 19:00:15 +0100 Subject: [PATCH] Updates paypal feature spec to consider new checkout flow --- .../consumer/shopping/checkout_paypal_spec.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/spec/system/consumer/shopping/checkout_paypal_spec.rb b/spec/system/consumer/shopping/checkout_paypal_spec.rb index 07bc98c309..8368867e2c 100644 --- a/spec/system/consumer/shopping/checkout_paypal_spec.rb +++ b/spec/system/consumer/shopping/checkout_paypal_spec.rb @@ -4,9 +4,9 @@ require "system_helper" RSpec.describe "Check out with Paypal" do include ShopWorkflow - include CheckoutRequestsHelper include AuthenticationHelper include PaypalHelper + include CheckoutHelper let(:distributor) { create(:distributor_enterprise) } let(:supplier) { create(:supplier_enterprise) } @@ -47,10 +47,12 @@ RSpec.describe "Check out with Paypal" do end shared_examples "checking out with paypal" do |user_type| - pending user_type.to_s do + context user_type.to_s do before do fill_out_details - fill_out_form(free_shipping.name, paypal.name, save_default_addresses: false) + fill_out_billing_address + proceed_to_payment + proceed_to_summary end it "completes the checkout after successful Paypal payment" do @@ -65,7 +67,7 @@ RSpec.describe "Check out with Paypal" do ) stub_paypal_confirm - place_order + click_on "Complete order" expect(page).to have_content "Your order has been processed successfully" expect(order.reload.state).to eq "complete" @@ -75,14 +77,14 @@ RSpec.describe "Check out with Paypal" do it "fails with an error message" do stub_paypal_response success: false - place_order + click_on "Complete order" expect(page).to have_content "PayPal failed." end end end describe "shared_examples" do - pending "as a guest user" do + context "as a guest user" do before do visit checkout_path checkout_as_guest @@ -90,7 +92,7 @@ RSpec.describe "Check out with Paypal" do it_behaves_like "checking out with paypal", "as guest" end - pending "as a logged in user" do + context "as a logged in user" do before do login_as user visit checkout_path