Sha256: 074eb12b32d5fc98df1c6021bc04cf6728da3ee1aeb2699a8a0363637bda4a96

Contents?: true

Size: 1.08 KB

Versions: 9

Compression:

Stored size: 1.08 KB

Contents

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

class RemoteSecurePayAuTest < Test::Unit::TestCase
  
  def setup
    @gateway = SecurePayAuGateway.new(fixtures(:secure_pay_au))
    
    @amount = 100
    @credit_card = credit_card('4444333322221111')

    @options = { 
      :order_id => '1',
      :billing_address => address,
      :description => 'Store Purchase'
    }
  end
  
  def test_successful_purchase
    assert response = @gateway.purchase(@amount, @credit_card, @options)
    assert_success response
    assert_equal 'Approved', response.message
  end

  def test_unsuccessful_purchase
    @credit_card.year = '2005'
    assert response = @gateway.purchase(@amount, @credit_card, @options)
    assert_failure response
    assert_equal 'CARD EXPIRED', response.message
  end

  def test_invalid_login
    gateway = SecurePayAuGateway.new(
                :login => '',
                :password => ''
              )
    assert response = gateway.purchase(@amount, @credit_card, @options)
    assert_failure response
    assert_equal "Invalid merchant ID", response.message
  end
end

Version data entries

9 entries across 9 versions & 5 rubygems

Version Path
martinstannard-activemerchant-0.1.0 test/remote/gateways/remote_secure_pay_au_test.rb
seamusabshere-active_merchant-1.4.2.1 test/remote/gateways/remote_secure_pay_au_test.rb
seamusabshere-active_merchant-1.4.2.3 test/remote/gateways/remote_secure_pay_au_test.rb
activemerchant-1.4.0 test/remote/gateways/remote_secure_pay_au_test.rb
activemerchant-1.4.1 test/remote/gateways/remote_secure_pay_au_test.rb
activemerchant-1.3.2 test/remote/gateways/remote_secure_pay_au_test.rb
activemerchant-1.4.2 test/remote/gateways/remote_secure_pay_au_test.rb
merb_merchant-1.4.1 test/remote/gateways/remote_secure_pay_au_test.rb
spree-0.2.0 vendor/plugins/active_merchant/test/remote/gateways/remote_secure_pay_au_test.rb