Sha256: 59afb351a88b57d3f7e95c5d326a1c2ad1eb66abc0314499ca1085a431433214

Contents?: true

Size: 1.11 KB

Versions: 21

Compression:

Stored size: 1.11 KB

Contents

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

describe "RhoconnectApiListUserClients" do
  it_should_behave_like "ApiHelper" do
    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
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
rhoconnect-4.0.4 spec/api/user/list_clients_spec.rb
rhoconnect-4.0.3 spec/api/user/list_clients_spec.rb
rhoconnect-4.0.2 spec/api/user/list_clients_spec.rb
rhoconnect-4.0.1 spec/api/user/list_clients_spec.rb
rhoconnect-4.0.0 spec/api/user/list_clients_spec.rb
rhoconnect-4.0.0.beta.24 spec/api/user/list_clients_spec.rb
rhoconnect-3.4.5 spec/api/user/list_clients_spec.rb
rhoconnect-4.0.0.beta.10 spec/api/user/list_clients_spec.rb
rhoconnect-4.0.0.beta.12 spec/api/user/list_clients_spec.rb
rhoconnect-3.4.4 spec/api/user/list_clients_spec.rb
rhoconnect-3.4.3 spec/api/user/list_clients_spec.rb
rhoconnect-3.4.2 spec/api/user/list_clients_spec.rb
rhoconnect-3.3.6 spec/api/user/list_clients_spec.rb
rhoconnect-3.3.5 spec/api/user/list_clients_spec.rb
rhoconnect-3.3.4 spec/api/user/list_clients_spec.rb
rhoconnect-3.3.3 spec/api/user/list_clients_spec.rb
rhoconnect-3.3.2 spec/api/user/list_clients_spec.rb
rhoconnect-3.3.1 spec/api/user/list_clients_spec.rb
rhoconnect-3.3.1.beta4 spec/api/user/list_clients_spec.rb
rhoconnect-3.3.1.beta3 spec/api/user/list_clients_spec.rb