From 87f71d31ea4acf3955cf083c033ecd2b9feb4269 Mon Sep 17 00:00:00 2001 From: Thomas Leese Date: Tue, 16 Apr 2024 08:35:36 +0100 Subject: [PATCH] Ensure draft applications are filled out This changes how the fake data is generated to ensure that it's pre-populated as this is more useful than having an empty form. If we want to generate an empty form we can go via the eligibility checkers. --- .../fake_data/application_form_generator.rb | 50 +++++++++---------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/app/lib/fake_data/application_form_generator.rb b/app/lib/fake_data/application_form_generator.rb index 93e844cfb7..1259b1fbe4 100644 --- a/app/lib/fake_data/application_form_generator.rb +++ b/app/lib/fake_data/application_form_generator.rb @@ -95,35 +95,31 @@ def call delegate :assessment, to: :application_form def create_application_form - traits = [] - - if params.submit? - traits += %i[ - with_personal_information - with_degree_qualification - with_identification_document - with_age_range - with_subjects - ] - - traits << %i[ - with_english_language_medium_of_instruction - with_english_language_provider - with_english_language_exemption_by_citizenship - with_english_language_exemption_by_qualification - ].sample - - unless region.application_form_skip_work_history - traits << :with_work_history - end + traits = %i[ + with_personal_information + with_degree_qualification + with_identification_document + with_age_range + with_subjects + ] + + traits << %i[ + with_english_language_medium_of_instruction + with_english_language_provider + with_english_language_exemption_by_citizenship + with_english_language_exemption_by_qualification + ].sample + + unless region.application_form_skip_work_history + traits << :with_work_history + end - if region.status_check_written? || region.sanction_check_written? - traits << :with_written_statement - end + if region.status_check_written? || region.sanction_check_written? + traits << :with_written_statement + end - if region.status_check_online? || region.sanction_check_online? - traits << :with_registration_number - end + if region.status_check_online? || region.sanction_check_online? + traits << :with_registration_number end @application_form =