mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Fix specs for saved credit cards: Add payment profile ID to fixture (now denotes that a card has been saved), check for current user to avoid error attempting to inject saved cards as a guest
This commit is contained in:
@@ -639,7 +639,7 @@ GEM
|
||||
tilt (~> 1.1, != 1.3.0)
|
||||
state_machine (1.2.0)
|
||||
stringex (1.3.3)
|
||||
stripe (3.0.1)
|
||||
stripe (3.3.1)
|
||||
faraday (~> 0.9)
|
||||
therubyracer (0.12.0)
|
||||
libv8 (~> 3.16.14.0)
|
||||
@@ -777,7 +777,7 @@ DEPENDENCIES
|
||||
spree_auth_devise!
|
||||
spree_i18n!
|
||||
spree_paypal_express!
|
||||
stripe (~> 3.0.1)
|
||||
stripe (~> 3.3.1)
|
||||
therubyracer
|
||||
timecop
|
||||
truncate_html
|
||||
|
||||
@@ -74,7 +74,10 @@ module InjectionHelper
|
||||
end
|
||||
|
||||
def inject_saved_credit_cards
|
||||
data = spree_current_user.credit_cards.with_payment_profile.all
|
||||
if spree_current_user
|
||||
data = spree_current_user.credit_cards.with_payment_profile.all
|
||||
end
|
||||
|
||||
inject_json_ams "savedCreditCards", data, Api::CreditCardSerializer
|
||||
end
|
||||
|
||||
|
||||
@@ -150,7 +150,8 @@ feature "As a consumer I want to check out my cart", js: true, retry: 3 do
|
||||
year: "2025",
|
||||
cc_type: "Visa",
|
||||
number: "1111111111111111",
|
||||
payment_method_id: stripe_pm.id)
|
||||
payment_method_id: stripe_pm.id,
|
||||
gateway_customer_profile_id: "i_am_saved")
|
||||
}
|
||||
|
||||
let(:response_mock) { { id: "ch_1234", object: "charge", amount: 2000} }
|
||||
|
||||
Reference in New Issue
Block a user