Submit social housing lettings and sales data (CORE)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

16 lines
466 B

FactoryBot.define do
factory :section, class: "Form::Section" do
id { "section_id" }
initialize_with { new(id, nil, nil) }
trait :with_questions do
transient do
question_ids { nil }
questions { nil }
end
after :build do |section, evaluator|
section.subsections = [build(:subsection, :with_questions, question_ids: evaluator.question_ids, questions: evaluator.questions, section:)]
end
end
end
end