summaryrefslogtreecommitdiff
path: root/spec/models/user_spec.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-03-17 17:54:56 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-03-17 17:54:56 +0800
commit46287f3638f2e285ccc46fc50bd9b7b0dc9d9bc3 (patch)
tree9e4f2aacebeeb85bbf1f07a42b2a54c1c0af080f /spec/models/user_spec.rb
parent4bf4612cfbe73845391375bf721592426d7b4181 (diff)
downloadgitlab-ce-46287f3638f2e285ccc46fc50bd9b7b0dc9d9bc3.tar.gz
Make sure alias email would never match:
Hopefully this could fix: https://gitlab.com/gitlab-org/gitlab-ce/builds/12431186 To make sure that the email would never contain "joh" otherwise it would match to this `another_user`.
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r--spec/models/user_spec.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 9da4140f3ce..90378179e32 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -699,7 +699,9 @@ describe User, models: true do
let!(:user) { create(:user, name: 'John Doe', username: 'john.doe', email: 'john.doe@example.com' ) }
let!(:another_user) { create(:user, name: 'Albert Smith', username: 'albert.smith', email: 'albert.smith@example.com' ) }
- let!(:email) { create(:email, user: another_user) }
+ let!(:email) do
+ create(:email, user: another_user, email: 'alias@example.com')
+ end
it 'returns users with a matching name' do
expect(search_with_secondary_emails(user.name)).to eq([user])