Sha256: e8682d8c32064bba4d4765854f39965d73211e055fb6522413ea8510fecbbbc4

Contents?: true

Size: 1.18 KB

Versions: 11

Compression:

Stored size: 1.18 KB

Contents

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

class RemoteViaklixTest < Test::Unit::TestCase
  def setup
    @gateway = ViaklixGateway.new(fixtures(:viaklix))
    
    @credit_card = credit_card    
    @bad_credit_card = credit_card('invalid')
    
    @options = {
      :order_id => '#1000.1',
      :email => "paul@domain.com",   
      :description => 'Test Transaction',
      :billing_address => address
    }
    @amount = 100
  end
  
  def test_successful_purchase
    assert response = @gateway.purchase(@amount, @credit_card, @options)
    
    assert_success response
    assert response.test?
    assert_equal 'APPROVED', response.message
    assert response.authorization
  end
  
  def test_failed_purchase
    assert response = @gateway.purchase(@amount, @bad_credit_card, @options)
  
    assert_failure response
    assert response.test?
    assert_equal 'The Credit Card Number supplied in the authorization request appears invalid.', response.message
  end
  
  def test_credit
    assert purchase = @gateway.purchase(@amount, @credit_card, @options)
    assert_success purchase
    
    assert credit = @gateway.credit(@amount, @credit_card)
    assert_success credit
  end
end

Version data entries

11 entries across 11 versions & 5 rubygems

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