Sha256: fda989b7d32278db819cf17469b37277f0beed4afea896ac80f3a9813fdeb199

Contents?: true

Size: 1.15 KB

Versions: 39

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

39 entries across 37 versions & 6 rubygems

Version Path
fog-rackspace-0.1.6 tests/rackspace/identity_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-rackspace-0.1.5/tests/rackspace/identity_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-rackspace-0.1.5/tests/rackspace/identity_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-rackspace-0.1.5/tests/rackspace/identity_tests.rb
fog-rackspace-0.1.5 tests/rackspace/identity_tests.rb
fog-rackspace-0.1.4 tests/rackspace/identity_tests.rb
fog-rackspace-0.1.3 tests/rackspace/identity_tests.rb
fog-rackspace-0.1.2 tests/rackspace/identity_tests.rb
fog-rackspace-0.1.1 tests/rackspace/identity_tests.rb
fog-rackspace-0.1.0 tests/rackspace/identity_tests.rb
fog-1.37.0 tests/rackspace/identity_tests.rb
fog-1.36.0 tests/rackspace/identity_tests.rb
fog-1.35.0 tests/rackspace/identity_tests.rb
fog-2.0.0.pre.0 tests/rackspace/identity_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/rackspace/identity_tests.rb
fog-1.34.0 tests/rackspace/identity_tests.rb
fog-1.33.0 tests/rackspace/identity_tests.rb
fog-1.32.0 tests/rackspace/identity_tests.rb
fog-1.31.0 tests/rackspace/identity_tests.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/rackspace/identity_tests.rb