Sha256: 4a88dcec103b096c62f346f39a7329db01ea2b83ca24bacce84969c24c10e97c

Contents?: true

Size: 867 Bytes

Versions: 6

Compression:

Stored size: 867 Bytes

Contents

require 'test_helper'

module Workarea
   class Payment::ForterSavedCreditCardTest < TestCase
    def test_save
      card = Workarea::Payment::SavedCreditCard.new(
        profile: create_payment_profile(reference: '234'),
        number: '4111111111111111',
        cvv: '123',
        month: 12,
        year: Time.current.year + 1,
        first_name: 'Robert',
        last_name: 'Clams'
      )

      card.save
      assert(card.tokenized?)
      assert(card.bin.present?)
      assert_equal('411111', card.bin)

      profile = create_payment_profile
      current_default = create_saved_credit_card(profile: profile, default: true)
      new_default = create_saved_credit_card(profile: profile, default: true)

      current_default.reload
      new_default.reload

      refute(current_default.default?)
      assert(new_default.default?)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
workarea-forter-1.3.2 test/models/workarea/payment/forter_saved_credit_card_test.rb
workarea-forter-1.3.1 test/models/workarea/payment/forter_saved_credit_card_test.rb
workarea-forter-1.3.0 test/models/workarea/payment/forter_saved_credit_card_test.rb
workarea-forter-1.2.4 test/models/workarea/payment/forter_saved_credit_card_test.rb
workarea-forter-1.2.3 test/models/workarea/payment/forter_saved_credit_card_test.rb
workarea-forter-1.2.2 test/models/workarea/payment/forter_saved_credit_card_test.rb