Sha256: f12bc0c40b568ee0b84150a8fa68b5e01a63029f4309b7dffd07fd28bc7e77d1

Contents?: true

Size: 1.34 KB

Versions: 96

Compression:

Stored size: 1.34 KB

Contents

Shindo.tests('Fog::Identity[:openstack] | user requests', ['openstack']) do

  @user_format = {
    'id'   => String,
    'name' => String,
    'enabled'  => Fog::Boolean,
    'email'    => String,
    'tenantId' => Fog::Nullable::String
  }

  tests('success') do

    @user_name = Fog::Mock.random_hex(64)
    @user_name_update = Fog::Mock.random_hex(64)

    tests("#create_user('#{@user_name}', 'mypassword', 'morph@example.com', 't3n4nt1d', true)").formats(@user_format, false) do
      @user = Fog::Identity[:openstack].create_user(@user_name, "mypassword", "morph@example.com", OpenStack::Identity.get_tenant_id).body['user']
    end

    tests('#list_users').formats({'users' => [@user_format]}) do
      Fog::Identity[:openstack].list_users.body
    end

    tests('#get_user_by_id').formats(@user_format) do
      Fog::Identity[:openstack].get_user_by_id(@user['id']).body['user']
    end

    tests('#get_user_by_name').formats(@user_format) do
      Fog::Identity[:openstack].get_user_by_name(@user['name']).body['user']
    end

    tests("#update_user(#{@user['id']}, :name => 'fogupdateduser')").succeeds do
      Fog::Identity[:openstack].update_user(@user['id'], :name => @user_name_update, :email => 'fog@test.com')
    end

    tests("#delete_user(#{@user['id']})").succeeds do
      Fog::Identity[:openstack].delete_user(@user['id'])
    end

  end
end

Version data entries

96 entries across 96 versions & 10 rubygems

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