Sha256: 077b6958e66778fd72cea49c929d92a48352c45be46d5392250b37b1a5dad680
Contents?: true
Size: 1011 Bytes
Versions: 6
Compression:
Stored size: 1011 Bytes
Contents
require File.join(File.dirname(__FILE__),'..','api_helper') describe "RhoconnectApiCreateUser" do it_should_behave_like "ApiHelper" do it "should create user" do params = {:api_token => @api_token, :attributes => {:login => 'testuser1', :password => 'testpass1'}} post "/api/user/create_user", params last_response.should be_ok User.load(params[:attributes][:login]).login.should == params[:attributes][:login] User.authenticate(params[:attributes][:login], params[:attributes][:password]).login.should == params[:attributes][:login] @a.users.members.sort.should == [@u.login, params[:attributes][:login]] end end it_should_behave_like "ApiHelper" do it "should not create user with empty login" do params = {:api_token => @api_token, :attributes => {:login => '', :password => ''}} post "/api/user/create_user", params last_response.should_not be_ok User.is_exist?('').should == false end end end
Version data entries
6 entries across 6 versions & 1 rubygems