summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Andrinopoulos <geoandri@gmail.com>2017-03-13 10:05:15 +0000
committerRémy Coutable <remy@rymai.me>2017-03-13 10:05:15 +0000
commitec660a6bc1ac23963067698d38516eae2da232ed (patch)
tree5e0a969f1055aa40148f39d789dd44dfa63dd8b3
parent7e7409c46bcec2edc5c1e7c4e7809977069048d7 (diff)
downloadgitlab-ce-ec660a6bc1ac23963067698d38516eae2da232ed.tar.gz
Resolve transient failure in spec/models/user_spec.rb
-rw-r--r--changelogs/unreleased/29328-fix-transient-failure-in-model-user-spec.yml4
-rw-r--r--spec/models/user_spec.rb5
2 files changed, 7 insertions, 2 deletions
diff --git a/changelogs/unreleased/29328-fix-transient-failure-in-model-user-spec.yml b/changelogs/unreleased/29328-fix-transient-failure-in-model-user-spec.yml
new file mode 100644
index 00000000000..dabf9968c5b
--- /dev/null
+++ b/changelogs/unreleased/29328-fix-transient-failure-in-model-user-spec.yml
@@ -0,0 +1,4 @@
+---
+title: Add custom attributes in factories
+merge_request: 9892
+author: George Andrinopoulos
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index adb5b538922..3166b951a42 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -713,8 +713,9 @@ describe User, models: true do
describe '.search_with_secondary_emails' do
delegate :search_with_secondary_emails, to: :described_class
- let!(:user) { create(:user) }
- let!(:email) { create(:email) }
+ 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) }
it 'returns users with a matching name' do
expect(search_with_secondary_emails(user.name)).to eq([user])