Skip to content

Commit

Permalink
Merge pull request #2151 from alphagov/convert-state-pension-topup-to…
Browse files Browse the repository at this point in the history
…-use-erb-templates-for-questions

Convert state-pension-topup to use ERB templates for questions
  • Loading branch information
chrisroos committed Nov 19, 2015
2 parents 6cf1e67 + 0d1a5f8 commit 7037dd2
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 25 deletions.
23 changes: 0 additions & 23 deletions lib/smart_answer_flows/locales/en/state-pension-topup.yml

This file was deleted.

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

use_erb_templates_for_questions

calculator = Calculators::StatePensionTopupCalculator.new

#Q1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<% content_for :title do %>
When will you pay your lump sum?
<% end %>

<% content_for :hint do %>
This must be between 12 October 2015 and 5 April 2017.
<% end %>

<% content_for :error_message do %>
Enter a date between 12 October 2015 and 5 April 2017.
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% content_for :title do %>
What is your date of birth?
<% end %>

<% content_for :error_message do %>
Enter your date of birth.
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<% content_for :title do %>
What is your gender?
<% end %>

<% options(
"male": "Male",
"female": "Female"
) %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<% content_for :title do %>
How much extra State Pension would you like to get per week?
<% end %>

<% content_for :hint do %>
Enter a number between 1 and 25.
<% end %>

<% content_for :error_message do %>
Enter an amount in whole pounds between 1 and 25.
<% end %>
2 changes: 2 additions & 0 deletions test/artefacts/state-pension-topup/1912-10-12.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
2 changes: 2 additions & 0 deletions test/artefacts/state-pension-topup/1912-10-12/male.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ <h2>
<div class="question-body">



<p class="hint">Enter a number between 1 and 25.</p>

<div class="">
Expand All @@ -45,6 +46,7 @@ <h2>




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




<div class="">

<fieldset>
Expand Down Expand Up @@ -229,6 +230,7 @@ <h2>




</div>
</div>
</div>
Expand Down
7 changes: 5 additions & 2 deletions test/data/state-pension-topup-files.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
---
lib/smart_answer_flows/state-pension-topup.rb: 588abd953a7a80e1ead751394e72ab0c
lib/smart_answer_flows/locales/en/state-pension-topup.yml: 723be2cd9151b43de550a4972b36f862
lib/smart_answer_flows/state-pension-topup.rb: add9d1e0c664800bc64755277b6d0670
test/data/state-pension-topup-questions-and-responses.yml: f4f609a6e989f166616a05435c6993aa
test/data/state-pension-topup-responses-and-expected-results.yml: 1207c6118839a3b13810038c57a20d4a
lib/smart_answer_flows/state-pension-topup/outcomes/outcome_pension_age_not_reached.govspeak.erb: 558d49584fe1ece4d36427740d381273
lib/smart_answer_flows/state-pension-topup/outcomes/outcome_topup_calculations.govspeak.erb: 421d026a06ca1c7dcb56e2712189211a
lib/smart_answer_flows/state-pension-topup/questions/date_of_lump_sum_payment.govspeak.erb: bc785eb5fa3ee27edfaf9f223694942b
lib/smart_answer_flows/state-pension-topup/questions/dob_age.govspeak.erb: a98e10bf8b60c21f65d307a56046f4d3
lib/smart_answer_flows/state-pension-topup/questions/gender.govspeak.erb: f388163b3d7abb9c78bfe8265b2f2856
lib/smart_answer_flows/state-pension-topup/questions/how_much_extra_per_week.govspeak.erb: fcbf62d8db40dde727445b1742e7b958
lib/smart_answer_flows/state-pension-topup/state_pension_topup.govspeak.erb: 519a1c6174840e90d2ce509aff91d7be
lib/smart_answer/calculators/state_pension_topup_calculator.rb: f03d5ababde67182513daf834b85a1db
lib/smart_answer/calculators/state_pension_topup_data_query.rb: d18c0d8df71ac858809f11a0b5fb0e63
Expand Down

0 comments on commit 7037dd2

Please sign in to comment.