-
-
Notifications
You must be signed in to change notification settings - Fork 483
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
[#1759] Remove transition_aged_youth column from CSV file when importing a case #1774
[#1759] Remove transition_aged_youth column from CSV file when importing a case #1774
Conversation
…ansition_age? method in CasaCase
…m-case-import-csv
@@ -18,13 +18,13 @@ | |||
expect { case_importer.import_cases }.to change(CasaCase, :count).by(3) | |||
|
|||
# correctly imports true/false transition_aged_youth | |||
expect(CasaCase.find_by(case_number: "CINA-01-4347").transition_aged_youth).to be_truthy | |||
expect(CasaCase.find_by(case_number: "CINA-01-4348").transition_aged_youth).to be_falsey | |||
expect(CasaCase.find_by(case_number: "CINA-01-4347").transition_aged_youth).to be_falsey # birth_month_year_youth is nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't expect to have this field anymore, you could remove this expect or change it to be_nil
that corresponds better to the expectation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I generally prefer that we follow https://www.betterspecs.org/ but as long as the linter likes it, I'm ok with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool! :) ✨🙌
What github issue is this PR for, if any?
Resolves #1759
What changed, and why?
When an admin imports Cases from a CSV file, they no longer have to (or can) specify the
transition_aged_youth
column.When importing a case from a CSV file,
transition_aged_youth
is now calculated by checking if the youth is 14 years old or older.The reference
casa_cases.csv
from the imports page has been updated and the column has been removed.How will this affect user permissions?
transition_aged_youth
when importing a case from a CSV file, since it is now calculated automatically.How is this tested? (please write tests!) 💖💪
Since this is a minor change, I only updated the existing tests and fixtures.
In the
casa_cases.csv
fixture I changed thebirth_month_year_youth
of one of the cases from 2014 to 2000, so we could test both values oftransition_aged_youth
.Screenshots please :)
Nothing in the UI was changed, but here is a screenshot of the sample CSV file before and after the change.
Before
After