diff options
author | DJ Mountney <david@twkie.net> | 2017-03-31 23:06:15 +0300 |
---|---|---|
committer | DJ Mountney <david@twkie.net> | 2017-04-04 20:18:56 +0300 |
commit | a766f60a0be65a5f8af3f4328c1bcdc505948d15 (patch) | |
tree | 59cac43333d9c8ce84380b01502b8824202e98d3 /spec/services/users/create_service_spec.rb | |
parent | 93de37ce1bd0f5ce015287f0729d625ddf6f7390 (diff) |
Inlude the password_automatically_check param as permitted config in the user create_service
This param is passed to service in two places, one is in the build_user for non ldap oauth users. And the other is in the initial production admin user seed data.
Without this change, when setting up GitLab in a production environment, you were not being given the option of setting the root password on initial setup in the UI.
Diffstat (limited to 'spec/services/users/create_service_spec.rb')
-rw-r--r-- | spec/services/users/create_service_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/services/users/create_service_spec.rb b/spec/services/users/create_service_spec.rb index 66f68650f81..a111aec2f89 100644 --- a/spec/services/users/create_service_spec.rb +++ b/spec/services/users/create_service_spec.rb @@ -122,6 +122,32 @@ describe Users::CreateService, services: true do end end + context 'when password_automatically_set parameter is true' do + let(:params) do + { + name: 'John Doe', + username: 'jduser', + email: 'jd@example.com', + password: 'mydummypass', + password_automatically_set: true + } + end + + it 'persists the given attributes' do + user = service.execute + user.reload + + expect(user).to have_attributes( + name: params[:name], + username: params[:username], + email: params[:email], + password: params[:password], + created_by_id: admin_user.id, + password_automatically_set: params[:password_automatically_set] + ) + end + end + context 'when skip_confirmation parameter is true' do let(:params) do { name: 'John Doe', username: 'jduser', email: 'jd@example.com', password: 'mydummypass', skip_confirmation: true } |