Sha256: f8f92a8f339c769e302b97eece5b536771bf92e3f56269143f980c142f144a21

Contents?: true

Size: 1.05 KB

Versions: 15

Compression:

Stored size: 1.05 KB

Contents

require File.join(File.dirname(__FILE__),'..','api_helper')

describe "RhoconnectApiListUserClients" do
  include_examples "ApiHelper"

  it "should list user's clients" do
    get "/rc/#{Rhoconnect::API_VERSION}/users/#{@u_fields[:login]}/clients", {}, {Rhoconnect::API_TOKEN_HEADER => @api_token}
    res = JSON.parse(last_response.body)
    res.is_a?(Array).should == true
    res.size.should == 1
    res[0].is_a?(String) == true
    res[0].length.should == 32
  end

  it "should list user's clients with old route and show deprecation warning" do
    post "/api/list_clients", {:api_token => @api_token,
      :user_id => @u_fields[:login]}
    res = JSON.parse(last_response.body)
    res.is_a?(Array).should == true
    res.size.should == 1
    res[0].is_a?(String) == true
    res[0].length.should == 32
  end

  it "should handle empty client's list" do
    @u.clients.delete(@c.id)
    get "/rc/#{Rhoconnect::API_VERSION}/users/#{@u_fields[:login]}/clients", {}, {Rhoconnect::API_TOKEN_HEADER => @api_token}
    JSON.parse(last_response.body).should == []
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
rhoconnect-7.6.0 spec/api/user/list_clients_spec.rb
rhoconnect-7.5.1 spec/api/user/list_clients_spec.rb
rhoconnect-7.4.1 spec/api/user/list_clients_spec.rb
rhoconnect-7.1.17 spec/api/user/list_clients_spec.rb
rhoconnect-6.2.0 spec/api/user/list_clients_spec.rb
rhoconnect-6.0.11 spec/api/user/list_clients_spec.rb
rhoconnect-5.5.18 spec/api/user/list_clients_spec.rb
rhoconnect-5.5.17 spec/api/user/list_clients_spec.rb
rhoconnect-5.5.15 spec/api/user/list_clients_spec.rb
rhoconnect-5.5.0.22 spec/api/user/list_clients_spec.rb
rhoconnect-5.5.2 spec/api/user/list_clients_spec.rb
rhoconnect-5.5.0.7 spec/api/user/list_clients_spec.rb
rhoconnect-5.5.0.3 spec/api/user/list_clients_spec.rb
rhoconnect-5.5.0 spec/api/user/list_clients_spec.rb
rhoconnect-5.1.1 spec/api/user/list_clients_spec.rb