Sha256: 721ff1f6c315c5493ae510980da6d2d11c7e27a471f61a5f6e8f89fc2add9fc0

Contents?: true

Size: 612 Bytes

Versions: 10

Compression:

Stored size: 612 Bytes

Contents

require File.dirname(__FILE__) + '/../test_helper'

class CreditCardFormattingTest < Test::Unit::TestCase
  include ActiveMerchant::Billing::CreditCardFormatting
  
  def test_should_format_number_by_rule
    assert_equal 2005, format(2005, :steven_colbert)
    
    assert_equal '0005', format(05, :four_digits)
    assert_equal '2005', format(2005, :four_digits)
    
    assert_equal '05', format(2005, :two_digits)
    assert_equal '05', format(05, :two_digits)
    assert_equal '08', format(8, :two_digits)
    
    assert format(nil, :two_digits).blank?
    assert format('', :two_digits).blank?
  end
end

Version data entries

10 entries across 10 versions & 4 rubygems

Version Path
martinstannard-activemerchant-0.1.0 test/unit/credit_card_formatting_test.rb
seamusabshere-active_merchant-1.4.2.1 test/unit/credit_card_formatting_test.rb
seamusabshere-active_merchant-1.4.2.3 test/unit/credit_card_formatting_test.rb
activemerchant-1.3.2 test/unit/credit_card_formatting_test.rb
activemerchant-1.3.0 test/unit/credit_card_formatting_test.rb
activemerchant-1.4.0 test/unit/credit_card_formatting_test.rb
activemerchant-1.4.1 test/unit/credit_card_formatting_test.rb
activemerchant-1.3.1 test/unit/credit_card_formatting_test.rb
activemerchant-1.4.2 test/unit/credit_card_formatting_test.rb
spree-0.2.0 vendor/plugins/active_merchant/test/unit/credit_card_formatting_test.rb