Skip to content

Commit

Permalink
Updated HO csv
Browse files Browse the repository at this point in the history
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",
  • Loading branch information
fumimowdan committed Sep 20, 2023
1 parent 041b761 commit 44ac746
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ RSpec/ExampleLength:
Max: 10
Exclude:
- 'spec/features/*'
- 'spec/models/reports/home_office_spec.rb'

RSpec/NoExpectationExample:
Exclude:
Expand Down
16 changes: 13 additions & 3 deletions app/models/reports/home_office.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
16 changes: 13 additions & 3 deletions spec/models/reports/home_office_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 44ac746

Please sign in to comment.