Sha256: accbcca01b33193cb5ad6edcf54baf2585e1b975c045f501e2edda98dfd2fc32

Contents?: true

Size: 1.18 KB

Versions: 14

Compression:

Stored size: 1.18 KB

Contents

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

describe "RhoconnectApiListUsers" do
  it_should_behave_like "ApiHelper" do
    it "should list users" do
      params = {:api_token => @api_token,
        :attributes => {:login => 'testuser1', :password => 'testpass1'}}
      post "/api/user/create_user", params
      last_response.should be_ok
      post "/api/user/list_users", {:api_token => @api_token}
      JSON.parse(last_response.body).should == ["testuser", "testuser1"]
    end

    it "should handle empty user's list" do
      @a.delete; @a = App.create(@a_fields)
      post "/api/user/list_users", {:api_token => @api_token}
      JSON.parse(last_response.body).should == []    
    end
    
    it "should show the deprecation warning on /api/list users" do
      params = {:api_token => @api_token,
        :attributes => {:login => 'testuser1', :password => 'testpass1'}}
      post "/api/user/create_user", params
      last_response.should be_ok
      post "/api/list_users", {:api_token => @api_token}
      JSON.parse(last_response.body).should == ["testuser", "testuser1"]
      last_response.headers['Warning'].index('deprecated').should_not == nil
    end
  end  
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rhoconnect-3.1.1 spec/api/user/list_users_spec.rb
rhoconnect-3.1.0 spec/api/user/list_users_spec.rb
rhoconnect-3.1.0.beta2 spec/api/user/list_users_spec.rb
rhoconnect-3.1.0.beta1 spec/api/user/list_users_spec.rb
rhoconnect-3.0.6 spec/api/user/list_users_spec.rb
rhoconnect-3.0.5 spec/api/user/list_users_spec.rb
rhoconnect-3.0.4 spec/api/user/list_users_spec.rb
rhoconnect-3.0.3 spec/api/user/list_users_spec.rb
rhoconnect-3.0.2 spec/api/user/list_users_spec.rb
rhoconnect-3.0.1 spec/api/user/list_users_spec.rb
rhoconnect-3.0.0 spec/api/user/list_users_spec.rb
rhoconnect-3.0.0.rc1 spec/api/user/list_users_spec.rb
rhoconnect-3.0.0.beta3 spec/api/user/list_users_spec.rb
rhoconnect-3.0.0.beta1 spec/api/user/list_users_spec.rb