Sha256: 65e7181b482bc6c103e93b5eeaad84e324a673be272a3b903b2e0b39003ee3be
Contents?: true
Size: 1.22 KB
Versions: 62
Compression:
Stored size: 1.22 KB
Contents
require 'test_helper' module Workarea class Payment class Tender class CreditCardTest < TestCase def profile @profile ||= create_payment_profile end def payment @payment ||= create_payment(profile: profile) end def saved_card @saved_card ||= create_saved_credit_card(profile: profile) end def tender @tender ||= CreditCard.new(payment: payment, saved_card_id: saved_card.id) end def test_valid? tender.valid? assert_equal(saved_card.display_number, tender.display_number) assert_equal(saved_card.issuer, tender.issuer) assert_equal(saved_card.month, tender.month) assert_equal(saved_card.year, tender.year) assert_equal(saved_card.token, tender.token) saved_card.delete assert_nothing_raised { tender.valid? } end def test_saved? assert(tender.saved?) tender.saved_card_id = nil refute(tender.saved?) end def test_tokenized? assert(tender.tokenized?) tender.saved_card_id = nil refute(tender.tokenized?) end end end end end
Version data entries
62 entries across 62 versions & 1 rubygems