Sha256: aeb8c388788cdf679771f66a310e754d7d6f807af07a4a0bc9883643d795e3c7

Contents?: true

Size: 915 Bytes

Versions: 27

Compression:

Stored size: 915 Bytes

Contents

require 'test_helper'

class RemoteListGatewaysTest < 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.list_gateways
    end
  end

  def test_successfully_list_gateways
    g1 = @environment.add_gateway(:test).token
    g2 = @environment.add_gateway(:test).token
    g3 = @environment.add_gateway(:test).token

    first_twenty = @environment.list_gateways
    assert_equal 20, first_twenty.size
    assert_kind_of Spreedly::Model, first_twenty.first

    gateways = @environment.list_gateways(g1)
    assert_equal 2, gateways.size
    assert_kind_of(Spreedly::Gateway, gateways.first)
    assert_kind_of(Spreedly::Gateway, gateways.last)

    assert_equal g2, gateways.first.token
    assert_equal g3, gateways.last.token
  end

end

Version data entries

27 entries across 27 versions & 1 rubygems

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