Add code to CheckoutController to construct card attributes when using an existing card (via a818fbbecd/core/app/models/spree/order/checkout.rb:212)

This commit is contained in:
stveep
2017-03-23 22:42:08 +00:00
committed by Rob Harrington
parent 627899bbd4
commit c4f9a5a234
3 changed files with 24 additions and 9 deletions

View File

@@ -204,8 +204,6 @@ describe 'Checkout service', ->
it "passes the card ID in source attributes if a saved card is selected", ->
Checkout.secrets.selected_card = 1
source_attributes = Checkout.preprocess().payments_attributes[0].source_attributes
source_attributes = Checkout.preprocess()
expect(source_attributes).toBeDefined()
expect(source_attributes.credit_card_id).toBe 1
expect(source_attributes.type).toBe "Spree::CreditCard"
expect(source_attributes.year).toBeUndefined()
expect(source_attributes.existing_card).toBe 1