Sha256: 94b4912621b2a14b134259c401e9aba7c58d2baaad09f475d1e4f95d0afc6b54

Contents?: true

Size: 791 Bytes

Versions: 27

Compression:

Stored size: 791 Bytes

Contents

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

describe "RhosyncApiGetApiToken" do
  it_should_behave_like "ApiHelper"
  
  it "should get token string" do
    post "/login", :login => 'rhoadmin',:password => ''
    post "/api/get_api_token"
    last_response.body.should == @api_token
  end
  
  it "should fail to get token if user is not rhoadmin" do
    post "/login", :login => @u_fields[:login],:password => 'testpass'
    post "/api/get_api_token"
    last_response.status.should == 422    
    last_response.body.should == 'Invalid/missing API user'
  end  
  
  it "should return 422 if no token provided" do
    params = {:attributes => {:login => 'testuser1', :password => 'testpass1'}}
    post "/api/create_user", params
    last_response.status.should == 422
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
rhosync-2.1.12 spec/api/get_api_token_spec.rb
rhosync-2.1.11 spec/api/get_api_token_spec.rb
rhosync-2.1.10 spec/api/get_api_token_spec.rb
rhosync-2.1.7 spec/api/get_api_token_spec.rb
rhosync-2.1.6 spec/api/get_api_token_spec.rb
rhosync-2.1.3 spec/api/get_api_token_spec.rb
rhosync-2.1.2 spec/api/get_api_token_spec.rb
rhosync-2.1.1 spec/api/get_api_token_spec.rb
rhosync-2.1.0 spec/api/get_api_token_spec.rb
rhosync-2.1.0.beta.2 spec/api/get_api_token_spec.rb
rhosync-2.1.0.beta.1 spec/api/get_api_token_spec.rb
rhosync-2.0.9 spec/api/get_api_token_spec.rb
rhosync-2.0.8 spec/api/get_api_token_spec.rb
rhosync-2.0.7 spec/api/get_api_token_spec.rb
rhosync-2.0.6 spec/api/get_api_token_spec.rb
rhosync-2.0.5 spec/api/get_api_token_spec.rb
rhosync-2.0.4 spec/api/get_api_token_spec.rb
rhosync-2.0.3 spec/api/get_api_token_spec.rb
rhosync-2.0.2 spec/api/get_api_token_spec.rb
rhosync-2.0.1 spec/api/get_api_token_spec.rb