Sha256: 50090515ababc5e26b8601ba67f3bd44eed3e4f28ceb490e16c8765e06907546
Contents?: true
Size: 1.13 KB
Versions: 2
Compression:
Stored size: 1.13 KB
Contents
require File.dirname(__FILE__) + '/../../test_helper' class <%= class_name %>Test < Test::Unit::TestCase AMOUNT = 100 def setup @gateway = <%= class_name %>Gateway.new(fixtures(:<%= class_name.underscore %>)) @creditcard = credit_card('4242424242424242') @address = { :address1 => '1234 My Street', :address2 => 'Apt 1', :company => 'Widgets Inc', :city => 'Ottawa', :state => 'ON', :zip => 'K1C2N6', :country => 'Canada', :phone => '(555)555-5555' } end def test_successful_request @creditcard.number = 1 assert response = @gateway.purchase(AMOUNT, @creditcard, {}) assert_success response assert_equal '5555', response.authorization assert response.test? end def test_unsuccessful_request @creditcard.number = 2 assert response = @gateway.purchase(AMOUNT, @creditcard, {}) assert_failure response assert response.test? end def test_request_error @creditcard.number = 3 assert_raise(Error){ @gateway.purchase(AMOUNT, @creditcard, {}) } end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
activemerchant-1.2.0 | script/generator/generators/gateway/templates/gateway_test.rb |
activemerchant-1.2.1 | script/generator/generators/gateway/templates/gateway_test.rb |