Skip to content

Commit

Permalink
Spec change more clearly
Browse files Browse the repository at this point in the history
  • Loading branch information
mkllnk committed Oct 1, 2024
1 parent 0474c59 commit 17c32ae
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions spec/controllers/spree/credit_cards_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,13 @@
}
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
Expand Down

0 comments on commit 17c32ae

Please sign in to comment.