test/remote/gateways/remote_braintree_test.rb in activemerchant-1.4.1 vs test/remote/gateways/remote_braintree_test.rb in activemerchant-1.4.2

- old
+ new

@@ -3,11 +3,12 @@ class RemoteBraintreeTest < Test::Unit::TestCase def setup @gateway = BraintreeGateway.new(fixtures(:braintree)) @amount = rand(10000) + 1001 - @credit_card = credit_card('4111111111111111', :type => 'visa') + @credit_card = credit_card('4111111111111111') + @check = check() @declined_amount = rand(99) @options = { :order_id => generate_unique_id, :billing_address => address } end @@ -31,11 +32,11 @@ :routing_number => '111000025', # Valid ABA # - Bank of America, TX :account_number => '999999999999', :account_holder_type => 'personal', :account_type => 'checking' ) - assert response = @gateway.purchase(@amount, check, @options) + assert response = @gateway.purchase(@amount, @check, @options) assert_equal 'This transaction has been approved', response.message assert_success response end def test_successful_add_to_vault @@ -46,11 +47,11 @@ assert_not_nil response.params["customer_vault_id"] end def test_successful_add_to_vault_with_store_method assert response = @gateway.store(@credit_card) - assert_equal 'This transaction has been approved', response.message + assert_equal 'Customer Added', response.message assert_success response assert_not_nil response.params["customer_vault_id"] end def test_successful_add_to_vault_and_use @@ -74,12 +75,18 @@ end def test_add_to_vault_with_custom_vault_id_with_store_method @options[:billing_id] = rand(100000)+10001 assert response = @gateway.store(@credit_card, @options.dup) - assert_equal 'This transaction has been approved', response.message + assert_equal 'Customer Added', response.message assert_success response assert_equal @options[:billing_id], response.params["customer_vault_id"].to_i + end + + def test_add_to_vault_with_store_and_check + assert response = @gateway.store(@check, @options) + assert_equal 'Customer Added', response.message + assert_success response end def test_update_vault test_add_to_vault_with_custom_vault_id @credit_card = credit_card('4111111111111111', :month => 10)