Sha256: 95abff20a4fb025e5f6bc16ecd2d12c9fabd492f1405cee6d394a9b26d8eb88c

Contents?: true

Size: 718 Bytes

Versions: 1

Compression:

Stored size: 718 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", {:app_name => @test_app_name, :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", {:app_name => @test_app_name, :api_token => @api_token, 
      :user_id => @u_fields[:login]}
    JSON.parse(last_response.body).should == []    
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rhosync-2.0.0.beta1 spec/api/list_clients_spec.rb