Improve method names

This commit is contained in:
Luis Ramos
2020-10-06 17:21:22 +01:00
parent 59b4e425b6
commit b341f593e7
3 changed files with 8 additions and 8 deletions

View File

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

View File

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

View File

@@ -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' })