Skip to content

Commit

Permalink
Fix tests failing due to new year
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Odorcic committed Jan 16, 2012
1 parent 44ad856 commit cee6aec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions test/unit/gateways/orbital_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def test_order_id_as_number
end

def test_expiry_date
assert_equal "0912", @gateway.send(:expiry_date, credit_card)
year = (DateTime.now + 1.year).strftime("%y")
assert_equal "09#{year}", @gateway.send(:expiry_date, credit_card)
end

def test_phone_number
Expand All @@ -67,4 +68,4 @@ def failed_purchase_response
%q{<?xml version="1.0" encoding="UTF-8"?><Response><NewOrderResp><IndustryType></IndustryType><MessageType>AC</MessageType><MerchantID>700000000000</MerchantID><TerminalID>001</TerminalID><CardBrand>VI</CardBrand><AccountNum>4000300011112220</AccountNum><OrderID>1</OrderID><TxRefNum>4A5398CF9B87744GG84A1D30F2F2321C66249416</TxRefNum><TxRefIdx>0</TxRefIdx><ProcStatus>0</ProcStatus><ApprovalStatus>0</ApprovalStatus><RespCode>05</RespCode><AVSRespCode>G </AVSRespCode><CVV2RespCode>N</CVV2RespCode><AuthCode></AuthCode><RecurringAdviceCd></RecurringAdviceCd><CAVVRespCode></CAVVRespCode><StatusMsg>Do Not Honor</StatusMsg><RespMsg>AUTH DECLINED 12001</RespMsg><HostRespCode>05</HostRespCode><HostAVSRespCode>N</HostAVSRespCode><HostCVV2RespCode>N</HostCVV2RespCode><CustomerRefNum></CustomerRefNum><CustomerName></CustomerName><ProfileProcStatus></ProfileProcStatus><CustomerProfileMessage></CustomerProfileMessage><RespTime>150214</RespTime></NewOrderResp></Response>}
end

end
end
2 changes: 1 addition & 1 deletion test/unit/gateways/samurai_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def test_successful_store
card_to_store = {
:card_number => "4242424242424242",
:expiry_month => "09",
:expiry_year => "2012",
:expiry_year => (Time.now.year + 1).to_s,
:cvv => "123",
:first_name => "Longbob",
:last_name => "Longsen",
Expand Down

0 comments on commit cee6aec

Please sign in to comment.