Sha256: 408537ed0ccb5c627d09265267a95537d9ced53777a5c61dceb78d8f20cea901

Contents?: true

Size: 1.15 KB

Versions: 5

Compression:

Stored size: 1.15 KB

Contents

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

  tests('current authentication') do
    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
    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

5 entries across 5 versions & 2 rubygems

Version Path
fog-1.22.0 tests/rackspace/identity_tests.rb
fog-1.21.0 tests/rackspace/identity_tests.rb
fog-maestrodev-1.20.0.20140305101839 tests/rackspace/identity_tests.rb
fog-maestrodev-1.20.0.20140305101305 tests/rackspace/identity_tests.rb
fog-1.20.0 tests/rackspace/identity_tests.rb