diff options
author | Ehsan Abdulqader <dev.e7san@gmail.com> | 2019-02-18 08:40:07 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-02-18 08:40:07 +0000 |
commit | 7403d466f4a1d5f61871fc16a38f44fe43e0cdd3 (patch) | |
tree | 29b749dc3da7510fe6ea3241db1e3d9611d5f41f /spec | |
parent | 10094950bd5c7adff6888a7835f098a759af5ba4 (diff) | |
download | gitlab-ce-7403d466f4a1d5f61871fc16a38f44fe43e0cdd3.tar.gz |
Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into feature/56787-realtime-validation-for-user-fullname-and-username
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/users/signup_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/features/users/signup_spec.rb b/spec/features/users/signup_spec.rb index bfe11ddf673..957c3cfc583 100644 --- a/spec/features/users/signup_spec.rb +++ b/spec/features/users/signup_spec.rb @@ -49,6 +49,34 @@ describe 'Signup' do expect(page).to have_content("Please create a username with only alphanumeric characters.") end + + it 'shows an error border if the username contains emojis' do + simulate_input('#new_user_username', 'ehsan😀') + + expect(find('.username')).to have_css '.gl-field-error-outline' + end + + it 'shows an error message if the username contains emojis' do + simulate_input('#new_user_username', 'ehsan😀') + + expect(page).to have_content("Invalid input, please avoid emojis") + end + end + + describe 'user\'s full name validation', :js do + before do + visit root_path + click_link 'Register' + simulate_input('#new_user_name', 'Ehsan 🦋') + end + + it 'shows an error border if the user\'s fullname contains an emoji' do + expect(find('.name')).to have_css '.gl-field-error-outline' + end + + it 'shows an error message if the username contains emojis' do + expect(page).to have_content("Invalid input, please avoid emojis") + end end context 'with no errors' do |