Sha256: c53f169b58670cf7ba1b46fa75ed60d8a4431f63768e0d31c7141c523bf802f0

Contents?: true

Size: 1012 Bytes

Versions: 16

Compression:

Stored size: 1012 Bytes

Contents

require 'test_helper'

class RemoteFindTransactionTest < Test::Unit::TestCase

  def setup
    @environment = Spreedly::Environment.new(remote_test_environment_key, remote_test_access_secret)
  end

  def test_invalid_login
    assert_invalid_login do |environment|
      environment.find_transaction("SomeToken")
    end
  end

  def test_transaction_not_found
    assert_raise_with_message(Spreedly::NotFoundError, "Unable to find the transaction SomeUnknownToken.") do
       @environment.find_transaction("SomeUnknownToken")
    end
  end

  def test_successfully_find_transaction
    gateway_token = @environment.add_gateway(:test).token
    card_token = create_failed_card_on(@environment).token
    transaction = @environment.purchase_on_gateway(gateway_token, card_token, 144)

    found = @environment.find_transaction(transaction.token)

    assert_kind_of(Spreedly::Purchase, found)
    assert_equal transaction.token, found.token
    assert_equal('Aybara', found.payment_method.last_name)
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
spreedly-2.0.16 test/remote/remote_find_transaction_test.rb
spreedly-2.0.15 test/remote/remote_find_transaction_test.rb
spreedly-2.0.14 test/remote/remote_find_transaction_test.rb
spreedly-2.0.13 test/remote/remote_find_transaction_test.rb
spreedly-2.0.11 test/remote/remote_find_transaction_test.rb
spreedly-2.0.10 test/remote/remote_find_transaction_test.rb
spreedly-2.0.9 test/remote/remote_find_transaction_test.rb
spreedly-2.0.8 test/remote/remote_find_transaction_test.rb
spreedly-2.0.7 test/remote/remote_find_transaction_test.rb
spreedly-2.0.6 test/remote/remote_find_transaction_test.rb
spreedly-2.0.5 test/remote/remote_find_transaction_test.rb
spreedly-2.0.4 test/remote/remote_find_transaction_test.rb
spreedly-2.0.3 test/remote/remote_find_transaction_test.rb
spreedly-2.0.2 test/remote/remote_find_transaction_test.rb
spreedly-2.0.1 test/remote/remote_find_transaction_test.rb
spreedly-2.0.0 test/remote/remote_find_transaction_test.rb