Sha256: 3326d922f8f79799b3b26bcc8752f7ef1ba0726a7ce764f92446d1b1789e2234
Contents?: true
Size: 1.12 KB
Versions: 22
Compression:
Stored size: 1.12 KB
Contents
require File.join(File.dirname(__FILE__),'..','api_helper') describe "RhoconnectApiUpdateUser" do it_should_behave_like "ApiHelper" do it "should update user successfully" do post "/api/user/update_user", :api_token => @api_token, :attributes => {:new_password => '123'} last_response.should be_ok user = User.authenticate('rhoadmin','123') user.login.should == 'rhoadmin' user.admin.should == 1 end it "should fail to update user with wrong attributes" do post "/api/user/update_user", :api_token => @api_token, :attributes => {:missingattrib => '123'} last_response.status.should == 500 last_response.body.match('undefined method').should_not be_nil end it "should not update login attribute for user" do post "/api/user/update_user", :api_token => @api_token, :attributes => {:new_password => '123', :login => 'admin1'} last_response.should be_ok user = User.authenticate('rhoadmin','123') user.login.should == 'rhoadmin' user.admin.should == 1 User.is_exist?('admin1').should == false end end end
Version data entries
22 entries across 22 versions & 1 rubygems