From b341f593e7486fd80a3ab5a796486062b9afe64d Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Tue, 6 Oct 2020 17:21:22 +0100 Subject: [PATCH] Improve method names --- spec/features/admin/payments_stripe_spec.rb | 10 +++++----- .../features/consumer/shopping/checkout_stripe_spec.rb | 2 +- spec/support/request/stripe_helper.rb | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/spec/features/admin/payments_stripe_spec.rb b/spec/features/admin/payments_stripe_spec.rb index 50dac43446..41a3801c51 100644 --- a/spec/features/admin/payments_stripe_spec.rb +++ b/spec/features/admin/payments_stripe_spec.rb @@ -46,7 +46,7 @@ feature ' end before do - stub_hub_payment_methods_request + stub_payment_methods_post_request stub_payment_intent_get_request end @@ -61,7 +61,7 @@ feature ' login_as_admin_and_visit spree.new_admin_order_payment_path order fill_in "payment_amount", with: order.total.to_s - fill_in_stripe_cards_details_in_backoffice + fill_in_card_details_in_backoffice click_button "Update" expect(page).to have_link "StripeSCA" @@ -78,7 +78,7 @@ feature ' login_as_admin_and_visit spree.new_admin_order_payment_path order fill_in "payment_amount", with: order.total.to_s - fill_in_stripe_cards_details_in_backoffice + fill_in_card_details_in_backoffice click_button "Update" expect(page).to have_link "StripeSCA" @@ -110,7 +110,7 @@ feature ' login_as_admin_and_visit spree.new_admin_order_payment_path order fill_in "payment_amount", with: order.total.to_s - fill_in_stripe_cards_details_in_backoffice + fill_in_card_details_in_backoffice click_button "Update" expect(page).to have_link "StripeSCA" @@ -134,7 +134,7 @@ feature ' login_as_admin_and_visit spree.new_admin_order_payment_path order fill_in "payment_amount", with: order.total.to_s - fill_in_stripe_cards_details_in_backoffice + fill_in_card_details_in_backoffice click_button "Update" expect(page).to have_link "StripeSCA" diff --git a/spec/features/consumer/shopping/checkout_stripe_spec.rb b/spec/features/consumer/shopping/checkout_stripe_spec.rb index 349bb6838b..273519456d 100644 --- a/spec/features/consumer/shopping/checkout_stripe_spec.rb +++ b/spec/features/consumer/shopping/checkout_stripe_spec.rb @@ -93,7 +93,7 @@ feature "Check out with Stripe", js: true do context "with guest checkout" do before do stub_payment_intent_get_request - stub_hub_payment_methods_request + stub_payment_methods_post_request end context "when the card is accepted" do diff --git a/spec/support/request/stripe_helper.rb b/spec/support/request/stripe_helper.rb index fff0aa7f58..b9f586f9d6 100644 --- a/spec/support/request/stripe_helper.rb +++ b/spec/support/request/stripe_helper.rb @@ -21,7 +21,7 @@ module StripeHelper fill_in 'CVC', with: '123' end - def fill_in_stripe_cards_details_in_backoffice + def fill_in_card_details_in_backoffice choose "StripeSCA" fill_in "cardholder_name", with: "David Gilmour" fill_in "stripe-cardnumber", with: "4242424242424242" @@ -48,7 +48,7 @@ module StripeHelper stub.to_return(payment_intent_authorize_response_mock(response)) end - def stub_hub_payment_methods_request(response: {}) + def stub_payment_methods_post_request(response: {}) stub_request(:post, "https://api.stripe.com/v1/payment_methods") .with(body: { payment_method: "pm_123" }, headers: { 'Stripe-Account' => 'abc123' })