Commit 94d518f5 authored by Roger Rüttimann's avatar Roger Rüttimann Committed by Rémy Coutable

Add a test for the creation of an internal user by an admin

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 47dd7d0b
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment