Skip to content

Commit a1ed9d2

Browse files
committed
Add "Has Welsh translation" to form data CSV download
We hadn't added this flag to the CSV download when the added the report for this feature.
1 parent a6cf5cb commit a1ed9d2

2 files changed

Lines changed: 23 additions & 13 deletions

File tree

app/services/reports/forms_csv_report_service.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class Reports::FormsCsvReportService
2929
"Submission formats",
3030
"Daily submissions CSV enabled",
3131
"Weekly submissions CSV enabled",
32+
"Has Welsh translation",
3233
"Copy of answers enabled",
3334
].freeze
3435

@@ -80,6 +81,7 @@ def form_row(form)
8081
form["content"]["submission_format"]&.sort&.join(" "),
8182
form["content"]["send_daily_submission_batch"],
8283
form["content"]["send_weekly_submission_batch"],
84+
Reports::FormDocumentsService.has_welsh_translation(form),
8385
Reports::FormDocumentsService.copy_of_answers_enabled?(form),
8486
]
8587
end

spec/services/reports/forms_csv_report_service_spec.rb

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,30 @@
1818
"organisation_id" => organisation_id,
1919
"group_name" => group_name,
2020
"group_external_id" => group_external_id,
21+
"welsh_completed" => form.welsh_completed,
2122
})
2223
end
2324
end
2425
let(:form) do
25-
create(:form, :live, :with_support, submission_type: "email", submission_format: %w[csv json],
26-
payment_url: "https://www.gov.uk/payments/organisation/service", send_daily_submission_batch: true,
27-
send_weekly_submission_batch: true, pages: [
28-
create(:page, :with_address_settings, is_repeatable: true),
29-
create(:page, :with_date_settings),
30-
create(:page, answer_type: "email"),
31-
create(:page, :with_full_name_settings),
32-
create(:page, answer_type: "national_insurance_number"),
33-
create(:page, answer_type: "number"),
34-
create(:page, answer_type: "phone_number"),
35-
create(:page, :with_selection_settings, is_optional: true),
36-
create(:page, :with_single_line_text_settings, is_repeatable: true),
37-
])
26+
create(:form, :live,
27+
:with_support,
28+
:with_welsh_translation,
29+
submission_type: "email",
30+
submission_format: %w[csv json],
31+
payment_url: "https://www.gov.uk/payments/organisation/service",
32+
send_daily_submission_batch: true,
33+
send_weekly_submission_batch: true,
34+
pages: [
35+
create(:page, :with_address_settings, is_repeatable: true),
36+
create(:page, :with_date_settings),
37+
create(:page, answer_type: "email"),
38+
create(:page, :with_full_name_settings),
39+
create(:page, answer_type: "national_insurance_number"),
40+
create(:page, answer_type: "number"),
41+
create(:page, answer_type: "phone_number"),
42+
create(:page, :with_selection_settings, is_optional: true),
43+
create(:page, :with_single_line_text_settings, is_repeatable: true),
44+
])
3845
end
3946
let(:forms) { [form, create(:form, :live)] }
4047

@@ -76,6 +83,7 @@
7683
"csv json",
7784
"true",
7885
"true",
86+
"true",
7987
"false",
8088
)
8189
end

0 commit comments

Comments
 (0)