diff options
author | Rémy Coutable <remy@rymai.me> | 2018-10-01 18:13:08 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-10-01 18:13:08 +0300 |
commit | 051090c804a4808cd43a2e5494fe7cb868314765 (patch) | |
tree | 61a38fab494aa9c56c09f24e907bc843d16a7bc4 /spec | |
parent | bfeed3b304aa6719b8f823de23f0cbe9712ba7de (diff) | |
parent | 303350567c7b2bf140fa17d3f3f473ad9ece4e45 (diff) |
Merge branch 'feature/set-public-email-through-api' into 'master'
Set public email through api
Closes #37675
See merge request gitlab-org/gitlab-ce!21938
Diffstat (limited to 'spec')
-rw-r--r-- | spec/services/users/build_service_spec.rb | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/spec/services/users/build_service_spec.rb b/spec/services/users/build_service_spec.rb index b987fe45138..051e8c87f39 100644 --- a/spec/services/users/build_service_spec.rb +++ b/spec/services/users/build_service_spec.rb @@ -14,6 +14,49 @@ describe Users::BuildService do expect(service.execute).to be_valid end + context 'allowed params' do + let(:params) do + { + access_level: 1, + admin: 1, + avatar: anything, + bio: 1, + can_create_group: 1, + color_scheme_id: 1, + email: 1, + external: 1, + force_random_password: 1, + hide_no_password: 1, + hide_no_ssh_key: 1, + linkedin: 1, + name: 1, + password: 1, + password_automatically_set: 1, + password_expires_at: 1, + projects_limit: 1, + remember_me: 1, + skip_confirmation: 1, + skype: 1, + theme_id: 1, + twitter: 1, + username: 1, + website_url: 1, + private_profile: 1, + organization: 1, + location: 1, + public_email: 1 + } + end + + it 'sets all allowed attributes' do + admin_user # call first so the admin gets created before setting `expect` + + expect(User).to receive(:new).with(hash_including(params)).and_call_original + + service.execute + end + end + context 'with "user_default_external" application setting' do using RSpec::Parameterized::TableSyntax |