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

Convert register-a-death to use ERB templates for questions #2147

Merged
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
30 changes: 0 additions & 30 deletions lib/smart_answer_flows/locales/en/register-a-death.yml

This file was deleted.

2 changes: 2 additions & 0 deletions lib/smart_answer_flows/register-a-death.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ def define
status :published
satisfies_need "101006"

use_erb_templates_for_questions

country_name_query = SmartAnswer::Calculators::CountryNameFormatter.new
reg_data_query = SmartAnswer::Calculators::RegistrationsDataQuery.new
translator_query = SmartAnswer::Calculators::TranslatorLinks.new
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<% content_for :title do %>
Did the person die at home, in hospital or elsewhere?
<% end %>

<% options(
"at_home_hospital": "At home or in hospital",
"elsewhere": "Elsewhere"
) %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<% content_for :title do %>
Was the death expected?
<% end %>

<% options(
"yes": "Yes",
"no": "No"
) %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<% content_for :title do %>
Where are you now?
<% end %>

<% options(
"same_country": "In the country where the death happened",
"another_country": "In another country",
"in_the_uk": "In the UK"
) %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<% content_for :title do %>
Where did the death happen?
<% end %>

<% options(
"england_wales": "England or Wales",
"scotland": "Scotland",
"northern_ireland": "Northern Ireland",
"overseas": "Abroad"
) %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<% content_for :title do %>
Which country did the death happen in?
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<% content_for :title do %>
Which country are you in now?
<% end %>
2 changes: 2 additions & 0 deletions test/artefacts/register-a-death/england_wales.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ <h2>




<div class="">

<ul class="options">
Expand All @@ -57,6 +58,7 @@ <h2>




</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ <h2>




<div class="">

<ul class="options inline">
Expand All @@ -57,6 +58,7 @@ <h2>




</div>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions test/artefacts/register-a-death/overseas.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ <h2>




<div class="">

<select name="response" id="response"><option value="afghanistan">Afghanistan</option>
Expand Down Expand Up @@ -269,6 +270,7 @@ <h2>




</div>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions test/artefacts/register-a-death/overseas/libya.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ <h2>




<div class="">

<ul class="options">
Expand All @@ -63,6 +64,7 @@ <h2>




</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ <h2>




<div class="">

<select name="response" id="response"><option value="afghanistan">Afghanistan</option>
Expand Down Expand Up @@ -269,6 +270,7 @@ <h2>




</div>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions test/artefacts/register-a-death/y.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ <h2>




<div class="">

<ul class="options">
Expand Down Expand Up @@ -69,6 +70,7 @@ <h2>




</div>
</div>
</div>
Expand Down
9 changes: 7 additions & 2 deletions test/data/register-a-death-files.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
lib/smart_answer_flows/register-a-death.rb: 378f810da11670f93cadef74954fe302
lib/smart_answer_flows/locales/en/register-a-death.yml: 04de0b215b1ab22ce4a52a82a185f6f1
lib/smart_answer_flows/register-a-death.rb: 5dc3d844027c0d7624d007aca5fb2932
test/data/register-a-death-questions-and-responses.yml: bae21b0a8be1bbaa2dd6febd505382d6
test/data/register-a-death-responses-and-expected-results.yml: a69c595900ab2d85208c0ac92f186ae8
lib/smart_answer_flows/register-a-death/outcomes/_footnote_oru_variants.govspeak.erb: 30e012cdde5aa7f4de5856a5db47a54c
Expand All @@ -9,6 +8,12 @@ lib/smart_answer_flows/register-a-death/outcomes/no_embassy_result.govspeak.erb:
lib/smart_answer_flows/register-a-death/outcomes/north_korea_result.govspeak.erb: d21f96d5816ca222f381a2bca6ced918
lib/smart_answer_flows/register-a-death/outcomes/oru_result.govspeak.erb: 897de72bc4ec3f2570a58d44fa76051f
lib/smart_answer_flows/register-a-death/outcomes/uk_result.govspeak.erb: 662da9367c5992191471f8722b3c2636
lib/smart_answer_flows/register-a-death/questions/did_the_person_die_at_home_hospital.govspeak.erb: 3405db8cb8b24782fc49981c2fce12e7
lib/smart_answer_flows/register-a-death/questions/was_death_expected.govspeak.erb: 132d4a52801b619af05519a69f2767dd
lib/smart_answer_flows/register-a-death/questions/where_are_you_now.govspeak.erb: b11b29b04cec875529be3714b5fba89e
lib/smart_answer_flows/register-a-death/questions/where_did_the_death_happen.govspeak.erb: 65a1c9d38940b468014b59160047f2c0
lib/smart_answer_flows/register-a-death/questions/which_country.govspeak.erb: e816742682e96117df80d67faff13fc8
lib/smart_answer_flows/register-a-death/questions/which_country_are_you_in_now.govspeak.erb: 9c9399d1588c7d5e01ebf1bf5efa31a1
lib/smart_answer_flows/register-a-death/register_a_death.govspeak.erb: 1820ba3a5f3ed47816c7f151217be439
lib/data/rates/births_and_deaths_document_return_fees.yml: 4ac203e9fd076c12f62b57f8d1b64ffc
lib/data/translators.yml: d86f628f0b85e24ffb0dc0ec77401387
Expand Down