Sha256: c2d8d9bb67137694238606b74dcaf976ec73d2693496c6f06db276df2acd8ee9

Contents?: true

Size: 1.22 KB

Versions: 37

Compression:

Stored size: 1.22 KB

Contents

Shindo.tests("Fog::Identity[:openstack] | users", ['openstack']) do
  tenant_id = Fog::Identity[:openstack].list_tenants.body['tenants'].first['id']
  @instance = Fog::Identity[:openstack].users.create({
    :name      => 'foobar',
    :email     => 'foo@bar.com',
    :tenant_id => tenant_id,
    :password  => 'spoof',
    :enabled   => true
  })

  tests('success') do
    tests('#find_by_id').succeeds do
      user = Fog::Identity[:openstack].users.find_by_id(@instance.id)
      user.id == @instance.id
    end

    tests('#find_by_name').succeeds do
      user = Fog::Identity[:openstack].users.find_by_name(@instance.name)
      user.name == @instance.name
    end

    tests('#destroy').succeeds do
      Fog::Identity[:openstack].users.destroy(@instance.id)
    end
  end

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

    tests('#find_by_id').raises(Fog::Identity::OpenStack::NotFound) do
      Fog::Identity[:openstack].users.find_by_id('fake')
    end

    tests('#find_by_name').raises(Fog::Identity::OpenStack::NotFound) do
      Fog::Identity[:openstack].users.find_by_name('fake')
    end

    tests('#destroy').raises(Fog::Identity::OpenStack::NotFound) do
      Fog::Identity[:openstack].users.destroy('fake')
    end
  end
end

Version data entries

37 entries across 37 versions & 5 rubygems

Version Path
fog-openstack-0.1.5 tests/openstack/models/identity/users_tests.rb
fog-openstack-0.1.4 tests/openstack/models/identity/users_tests.rb
fog-openstack-0.1.3 tests/openstack/models/identity/users_tests.rb
fog-openstack-0.1.2 tests/openstack/models/identity/users_tests.rb
fog-openstack-0.1.1 tests/openstack/models/identity/users_tests.rb
fog-openstack-0.1.0 tests/openstack/models/identity/users_tests.rb
fog-1.37.0 tests/openstack/models/identity/users_tests.rb
fog-1.36.0 tests/openstack/models/identity/users_tests.rb
fog-1.35.0 tests/openstack/models/identity/users_tests.rb
fog-2.0.0.pre.0 tests/openstack/models/identity/users_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/openstack/models/identity/users_tests.rb
fog-1.34.0 tests/openstack/models/identity/users_tests.rb
fog-1.33.0 tests/openstack/models/identity/users_tests.rb
fog-1.32.0 tests/openstack/models/identity/users_tests.rb
fog-1.31.0 tests/openstack/models/identity/users_tests.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/openstack/models/identity/users_tests.rb
fog-1.30.0 tests/openstack/models/identity/users_tests.rb
fog-1.29.0 tests/openstack/models/identity/users_tests.rb
fog-1.28.0 tests/openstack/models/identity/users_tests.rb
fog-1.27.0 tests/openstack/models/identity/users_tests.rb