Human Essentials is an inventory management system for diaper, incontinence, and period-supply banks. It supports them in distributing to partners, tracking inventory, and reporting stats and analytics.
The partner_settings partial was previously inadvertently deleted from the Partner Profile Edit view because there are no tests asserting for its presence. This PR adds a test for the presence of the partial when a Partner or Bank edits the Partner Profile and the presence of the show partner_settings partial when a Partner views its profile. To test that the correct request types are displaying in the partial, I assert for the presence of an enabled request type and assert for the exclusion of a disabled request type.
Type of change
Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
The tests all pass as expected. I tested each expectation in isolation by making each fail with the following changes:
render_template fails when I remove the code that renders the partial in the show/edit profile views.
expect(response.body).to include(...) fails when I remove the corresponding conditional and HTML from the partial for a request type that is enabled
expect(response.body).not_to include(...) fails when I remove the conditional to ensure the HTML appears in the partial for a request type that is disabled
@norrismei: Your PR Add tests forpartner_settingspartials is part of today's Human Essentials production release: 2024.05.12.
Thank you very much for your contribution!
Resolves #4309
Description
The
partner_settings
partial was previously inadvertently deleted from the Partner Profile Edit view because there are no tests asserting for its presence. This PR adds a test for the presence of the partial when a Partner or Bank edits the Partner Profile and the presence of the showpartner_settings
partial when a Partner views its profile. To test that the correct request types are displaying in the partial, I assert for the presence of an enabled request type and assert for the exclusion of a disabled request type.Type of change
How Has This Been Tested?
The tests all pass as expected. I tested each expectation in isolation by making each fail with the following changes:
render_template
fails when I remove the code that renders the partial in the show/edit profile views.expect(response.body).to include(...)
fails when I remove the corresponding conditional and HTML from the partial for a request type that is enabledexpect(response.body).not_to include(...)
fails when I remove the conditional to ensure the HTML appears in the partial for a request type that is disabled