Sha256: 8a6f0e5e17ab98ecff5aa051b620034f6ebd8c185348dfcd545f2e8e012d4d61

Contents?: true

Size: 930 Bytes

Versions: 10

Compression:

Stored size: 930 Bytes

Contents

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

class RemoteTransFirstTest < Test::Unit::TestCase

  def setup
    @gateway = TransFirstGateway.new(fixtures(:trans_first))

    @credit_card = credit_card('4111111111111111')
    @amount = 100
    @options = { 
      :order_id => generate_unique_id,
      :invoice => 'ActiveMerchant Sale',
      :billing_address => address
    }
  end
  
  def test_successful_purchase
    assert response = @gateway.purchase(@amount, @credit_card, @options)
    assert_equal 'test transaction', response.message
    assert response.test?
    assert_success response
    assert !response.authorization.blank?
  end

  def test_invalid_login
    gateway = TransFirstGateway.new(
      :login => '',
      :password => ''
    )
    assert response = gateway.purchase(@amount, @credit_card, @options)
    assert_equal 'invalid account', response.message
    assert_failure response
  end
end

Version data entries

10 entries across 10 versions & 4 rubygems

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