Sha256: a2b35cf31c7b4555cafe7e1f14c14ca44cb75e0862d681177b815bed517ba3e4

Contents?: true

Size: 999 Bytes

Versions: 2

Compression:

Stored size: 999 Bytes

Contents

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

class RemoteTransFirstTest < Test::Unit::TestCase
  AMOUNT = 100

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

    @creditcard = credit_card('4111111111111111')

    @options = { 
      :order_id => generate_order_id,
      :invoice => 'ActiveMerchant Sale',
      :address => { :address1 => '1234 Shady Brook Lane',
                    :zip => '90210'
                  }
    }
  end
  
  def test_successful_purchase
    assert response = @gateway.purchase(AMOUNT, @creditcard, @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, @creditcard, @options)
    assert_equal 'invalid account', response.message
    assert_failure response
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activemerchant-1.2.0 test/remote_tests/remote_trans_first_test.rb
activemerchant-1.2.1 test/remote_tests/remote_trans_first_test.rb