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`.
This commit is contained in:
Lin Jen-Shin 2017-03-17 17:54:56 +08:00
parent 4bf4612cfb
commit 46287f3638

View file

@ -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])