summaryrefslogtreecommitdiff
path: root/spec/features/profiles/user_manages_emails_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-11-18 13:16:36 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-11-18 13:16:36 +0000
commit311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch)
tree07e7870bca8aed6d61fdcc810731c50d2c40af47 /spec/features/profiles/user_manages_emails_spec.rb
parent27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff)
downloadgitlab-ce-311b0269b4eb9839fa63f80c8d7a58f32b8138a0.tar.gz
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'spec/features/profiles/user_manages_emails_spec.rb')
-rw-r--r--spec/features/profiles/user_manages_emails_spec.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/spec/features/profiles/user_manages_emails_spec.rb b/spec/features/profiles/user_manages_emails_spec.rb
index 373c4f565f2..b037d5048aa 100644
--- a/spec/features/profiles/user_manages_emails_spec.rb
+++ b/spec/features/profiles/user_manages_emails_spec.rb
@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe 'User manages emails' do
let(:user) { create(:user) }
+ let(:other_user) { create(:user) }
before do
sign_in(user)
@@ -11,7 +12,7 @@ RSpec.describe 'User manages emails' do
visit(profile_emails_path)
end
- it "shows user's emails" do
+ it "shows user's emails", :aggregate_failures do
expect(page).to have_content(user.email)
user.emails.each do |email|
@@ -19,7 +20,7 @@ RSpec.describe 'User manages emails' do
end
end
- it 'adds an email' do
+ it 'adds an email', :aggregate_failures do
fill_in('email_email', with: 'my@email.com')
click_button('Add')
@@ -34,21 +35,21 @@ RSpec.describe 'User manages emails' do
end
end
- it 'does not add a duplicate email' do
- fill_in('email_email', with: user.email)
+ it 'does not add an email that is the primary email of another user', :aggregate_failures do
+ fill_in('email_email', with: other_user.email)
click_button('Add')
- email = user.emails.find_by(email: user.email)
+ email = user.emails.find_by(email: other_user.email)
expect(email).to be_nil
- expect(page).to have_content(user.email)
+ expect(page).to have_content('Email has already been taken')
user.emails.each do |email|
expect(page).to have_content(email.email)
end
end
- it 'removes an email' do
+ it 'removes an email', :aggregate_failures do
fill_in('email_email', with: 'my@email.com')
click_button('Add')