Skip to content
This repository has been archived by the owner on Jan 10, 2018. It is now read-only.

Commit

Permalink
Add test for new MasterCard BIN ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesreggio committed Jul 2, 2015
1 parent 3943a38 commit 47dbab4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/specs.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ describe 'jquery.payment', ->

assert($.payment.validateCardNumber('5555555555554444'), 'mastercard')
assert($.payment.validateCardNumber('5454545454545454'), 'mastercard')
assert($.payment.validateCardNumber('2221000002222221'), 'mastercard')

assert($.payment.validateCardNumber('378282246310005'), 'amex')
assert($.payment.validateCardNumber('371449635398431'), 'amex')
Expand Down Expand Up @@ -199,6 +200,10 @@ describe 'jquery.payment', ->
topic = $.payment.cardType '4012121212121212'
assert.equal topic, 'visa'

it 'that begins with 2 should return MasterCard', ->
topic = $.payment.cardType '2221000002222221'
assert.equal topic, 'mastercard'

it 'that begins with 5 should return MasterCard', ->
topic = $.payment.cardType '5555555555554444'
assert.equal topic, 'mastercard'
Expand Down Expand Up @@ -232,6 +237,7 @@ describe 'jquery.payment', ->

assert.equal($.payment.cardType('5555555555554444'), 'mastercard')
assert.equal($.payment.cardType('5454545454545454'), 'mastercard')
assert.equal($.payment.cardType('2221000002222221'), 'mastercard')

assert.equal($.payment.cardType('378282246310005'), 'amex')
assert.equal($.payment.cardType('371449635398431'), 'amex')
Expand Down

0 comments on commit 47dbab4

Please sign in to comment.