-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Assign house_number and address_lines consistently (#281)
* Assign house_number and address_lines consistently https://eaflood.atlassian.net/browse/WC-500 Addresses created in the renewals journey can display as having a duplicate house number when they are used by waste-carriers-frontend, for example: 123 123 Waste Street Wastetown AB1 2CD This is because the renewals engine assigns the values of address_lines in a different way. For consistency's sake, we should change this to match how waste-carriers-frontend does it. * Update spec to match desired result The first `line` should be assigned to `house_number` and all subsequent lines should be assigned to `address_lines`. * Rewrite assign_address_lines to pass spec Rather than trying to work out which lines we want ourselves, we just use the `lines` values from the data sent by os-places-address-lookup. We also get `house_number` from the lines instead of the `buildingNumber` value. This should give us a result which is consistent with the frontend. * Rename method to assign_house_number_and_address_lines This is more accurate about what it's now doing. * Include house_number in displayable_address This is no longer included in `address_line_1` so we need to add it separately. * Create displayable_address in ApplicationHelper We display addresses multiple times, so it's more efficient to have a shared helper method to deal with this. * Use displayable_address from ApplicationHelper in check your answers page Now that we have a shared method, we can replace the logic specific to the check your answers form object and view. * Use displayable_address from ApplicationHelper in mailer We can now remove the duplicated logic from the mailer and update the template to use the new method.
- Loading branch information
1 parent
2b43f49
commit 3565d4e
Showing
8 changed files
with
78 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters