Sha256: 2755e104e4e1da58a7a7423b7bb10df5cd385b070d2b835be9e3743b2dd94ef1

Contents?: true

Size: 1.23 KB

Versions: 13

Compression:

Stored size: 1.23 KB

Contents

require 'test_helper'

class RemoteAddGatewayTest < 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.add_gateway(:test)
    end
  end

  def test_non_existent_gateway_type
    assert_raise_with_message(Spreedly::TransactionCreationError, "The gateway_type parameter is invalid.") do
      @environment.add_gateway(:non_existent)
    end
  end

  def test_add_test_gateway
    gateway = @environment.add_gateway(:test)
    assert_equal "test", gateway.gateway_type
    assert_equal "retained", gateway.state
    assert_equal "Spreedly Test", gateway.name
  end

  def test_need_active_account
    assert_raise_with_message(Spreedly::PaymentRequiredError, "Your environment (R7lHscqcYkZeDGGbthKp6GKMu15) has not been activated for real transactions with real payment methods. If you're using a Test Gateway you can *ONLY* use Test payment methods - ( https://docs.spreedly.com/test-data). All other credit card numbers are considered real credit cards; real credit cards are not allowed when using a Test Gateway.") do
      @environment.add_gateway(:wirecard)
    end
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
spreedly-2.0.28 test/remote/remote_add_gateway_test.rb
spreedly-2.0.27 test/remote/remote_add_gateway_test.rb
spreedly-2.0.26 test/remote/remote_add_gateway_test.rb
spreedly-2.0.25 test/remote/remote_add_gateway_test.rb
spreedly-2.0.24 test/remote/remote_add_gateway_test.rb
spreedly-2.0.23 test/remote/remote_add_gateway_test.rb
spreedly-2.0.22 test/remote/remote_add_gateway_test.rb
spreedly-2.0.21 test/remote/remote_add_gateway_test.rb
spreedly-2.0.20 test/remote/remote_add_gateway_test.rb
spreedly-2.0.19 test/remote/remote_add_gateway_test.rb
spreedly-2.0.18 test/remote/remote_add_gateway_test.rb
spreedly-2.0.17 test/remote/remote_add_gateway_test.rb
spreedly-2.0.16 test/remote/remote_add_gateway_test.rb