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