Sha256: 608a66c7bf24509fabf7511fdf86823b2b28eeea40e4011bd17c88d87f68e903

Contents?: true

Size: 660 Bytes

Versions: 48

Compression:

Stored size: 660 Bytes

Contents

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

describe "RhosyncApiListUsers" do
  it_should_behave_like "ApiHelper"
  
  it "should list clients" 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)
    post "/api/list_clients", {:api_token => @api_token, 
      :user_id => @u_fields[:login]}
    JSON.parse(last_response.body).should == []    
  end
  
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
rhosync-2.0.0.beta10 spec/api/list_clients_spec.rb
rhosync-2.0.0.beta9 spec/api/list_clients_spec.rb
rhosync-2.0.0.beta8 spec/api/list_clients_spec.rb
rhosync-2.0.0.beta7 spec/api/list_clients_spec.rb
rhosync-2.0.0.beta6 spec/api/list_clients_spec.rb
rhosync-2.0.0.beta4 spec/api/list_clients_spec.rb
rhosync-2.0.0.beta3 spec/api/list_clients_spec.rb
rhosync-2.0.0.beta2 spec/api/list_clients_spec.rb