Skip to content

Commit

Permalink
Update regression test responses, expected results & artefacts
Browse files Browse the repository at this point in the history
For scenarios in which the husband's income is less than the income limit, the
user is taken direct to the `husband_done` outcome. Since the income limit has
just been fixed, it has increased from £27,000 to £27,700. Therefore for the
scenarios in which the husband's income response is £27,001, the user will now
be taken to that outcome; whereas for those in which the husband's income is
£27,701, the user will continue to be taken to the subsequent questions.

The changes in the artefacts can be best explained by looking at an ASCII tree
of the files & directories before and after the changes in this commit:

$ tree test/artefacts/calculate-married-couples-allowance/yes/yes/1950-01-01
test/artefacts/calculate-married-couples-allowance/yes/yes/1950-01-01
├── 20000.txt
├── 27001.0
│   ├── no
│   │   └── 0.txt
│   ├── yes
│   │   ├── 10000.0
│   │   │   ├── 5000.0
│   │   │   │   └── 0.txt
│   │   │   └── 5000.html
│   │   └── 10000.html
│   └── yes.html
├── 27001.html
├── 27701.0
│   ├── no
│   │   └── 0.txt
│   └── yes
│       └── 10000.0
│           └── 5000.0
│               └── 0.txt
└── 50000.0
    ├── no
    │   └── 0.txt
    └── yes
        └── 10000.0
            └── 5000.0
                └── 0.txt

$ tree test/artefacts/calculate-married-couples-allowance/yes/yes/1950-01-01
test/artefacts/calculate-married-couples-allowance/yes/yes/1950-01-01
├── 20000.txt
├── 27001.txt
├── 27701.0
│   ├── no
│   │   └── 0.txt
│   ├── yes
│   │   ├── 10000.0
│   │   │   ├── 5000.0
│   │   │   │   └── 0.txt
│   │   │   └── 5000.html
│   │   └── 10000.html
│   └── yes.html
├── 27701.html
└── 50000.0
    ├── no
    │   └── 0.txt
    └── yes
        └── 10000.0
            └── 5000.0
                └── 0.txt

* The £20,000 & £50,000 scenarios stay the same - the former goes straight to an
  outcome and the latter goes to the subsequent questions.
* The £27,001 scenarios collapse down to a single node, because it now goes
  straight to an outcome.
* The £27,701 scenarios basically stay the same, although we now capture the
  "Are you paying into a pension?" question page in this scenario and so it is
  now named "27701.html" vs "27001.html".

Something very similar happesn for the highest earner scenarios:

$ tree test/artefacts/calculate-married-couples-allowance/yes/no
test/artefacts/calculate-married-couples-allowance/yes/no
├── 1955-01-01
│   ├── 20000.txt
│   ├── 27001.0
│   │   ├── no
│   │   │   └── 0.txt
│   │   └── yes
│   │       └── 10000.0
│   │           └── 5000.0
│   │               └── 0.txt
│   ├── 27701.0
│   │   ├── no
│   │   │   └── 0.txt
│   │   └── yes
│   │       └── 10000.0
│   │           └── 5000.0
│   │               └── 0.txt
│   └── 55000.0
│       ├── no
│       │   └── 0.txt
│       └── yes
│           └── 10000.0
│               └── 5000.0
│                   └── 0.txt
└── 1955-01-01.html

$ tree test/artefacts/calculate-married-couples-allowance/yes/no
test/artefacts/calculate-married-couples-allowance/yes/no
├── 1955-01-01
│   ├── 20000.txt
│   ├── 27001.txt
│   ├── 27701.0
│   │   ├── no
│   │   │   └── 0.txt
│   │   └── yes
│   │       └── 10000.0
│   │           └── 5000.0
│   │               └── 0.txt
│   └── 55000.0
│       ├── no
│       │   └── 0.txt
│       └── yes
│           └── 10000.0
│               └── 5000.0
│                   └── 0.txt
└── 1955-01-01.html

All the regression tests are passing at this point, so I've also updated the
checksums.
  • Loading branch information
floehopper committed May 17, 2016
1 parent fa9716c commit b225746
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 180 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h1>
</header>

<div class="step current">
<form action="/calculate-married-couples-allowance/y/yes/yes/1950-01-01/27001.0/yes" accept-charset="UTF-8" method="get"><input name="utf8" type="hidden" value="&#x2713;" />
<form action="/calculate-married-couples-allowance/y/yes/yes/1950-01-01/27701.0/yes" accept-charset="UTF-8" method="get"><input name="utf8" type="hidden" value="&#x2713;" />
<div class="current-question" id="current-question">
<div class="question">
<h2>
Expand Down Expand Up @@ -111,10 +111,10 @@ <h3 class="previous-answers-title">
<tr class="section">
<td class="previous-question-title">What's the husband's yearly income?</td>
<td class="previous-question-body">
£27,001</td>
£27,701</td>

<td class="link-right">
<a href="/calculate-married-couples-allowance/y/yes/yes/1950-01-01?previous_response=27001.0">
<a href="/calculate-married-couples-allowance/y/yes/yes/1950-01-01?previous_response=27701.0">
Change<span class="visuallyhidden"> answer to "What's the husband's yearly income?"</span>
</a> </td>
</tr>
Expand All @@ -125,7 +125,7 @@ <h3 class="previous-answers-title">
Yes</td>

<td class="link-right">
<a href="/calculate-married-couples-allowance/y/yes/yes/1950-01-01/27001.0?previous_response=yes">
<a href="/calculate-married-couples-allowance/y/yes/yes/1950-01-01/27701.0?previous_response=yes">
Change<span class="visuallyhidden"> answer to "Are you paying into a pension?"</span>
</a> </td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h1>
</header>

<div class="step current">
<form action="/calculate-married-couples-allowance/y/yes/yes/1950-01-01/27001.0/yes/10000.0/5000.0" accept-charset="UTF-8" method="get"><input name="utf8" type="hidden" value="&#x2713;" />
<form action="/calculate-married-couples-allowance/y/yes/yes/1950-01-01/27701.0/yes/10000.0/5000.0" accept-charset="UTF-8" method="get"><input name="utf8" type="hidden" value="&#x2713;" />
<div class="current-question" id="current-question">
<div class="question">
<h2>
Expand Down Expand Up @@ -101,10 +101,10 @@ <h3 class="previous-answers-title">
<tr class="section">
<td class="previous-question-title">What's the husband's yearly income?</td>
<td class="previous-question-body">
£27,001</td>
£27,701</td>

<td class="link-right">
<a href="/calculate-married-couples-allowance/y/yes/yes/1950-01-01?previous_response=27001.0">
<a href="/calculate-married-couples-allowance/y/yes/yes/1950-01-01?previous_response=27701.0">
Change<span class="visuallyhidden"> answer to "What's the husband's yearly income?"</span>
</a> </td>
</tr>
Expand All @@ -115,7 +115,7 @@ <h3 class="previous-answers-title">
Yes</td>

<td class="link-right">
<a href="/calculate-married-couples-allowance/y/yes/yes/1950-01-01/27001.0?previous_response=yes">
<a href="/calculate-married-couples-allowance/y/yes/yes/1950-01-01/27701.0?previous_response=yes">
Change<span class="visuallyhidden"> answer to "Are you paying into a pension?"</span>
</a> </td>
</tr>
Expand All @@ -126,7 +126,7 @@ <h3 class="previous-answers-title">
£10,000</td>

<td class="link-right">
<a href="/calculate-married-couples-allowance/y/yes/yes/1950-01-01/27001.0/yes?previous_response=10000.0">
<a href="/calculate-married-couples-allowance/y/yes/yes/1950-01-01/27701.0/yes?previous_response=10000.0">
Change<span class="visuallyhidden"> answer to "How much do you expect to pay into a pension where your contributions are made before tax is taken away?"</span>
</a> </td>
</tr>
Expand All @@ -137,7 +137,7 @@ <h3 class="previous-answers-title">
£5,000</td>

<td class="link-right">
<a href="/calculate-married-couples-allowance/y/yes/yes/1950-01-01/27001.0/yes/10000.0?previous_response=5000.0">
<a href="/calculate-married-couples-allowance/y/yes/yes/1950-01-01/27701.0/yes/10000.0?previous_response=5000.0">
Change<span class="visuallyhidden"> answer to "How much do you expect to pay into a pension this tax year where your pension provider claims tax relief for you?"</span>
</a> </td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h1>
</header>

<div class="step current">
<form action="/calculate-married-couples-allowance/y/yes/yes/1950-01-01/27001.0/yes/10000.0" accept-charset="UTF-8" method="get"><input name="utf8" type="hidden" value="&#x2713;" />
<form action="/calculate-married-couples-allowance/y/yes/yes/1950-01-01/27701.0/yes/10000.0" accept-charset="UTF-8" method="get"><input name="utf8" type="hidden" value="&#x2713;" />
<div class="current-question" id="current-question">
<div class="question">
<h2>
Expand Down Expand Up @@ -101,10 +101,10 @@ <h3 class="previous-answers-title">
<tr class="section">
<td class="previous-question-title">What's the husband's yearly income?</td>
<td class="previous-question-body">
£27,001</td>
£27,701</td>

<td class="link-right">
<a href="/calculate-married-couples-allowance/y/yes/yes/1950-01-01?previous_response=27001.0">
<a href="/calculate-married-couples-allowance/y/yes/yes/1950-01-01?previous_response=27701.0">
Change<span class="visuallyhidden"> answer to "What's the husband's yearly income?"</span>
</a> </td>
</tr>
Expand All @@ -115,7 +115,7 @@ <h3 class="previous-answers-title">
Yes</td>

<td class="link-right">
<a href="/calculate-married-couples-allowance/y/yes/yes/1950-01-01/27001.0?previous_response=yes">
<a href="/calculate-married-couples-allowance/y/yes/yes/1950-01-01/27701.0?previous_response=yes">
Change<span class="visuallyhidden"> answer to "Are you paying into a pension?"</span>
</a> </td>
</tr>
Expand All @@ -126,7 +126,7 @@ <h3 class="previous-answers-title">
£10,000</td>

<td class="link-right">
<a href="/calculate-married-couples-allowance/y/yes/yes/1950-01-01/27001.0/yes?previous_response=10000.0">
<a href="/calculate-married-couples-allowance/y/yes/yes/1950-01-01/27701.0/yes?previous_response=10000.0">
Change<span class="visuallyhidden"> answer to "How much do you expect to pay into a pension where your contributions are made before tax is taken away?"</span>
</a> </td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h1>
</header>

<div class="step current">
<form action="/calculate-married-couples-allowance/y/yes/yes/1950-01-01/27001.0" accept-charset="UTF-8" method="get"><input name="utf8" type="hidden" value="&#x2713;" />
<form action="/calculate-married-couples-allowance/y/yes/yes/1950-01-01/27701.0" accept-charset="UTF-8" method="get"><input name="utf8" type="hidden" value="&#x2713;" />
<div class="current-question" id="current-question">
<div class="question">
<h2>
Expand Down Expand Up @@ -113,10 +113,10 @@ <h3 class="previous-answers-title">
<tr class="section">
<td class="previous-question-title">What's the husband's yearly income?</td>
<td class="previous-question-body">
£27,001</td>
£27,701</td>

<td class="link-right">
<a href="/calculate-married-couples-allowance/y/yes/yes/1950-01-01?previous_response=27001.0">
<a href="/calculate-married-couples-allowance/y/yes/yes/1950-01-01?previous_response=27701.0">
Change<span class="visuallyhidden"> answer to "What's the husband's yearly income?"</span>
</a> </td>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions test/data/calculate-married-couples-allowance-files.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
lib/smart_answer_flows/calculate-married-couples-allowance.rb: cfddc8e729b2888a926ac002ef2765df
lib/smart_answer_flows/calculate-married-couples-allowance.rb: 0e8cb9e8ca5389f1ee254330c7916f10
test/data/calculate-married-couples-allowance-questions-and-responses.yml: a4fbc29b4ad07121fd45b416b1841686
test/data/calculate-married-couples-allowance-responses-and-expected-results.yml: 72a68bfeebf6938bc0539052ac1a4a09
test/data/calculate-married-couples-allowance-responses-and-expected-results.yml: 2a0ecc5fcbbdffc2b0b082d3f634345b
lib/smart_answer_flows/calculate-married-couples-allowance/calculate_married_couples_allowance.govspeak.erb: 2a107c5f5eccf492a1bbb055fb87ee2c
lib/smart_answer_flows/calculate-married-couples-allowance/outcomes/_done_body.govspeak.erb: cb025369e07d6cdbedbfe7d54df39eee
lib/smart_answer_flows/calculate-married-couples-allowance/outcomes/_done_next_steps.govspeak.erb: bd570369ab0b5cf668541917daa5ef9b
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,67 +31,6 @@
- 'yes'
- '1950-01-01'
- '27001'
:next_node: :paying_into_a_pension?
:outcome_node: false
- :current_node: :paying_into_a_pension?
:responses:
- 'yes'
- 'yes'
- '1950-01-01'
- '27001.0'
- 'yes'
:next_node: :how_much_expected_contributions_before_tax?
:outcome_node: false
- :current_node: :how_much_expected_contributions_before_tax?
:responses:
- 'yes'
- 'yes'
- '1950-01-01'
- '27001.0'
- 'yes'
- '10000'
:next_node: :how_much_expected_contributions_with_tax_relief?
:outcome_node: false
- :current_node: :how_much_expected_contributions_with_tax_relief?
:responses:
- 'yes'
- 'yes'
- '1950-01-01'
- '27001.0'
- 'yes'
- '10000.0'
- '5000'
:next_node: :how_much_expected_gift_aided_donations?
:outcome_node: false
- :current_node: :how_much_expected_gift_aided_donations?
:responses:
- 'yes'
- 'yes'
- '1950-01-01'
- '27001.0'
- 'yes'
- '10000.0'
- '5000.0'
- '0'
:next_node: :husband_done
:outcome_node: true
- :current_node: :paying_into_a_pension?
:responses:
- 'yes'
- 'yes'
- '1950-01-01'
- '27001.0'
- 'no'
:next_node: :how_much_expected_gift_aided_donations?
:outcome_node: false
- :current_node: :how_much_expected_gift_aided_donations?
:responses:
- 'yes'
- 'yes'
- '1950-01-01'
- '27001.0'
- 'no'
- '0'
:next_node: :husband_done
:outcome_node: true
- :current_node: :whats_the_husbands_income?
Expand Down Expand Up @@ -259,67 +198,6 @@
- 'no'
- '1955-01-01'
- '27001'
:next_node: :paying_into_a_pension?
:outcome_node: false
- :current_node: :paying_into_a_pension?
:responses:
- 'yes'
- 'no'
- '1955-01-01'
- '27001.0'
- 'yes'
:next_node: :how_much_expected_contributions_before_tax?
:outcome_node: false
- :current_node: :how_much_expected_contributions_before_tax?
:responses:
- 'yes'
- 'no'
- '1955-01-01'
- '27001.0'
- 'yes'
- '10000'
:next_node: :how_much_expected_contributions_with_tax_relief?
:outcome_node: false
- :current_node: :how_much_expected_contributions_with_tax_relief?
:responses:
- 'yes'
- 'no'
- '1955-01-01'
- '27001.0'
- 'yes'
- '10000.0'
- '5000'
:next_node: :how_much_expected_gift_aided_donations?
:outcome_node: false
- :current_node: :how_much_expected_gift_aided_donations?
:responses:
- 'yes'
- 'no'
- '1955-01-01'
- '27001.0'
- 'yes'
- '10000.0'
- '5000.0'
- '0'
:next_node: :highest_earner_done
:outcome_node: true
- :current_node: :paying_into_a_pension?
:responses:
- 'yes'
- 'no'
- '1955-01-01'
- '27001.0'
- 'no'
:next_node: :how_much_expected_gift_aided_donations?
:outcome_node: false
- :current_node: :how_much_expected_gift_aided_donations?
:responses:
- 'yes'
- 'no'
- '1955-01-01'
- '27001.0'
- 'no'
- '0'
:next_node: :highest_earner_done
:outcome_node: true
- :current_node: :whats_the_highest_earners_income?
Expand Down

0 comments on commit b225746

Please sign in to comment.