Sha256: ceead0f04a1c471ae9c3f972730809769381cdf4a311062e6d0cade78cf77dae

Contents?: true

Size: 1.69 KB

Versions: 35

Compression:

Stored size: 1.69 KB

Contents

Shindo.tests('Fog::Identity[:openstack] | role requests', ['openstack']) do
  @role_format = {
    'id'   => String,
    'name' => String
  }
  @user   = Fog::Identity[:openstack].list_users.body['users'].first
  @tenant = Fog::Identity[:openstack].list_tenants.body['tenants'].first
  tests('success') do

    tests('#create_role("Role Name")').formats(@role_format, false) do
      @role = Fog::Identity[:openstack].create_role("Role Name").body['role']
    end

    tests('#list_roles').formats({'roles' => [@role_format]}) do
      Fog::Identity[:openstack].list_roles.body
    end

    tests("#get_role('#{@role['id']}')").formats(@role_format) do
      Fog::Identity[:openstack].get_role(@role['id']).body['role']
    end

    tests('#create_user_role(@tenant["id"], @user["id"], @role["id"])').formats(@role_format) do
      Fog::Identity[:openstack].create_user_role(@tenant['id'], @user['id'], @role['id']).body['role']
    end

    tests("#list_roles_for_user_on_tenant('#{@tenant['id']}','#{@user['id']}')").formats([@role_format]) do
      Fog::Identity[:openstack].list_roles_for_user_on_tenant(@tenant['id'], @user['id']).body['roles']
    end

    tests("#delete_user_role with tenant").returns("") do
      Fog::Identity[:openstack].delete_user_role(@tenant['id'], @user['id'], @role['id']).body
    end

    tests("#delete_user_role with tenant").formats(@role_format) do
      # FIXME - Response (under mocks) is empty String which does not match schema
      pending
      Fog::Identity[:openstack].delete_user_role(@tenant['id'], @user['id'], @role['id']).body
    end

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

  end
end

Version data entries

35 entries across 35 versions & 5 rubygems

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