From 44ac746f50bc18af83f1aa4f6d54c813d9727cb3 Mon Sep 17 00:00:00 2001 From: fumimowdan Date: Tue, 19 Sep 2023 15:55:13 +0100 Subject: [PATCH] Updated HO csv Header: "ID", application.urn "Full Name", application.full_name "DOB", applicant.date_of_birth "Gender", "Nationality", applicant.nationality "Place of Birth", "Passport Number", applicant.passport_number "Address", "Postcode", "Email", "Telephone", "Reference", --- .rubocop.yml | 1 + app/models/reports/home_office.rb | 16 +++++++++++++--- spec/models/reports/home_office_spec.rb | 16 +++++++++++++--- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 9e23adcb..ca15931c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -75,6 +75,7 @@ RSpec/ExampleLength: Max: 10 Exclude: - 'spec/features/*' + - 'spec/models/reports/home_office_spec.rb' RSpec/NoExpectationExample: Exclude: diff --git a/app/models/reports/home_office.rb b/app/models/reports/home_office.rb index e54f2db8..8a581657 100644 --- a/app/models/reports/home_office.rb +++ b/app/models/reports/home_office.rb @@ -25,10 +25,15 @@ def rows application.urn, application.applicant.full_name, application.applicant.date_of_birth, + nil, application.applicant.nationality, + nil, application.applicant.passport_number, nil, nil, + nil, + nil, + nil, ] end end @@ -49,13 +54,18 @@ def applications def header [ - "URN", + "ID", "Full Name", "DOB", + "Gender", "Nationality", + "Place of Birth", "Passport Number", - "Visa Type", - "Date of UK entry", + "Address", + "Postcode", + "Email", + "Telephone", + "Reference", ] end end diff --git a/spec/models/reports/home_office_spec.rb b/spec/models/reports/home_office_spec.rb index 88405791..01475058 100644 --- a/spec/models/reports/home_office_spec.rb +++ b/spec/models/reports/home_office_spec.rb @@ -55,22 +55,32 @@ module Reports application.urn, application.applicant.full_name, application.applicant.date_of_birth, + nil, application.applicant.nationality, + nil, application.applicant.passport_number, nil, nil, + nil, + nil, + nil, ].join(",")) end it "returns the header in CSV format" do expected_header = [ - "URN", + "ID", "Full Name", "DOB", + "Gender", "Nationality", + "Place of Birth", "Passport Number", - "Visa Type", - "Date of UK entry", + "Address", + "Postcode", + "Email", + "Telephone", + "Reference", ].join(",") expect(report.csv).to include(expected_header)