Sha256: bc1087b7c74caa8edb42b92eea62abfcb76a3c2a7a56c967dd434dedbe35058a

Contents?: true

Size: 1.18 KB

Versions: 19

Compression:

Stored size: 1.18 KB

Contents

require 'test_helper'

class SallieMaeTest < Test::Unit::TestCase
  def setup
    @gateway = SallieMaeGateway.new(
                 :login => 'FAKEACCOUNT'
               )

    @credit_card = credit_card
    @amount = 100
    
    @options = { 
      :order_id => '1',
      :billing_address => address,
      :description => 'Store Purchase'
    }
  end
  
  def test_successful_purchase
    @gateway.expects(:ssl_post).returns(successful_purchase_response)
    
    assert response = @gateway.purchase(@amount, @credit_card, @options)
    assert_success response
  end

  def test_unsuccessful_request
    @gateway.expects(:ssl_post).returns(failed_purcahse_response)
    
    assert response = @gateway.purchase(@amount, @credit_card, @options)
    assert_failure response
  end
  
  def test_non_test_account
    assert !@gateway.test?
  end
  
  def test_test_account
    gateway = SallieMaeGateway.new(:login => "TEST0")
    assert !@gateway.test?
  end

  private
  
  # Place raw successful response from gateway here
  def successful_purchase_response
    "Status=Accepted"
  end
  
  # Place raw failed response from gateway here
  def failed_purcahse_response
    "Status=Declined"
  end
end

Version data entries

19 entries across 19 versions & 7 rubygems

Version Path
goldstar-activemerchant-1.4.2.7 test/unit/gateways/sallie_mae_test.rb
goldstar-activemerchant-1.4.2.6 test/unit/gateways/sallie_mae_test.rb
smulube-activemerchant-1.5.1.4 test/unit/gateways/sallie_mae_test.rb
smulube-activemerchant-1.5.1.3 test/unit/gateways/sallie_mae_test.rb
smulube-activemerchant-1.5.1.2 test/unit/gateways/sallie_mae_test.rb
ghazel-activemerchant-1.4.2 test/unit/gateways/sallie_mae_test.rb
activemerchant-est-1.4.2.6 test/unit/gateways/sallie_mae_test.rb
activemerchant-1.5.0 test/unit/gateways/sallie_mae_test.rb
patmaddox-activemerchant-1.4.2.6 test/unit/gateways/sallie_mae_test.rb
patmaddox-activemerchant-1.4.2.5 test/unit/gateways/sallie_mae_test.rb
patmaddox-activemerchant-1.4.2.4 test/unit/gateways/sallie_mae_test.rb
patmaddox-activemerchant-1.4.2.3 test/unit/gateways/sallie_mae_test.rb
patmaddox-activemerchant-1.4.2.2 test/unit/gateways/sallie_mae_test.rb
patmaddox-activemerchant-1.4.2.1 test/unit/gateways/sallie_mae_test.rb
activemerchant-est-1.4.2.5 test/unit/gateways/sallie_mae_test.rb
patmaddox-activemerchant-1.4.2 test/unit/gateways/sallie_mae_test.rb
abtain_billing-1.03 test/unit/gateways/sallie_mae_test.rb
abtain_billing-1.02 test/unit/gateways/sallie_mae_test.rb
abtain_billing-1.0 test/unit/gateways/sallie_mae_test.rb