Merge pull request #5013 from LeoMcA/alternate-emails-phase-1.5

FIX: add additional email to tests and clean up resulting mess
This commit is contained in:
Guo Xiang Tan
2017-08-16 16:19:28 +09:00
committed by GitHub
7 changed files with 18 additions and 7 deletions

View File

@@ -2,3 +2,8 @@ Fabricator(:user_email) do
email { sequence(:email) { |i| "bruce#{i}@wayne.com" } }
primary true
end
Fabricator(:alternate_email, from: :user_email) do
email { sequence(:email) { |i| "bwayne#{i}@wayne.com" } }
primary false
end

View File

@@ -1,7 +1,7 @@
Fabricator(:user_stat) do
end
Fabricator(:user) do
Fabricator(:user_single_email, class_name: :user) do
name 'Bruce Wayne'
username { sequence(:username) { |i| "bruce#{i}" } }
email { sequence(:email) { |i| "bruce#{i}@wayne.com" } }
@@ -11,6 +11,10 @@ Fabricator(:user) do
active true
end
Fabricator(:user, from: :user_single_email) do
after_create { |user| Fabricate(:alternate_email, user: user) }
end
Fabricator(:coding_horror, from: :user) do
name 'Coding Horror'
username 'CodingHorror'