summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorEhsan Abdulqader <dev.e7san@gmail.com>2019-02-18 08:40:07 +0000
committerPhil Hughes <me@iamphill.com>2019-02-18 08:40:07 +0000
commit7403d466f4a1d5f61871fc16a38f44fe43e0cdd3 (patch)
tree29b749dc3da7510fe6ea3241db1e3d9611d5f41f /spec
parent10094950bd5c7adff6888a7835f098a759af5ba4 (diff)
downloadgitlab-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.rb28
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