Verified Commit f09ce619 authored by Kaspar Vollenweider's avatar Kaspar Vollenweider 👻
Browse files

remove empty trait fake_email and subfactory from users factory

parent d7f6daec
......@@ -57,7 +57,7 @@ FactoryBot.define do
end
after(:build) do |client|
client.user ||= create(:user_fake_email)
client.user ||= create(:user)
if client.salutation == 'mrs'
client.contact.first_name = I18n.t('faker.name.female_first_name').sample
elsif client.salutation == 'mr'
......
FactoryBot.define do
factory :event_volunteer do
association :creator, factory: :user_fake_email
association :creator, factory: :user
association :volunteer, factory: :volunteer_with_user
association :event, factory: :event
......
......@@ -7,7 +7,7 @@ FactoryBot.define do
end_time { FFaker::Time.between(20.hours.ago, 4.hours.ago) }
date { FFaker::Time.between(300.days.ago, 10.days.ago) }
association :creator, factory: :user_fake_email
association :creator, factory: :user
trait :with_department do
association :department
......
......@@ -18,7 +18,7 @@ FactoryBot.define do
feedback.volunteer = create(:volunteer_with_user)
feedback.feedbackable = create(:assignment, volunteer: feedback.volunteer)
end
feedback.author ||= feedback.volunteer&.user || create(:user_fake_email)
feedback.author ||= feedback.volunteer&.user || create(:user)
end
end
end
FactoryBot.define do
factory :group_offer do
association :creator, factory: :user_fake_email
association :creator, factory: :user
association :department
title { FFaker::Lorem.unique.sentence }
......
FactoryBot.define do
factory :reminder_mailing do
association :creator, factory: :user_fake_email
association :creator, factory: :user
body { FFaker::Lorem.paragraph }
subject { FFaker::Lorem.sentence }
......
......@@ -15,7 +15,7 @@ FactoryBot.define do
trial_feedback.trial_feedbackable = create(:assignment, period_end: nil,
period_start: 6.weeks.ago, volunteer: trial_feedback.volunteer)
end
trial_feedback.author ||= trial_feedback.volunteer&.user || create(:user_fake_email)
trial_feedback.author ||= trial_feedback.volunteer&.user || create(:user)
end
end
end
......@@ -34,10 +34,6 @@ FactoryBot.define do
profile {}
end
trait :fake_email do
end
after(:create) do |user|
next unless user.email.include?('my-user@temporary-mail.com')
user.email = user.role + '_' + FFaker::Internet.unique.email(
......@@ -51,6 +47,5 @@ FactoryBot.define do
factory :department_manager, traits: [:department_manager, :with_department]
factory :department_manager_without_department, traits: [:department_manager]
factory :user_volunteer, traits: [:volunteer]
factory :user_fake_email, traits: [:fake_email]
end
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment