mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Merge pull request #12881 from mkllnk/card-payment-spec
Fix date dependent spec
This commit is contained in:
@@ -26,23 +26,20 @@ RSpec.describe Spree::CreditCardsController, type: :controller do
|
||||
{
|
||||
format: :json,
|
||||
exp_month: 9,
|
||||
exp_year: 2024,
|
||||
exp_year: 1.year.from_now.year,
|
||||
last4: 4242,
|
||||
token: token['id'],
|
||||
cc_type: "visa"
|
||||
}
|
||||
end
|
||||
|
||||
before do
|
||||
# there should be no cards stored locally
|
||||
expect(Spree::CreditCard.count).to eq(0)
|
||||
end
|
||||
|
||||
it "saves the card locally" do
|
||||
spree_post :new_from_token, params
|
||||
expect {
|
||||
spree_post :new_from_token, params
|
||||
}.to change {
|
||||
Spree::CreditCard.count
|
||||
}.from(0).to(1)
|
||||
|
||||
# checks whether a card was created
|
||||
expect(Spree::CreditCard.count).to eq(1)
|
||||
card = Spree::CreditCard.last
|
||||
|
||||
# retrieves the created card from Stripe
|
||||
|
||||
Reference in New Issue
Block a user