Sha256: 449a63911dd43ae972013aa05b7df60521ee0c6dedfb0a23badc3111a54a695b

Contents?: true

Size: 1.07 KB

Versions: 96

Compression:

Stored size: 1.07 KB

Contents

Shindo.tests("Fog::Identity[:openstack] | user", ['openstack']) do
  tenant_id = Fog::Identity[:openstack].list_tenants.body['tenants'].first['id']
  @instance = Fog::Identity[:openstack].users.new({
    :name      => 'User Name',
    :email     => 'test@fog.com',
    :tenant_id => tenant_id,
    :password  => 'spoof',
    :enabled   => true
  })

  tests('success') do
    tests('#save').returns(true) do
      @instance.save
    end

    tests('#roles').succeeds do
      @instance.roles
    end

    tests('#update').returns(true) do
      @instance.update({:name => 'updatename', :email => 'new@email.com'})
    end

    tests('#update_password').returns(true) do
      @instance.update_password('swordfish')
    end

    tests('#update_tenant').returns(true) do
      @instance.update_tenant(tenant_id)
    end

    tests('#update_enabled').returns(true) do
      @instance.update_enabled(true)
    end

    tests('#destroy').returns(true) do
      @instance.destroy
    end
  end

  tests('failure') do
    tests('#save').raises(Fog::Errors::Error) do
      @instance.save
    end
  end
end

Version data entries

96 entries across 96 versions & 10 rubygems

Version Path
fog-1.20.0 tests/openstack/models/identity/user_tests.rb
fog-maestrodev-1.19.0.20140110004459 tests/openstack/models/identity/user_tests.rb
fog-maestrodev-1.19.0.20140110003812 tests/openstack/models/identity/user_tests.rb
fog-maestrodev-1.19.0.20140109202555 tests/openstack/models/identity/user_tests.rb
fog-maestrodev-1.19.0.20140107192102 tests/openstack/models/identity/user_tests.rb
fog-maestrodev-1.19.0.20140107142106 tests/openstack/models/identity/user_tests.rb
fog-maestrodev-1.19.0.20131219203941 tests/openstack/models/identity/user_tests.rb
fog-maestrodev-1.18.0.20131219193542 tests/openstack/models/identity/user_tests.rb
fog-1.19.0 tests/openstack/models/identity/user_tests.rb
fog-maestrodev-1.18.0.20131219033443 tests/openstack/models/identity/user_tests.rb
fog-maestrodev-1.18.0.20131219032002 tests/openstack/models/identity/user_tests.rb
fog-maestrodev-1.18.0.20131219030716 tests/openstack/models/identity/user_tests.rb
fog-maestrodev-1.18.0.20131219022322 tests/openstack/models/identity/user_tests.rb
fog-maestrodev-1.18.0.20131218202447 tests/openstack/models/identity/user_tests.rb
fog-maestrodev-1.18.0.20131209091424 tests/openstack/models/identity/user_tests.rb
fog-maestrodev-1.18.0.20131209090811 tests/openstack/models/identity/user_tests.rb
fog-maestrodev-1.18.0.20131206115947 tests/openstack/models/identity/user_tests.rb
fog-maestrodev-1.18.0.20131205181604 tests/openstack/models/identity/user_tests.rb
fog-maestrodev-1.18.0.20131127194823 tests/openstack/models/identity/user_tests.rb
fog-maestrodev-1.18.0.20131126183714 tests/openstack/models/identity/user_tests.rb