Sha256: d602a0b9e336b104b3de2d10183bf96b62c4d15cfc2200e39eecb557e5fa4020

Contents?: true

Size: 871 Bytes

Versions: 28

Compression:

Stored size: 871 Bytes

Contents

require 'test_helper'

class RemoteFindPaymentMethodTest < 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_payment_method("SomeToken")
    end
  end

  def test_payment_method_not_found
    assert_raise_with_message(Spreedly::NotFoundError, "Unable to find the specified payment method.") do
       @environment.find_payment_method("SomeUnknownToken")
    end
  end

  def test_successfully_find_card
    found = @environment.find_payment_method(create_card_on(@environment).token)
    assert_kind_of(Spreedly::CreditCard, found)
    assert_equal("perrin@wot.com", found.email)
    assert_equal('XXXX-XXXX-XXXX-4444', found.number)
    assert_equal('Aybara', found.last_name)
  end

end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
spreedly-2.0.28 test/remote/remote_find_payment_method_test.rb
spreedly-2.0.27 test/remote/remote_find_payment_method_test.rb
spreedly-2.0.26 test/remote/remote_find_payment_method_test.rb
spreedly-2.0.25 test/remote/remote_find_payment_method_test.rb
spreedly-2.0.24 test/remote/remote_find_payment_method_test.rb
spreedly-2.0.23 test/remote/remote_find_payment_method_test.rb
spreedly-2.0.22 test/remote/remote_find_payment_method_test.rb
spreedly-2.0.21 test/remote/remote_find_payment_method_test.rb
spreedly-2.0.20 test/remote/remote_find_payment_method_test.rb
spreedly-2.0.19 test/remote/remote_find_payment_method_test.rb
spreedly-2.0.18 test/remote/remote_find_payment_method_test.rb
spreedly-2.0.17 test/remote/remote_find_payment_method_test.rb
spreedly-2.0.16 test/remote/remote_find_payment_method_test.rb
spreedly-2.0.15 test/remote/remote_find_payment_method_test.rb
spreedly-2.0.14 test/remote/remote_find_payment_method_test.rb
spreedly-2.0.13 test/remote/remote_find_payment_method_test.rb
spreedly-2.0.11 test/remote/remote_find_payment_method_test.rb
spreedly-2.0.10 test/remote/remote_find_payment_method_test.rb
spreedly-2.0.9 test/remote/remote_find_payment_method_test.rb
spreedly-2.0.8 test/remote/remote_find_payment_method_test.rb