Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated HO csv #262

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading