Skip to content

Commit c12f8cc

Browse files
committed
made user email a sequence in user factory to avoid problems with github CI, second try
1 parent 621cefd commit c12f8cc

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

test/factories/users.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@
2424
password_confirmation { "Hubsch123123" }
2525
admin { false }
2626
passphrase { ENV["REGISTRATION_PASSPHRASE"] }
27+
2728
trait :admin do
28-
sequence(:email) { |n| "admin#{n}@xronos.ch" }
29+
sequence(:email) { |n| Faker::Internet.unique.email(name: "admin#{n}", domain: "xronos.ch") }
2930
admin { true }
3031
end
32+
3133
factory :admin, traits: [:admin]
32-
34+
3335
after(:build) do |user|
34-
user.user_profile = build(:user_profile, user: user)
36+
user.user_profile ||= build(:user_profile, user: user)
3537
end
3638
end
3739
end

0 commit comments

Comments
 (0)