Sha256: 2d184ee732015f629aeebef18511d2f0eaff792b9e38b643843b67b87bfa5779

Contents?: true

Size: 798 Bytes

Versions: 2

Compression:

Stored size: 798 Bytes

Contents

module Workarea
  decorate Storefront::Users::CreditCardsIntegrationTest, with: :stripe do
    def test_adds_credit_cards
      cc_params =  {
          credit_card: {
            first_name: 'Ben',
            last_name: 'Crouse'
          }
        }.merge!("stripe_token" => 1)

      post storefront.users_credit_cards_path,
        params: cc_params

      assert_redirected_to(storefront.users_account_path)

      payment_profile = Payment::Profile.lookup(PaymentReference.new(@user))

      credit_card = payment_profile.credit_cards.first
      assert_equal('Ben', credit_card.first_name)
      assert_equal('Crouse', credit_card.last_name)
      assert_equal(1, credit_card.month)
      assert_equal(next_year, credit_card.year)
      assert(credit_card.token.present?)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
workarea-stripe-1.1.2 test/integration/workarea/storefront/users/credit_cards_integration_test.decorator
workarea-stripe-1.1.1 test/integration/workarea/storefront/users/credit_cards_integration_test.decorator