Sha256: 1ccf219264785b8a0bc76012fb22a35b7f4b6e19ea253f4eba8fe08391d9f91f

Contents?: true

Size: 1.21 KB

Versions: 36

Compression:

Stored size: 1.21 KB

Contents

Shindo.tests('Fog::Rackspace::Identity', ['rackspace']) do

  tests('current authentication') do
    pending if Fog.mocking?

    tests('variables populated').returns(200)  do
      @service = Fog::Rackspace::Identity.new :rackspace_auth_url => 'https://identity.api.rackspacecloud.com/v2.0', :connection_options => {:ssl_verify_peer => true}
      returns(true, "auth token populated") { !@service.auth_token.nil? }
      returns(false, "path populated") { @service.instance_variable_get("@uri").host.nil? }
      returns(false, "service catalog populated") { @service.service_catalog.nil? }

      @service.list_tenants.status
    end
  end

  tests('reauthentication') do
    pending if Fog.mocking?

    tests('should reauth with valid credentials') do
      @service = Fog::Rackspace::Identity.new  :rackspace_region => :ord
      returns(true, "auth token populated") { !@service.auth_token.nil? }
      @service.instance_variable_set("@auth_token", "bad-token")
      returns(true) { [200, 203].include? @service.list_tenants.status }
    end
    tests('should terminate with incorrect credentials') do
      raises(Excon::Errors::Unauthorized) { Fog::Rackspace::Identity.new :rackspace_api_key => 'bad_key' }
    end
  end

end

Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
fog-maestrodev-1.19.0.20140212012611 tests/rackspace/identity_tests.rb
fog-maestrodev-1.19.0.20140110004459 tests/rackspace/identity_tests.rb
fog-maestrodev-1.19.0.20140110003812 tests/rackspace/identity_tests.rb
fog-maestrodev-1.19.0.20140109202555 tests/rackspace/identity_tests.rb
fog-maestrodev-1.19.0.20140107192102 tests/rackspace/identity_tests.rb
fog-maestrodev-1.19.0.20140107142106 tests/rackspace/identity_tests.rb
fog-maestrodev-1.19.0.20131219203941 tests/rackspace/identity_tests.rb
fog-maestrodev-1.18.0.20131219193542 tests/rackspace/identity_tests.rb
fog-1.19.0 tests/rackspace/identity_tests.rb
fog-maestrodev-1.18.0.20131219033443 tests/rackspace/identity_tests.rb
fog-maestrodev-1.18.0.20131219032002 tests/rackspace/identity_tests.rb
fog-maestrodev-1.18.0.20131219030716 tests/rackspace/identity_tests.rb
fog-maestrodev-1.18.0.20131219022322 tests/rackspace/identity_tests.rb
fog-maestrodev-1.18.0.20131218202447 tests/rackspace/identity_tests.rb
fog-maestrodev-1.18.0.20131209091424 tests/rackspace/identity_tests.rb
fog-maestrodev-1.18.0.20131209090811 tests/rackspace/identity_tests.rb
fog-maestrodev-1.18.0.20131206115947 tests/rackspace/identity_tests.rb
fog-maestrodev-1.18.0.20131205181604 tests/rackspace/identity_tests.rb
fog-maestrodev-1.18.0.20131127194823 tests/rackspace/identity_tests.rb
fog-maestrodev-1.18.0.20131126183714 tests/rackspace/identity_tests.rb