Sha256: 0b1260742e1ff6dd559dcec50a5986d2407d56a28c36740108578719e357267c
Contents?: true
Size: 1.04 KB
Versions: 41
Compression:
Stored size: 1.04 KB
Contents
require File.join(File.dirname(__FILE__),'api_helper') describe "RhosyncApiUpdateUser" do it_should_behave_like "ApiHelper" it "should update user successfully" do post "/api/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/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/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
Version data entries
41 entries across 41 versions & 1 rubygems