lib/decidim/conferences/test/factories.rb in decidim-conferences-0.20.1 vs lib/decidim/conferences/test/factories.rb in decidim-conferences-0.21.0
- old
+ new
@@ -21,10 +21,11 @@
location { Faker::Lorem.sentence(3) }
organization
show_statistics { true }
start_date { 1.month.ago }
end_date { 1.month.ago + 3.days }
+ registration_terms { generate_localized_title }
trait :promoted do
promoted { true }
end
@@ -90,9 +91,24 @@
after(:create) do |user, evaluator|
create :conference_user_role,
user: user,
conference: evaluator.conference,
role: :collaborator
+ end
+ end
+
+ factory :conference_valuator, parent: :user, class: "Decidim::User" do
+ transient do
+ conference { create(:conference) }
+ end
+
+ organization { conference.organization }
+
+ after(:create) do |user, evaluator|
+ create :conference_user_role,
+ user: user,
+ conference: evaluator.conference,
+ role: :valuator
end
end
factory :conference_speaker, class: "Decidim::ConferenceSpeaker" do
conference { create(:conference) }