Sha256: dcc3c0ea8c20653ef9a3fc5a3faae20206a243c960c388c03948d1d3bc51d866
Contents?: true
Size: 1.08 KB
Versions: 34
Compression:
Stored size: 1.08 KB
Contents
require 'test_helper' class RemotePaySecureTest < Test::Unit::TestCase def setup @gateway = PaySecureGateway.new(fixtures(:pay_secure)) @credit_card = credit_card('4000100011112224') @options = { :billing_address => address, :order_id => generate_unique_id } @amount = 100 end def test_successful_purchase assert response = @gateway.purchase(@amount, @credit_card, @options) assert_success response assert_equal PaySecureGateway::SUCCESS_MESSAGE, response.message assert response.test? end def test_unsuccessful_purchase @credit_card.year = '2006' assert response = @gateway.purchase(@amount, @credit_card, @options) assert_equal 'Declined, card expired', response.message assert_failure response end def test_invalid_login gateway = PaySecureGateway.new( :login => '', :password => '' ) assert response = gateway.purchase(@amount, @credit_card, @options) assert_equal "MissingField: 'MERCHANT_ID'", response.message assert_failure response end end
Version data entries
34 entries across 34 versions & 11 rubygems