FIX: add additional email to tests and clean up resulting mess

This commit is contained in:
Leo McArdle
2017-07-31 22:27:29 +00:00
parent 31deebc8e6
commit 836dee1120
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'