diff options
author | Roger Rüttimann <ror@panter.ch> | 2018-11-15 10:56:21 +0100 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-11-15 16:47:09 +0100 |
commit | 94d518f5d68b9bcead7564b6f8d42047cdf5d23b (patch) | |
tree | f2fe6fcdab3927f7e2fa66cb2a831a097fdd56d4 /spec | |
parent | 47dd7d0bbed879625f6ff19960ff390956e7c331 (diff) | |
download | gitlab-ce-94d518f5d68b9bcead7564b6f8d42047cdf5d23b.tar.gz |
Add a test for the creation of an internal user by an admin54093-the-default_value_for-gem-doesn-t-handle-actioncontroller-parameters-correctly
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/admin/admin_users_spec.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/spec/features/admin/admin_users_spec.rb b/spec/features/admin/admin_users_spec.rb index d32f33ca1e2..f7c7a257075 100644 --- a/spec/features/admin/admin_users_spec.rb +++ b/spec/features/admin/admin_users_spec.rb @@ -130,7 +130,7 @@ describe "Admin::Users" do context 'with regex to match internal user email address set', :js do before do stub_application_setting(user_default_external: true) - stub_application_setting(user_default_internal_regex: '.internal@') + stub_application_setting(user_default_internal_regex: '\.internal@') visit new_admin_user_path end @@ -169,6 +169,22 @@ describe "Admin::Users" do expects_warning_to_be_hidden end + + it 'creates an internal user' do + user_name = 'tester1' + fill_in 'user_email', with: 'test.internal@domain.ch' + fill_in 'user_name', with: 'tester1 name' + fill_in 'user_username', with: user_name + + expects_external_to_be_unchecked + expects_warning_to_be_shown + + click_button 'Create user' + + new_user = User.find_by(username: user_name) + + expect(new_user.external).to be_falsy + end end end end |