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

State pension calculator amends #2192

Merged
merged 54 commits into from
Feb 4, 2016
Merged

Conversation

erkde
Copy link
Contributor

@erkde erkde commented Dec 15, 2015

PT story: https://www.pivotaltracker.com/story/show/108748030

DWP are launching their own State Pension calculator.

This PR removes the 'estimate State Pension amount' option and associated logic. The start page is amended to reflect the reduced functionality of the updated flow and many of the questions and outcomes are removed.

Fact check

https://pt-108748030.herokuapp.com/state-pension-age

Expected changes

  • URL on gov.uk
    • The start page title shows 'Check your State Pension age'
    • Removes sections "If you're under 55" and "If you're over 55"

Before

screen shot 2015-12-15 at 08 12 35

After

screen shot 2016-02-04 at 2 50 46 pm

  • URL on gov.uk
    • First question no longer has option "Amount - estimate of your basic State Pension amount"

Before

screen shot 2015-12-15 at 08 20 49

After

screen shot 2016-02-04 at 2 51 29 pm

@floehopper
Copy link
Contributor

As far as I can see there is no explanation as to why this functionality has been removed in the commit notes, the PR description or the Pivotal Tracker story.

@erkde erkde force-pushed the state_pension_calculator_amends branch 9 times, most recently from f889546 to b81a2ab Compare January 24, 2016 17:19
@erkde
Copy link
Contributor Author

erkde commented Jan 24, 2016

Have just rebased this with master

@erkde erkde force-pushed the state_pension_calculator_amends branch from b81a2ab to 349273b Compare January 26, 2016 20:19
@erkde
Copy link
Contributor Author

erkde commented Jan 26, 2016

Have just rebased this with master

@erkde
Copy link
Contributor Author

erkde commented Jan 27, 2016

Changed this to don't merge until we have a known release date

@floehopper
Copy link
Contributor

Minor: There are quite a few commits with exactly the same first line which makes it tricky to work out which one is which. I'd be inclined to include some kind of differentiation in these first lines (e.g. method name) to make things clearer.

@floehopper
Copy link
Contributor

I think it would be useful to include a "before" and "after" visualisation of the flow in the PR description.

@erkde erkde force-pushed the state_pension_calculator_amends branch 2 times, most recently from dfb4d72 to dcd690f Compare February 3, 2016 17:56
@floehopper
Copy link
Contributor

In this line, the lac of capitalisation of "pension credit" seems to be inconsistent with other copy. However, it looks as if this was the case before this PR anyway.

@floehopper
Copy link
Contributor

The code in StatePensionAgeCalculator which uses FriendlyTimeDiff should eventually be moved out of the calculator and into view helper methods. However, this change is probably out-of-scope for this PR.

@floehopper
Copy link
Contributor

I've now finished reviewing this PR. The majority of my comments were about better ways to structure the commits . If time is pressing, I don't think there is anything preventing this PR from being merged. However, if there is time, it would be much better to address as many of the comments as possible before merging.

@erkde erkde force-pushed the state_pension_calculator_amends branch from dcd690f to 71e9d1a Compare February 4, 2016 12:27
@floehopper
Copy link
Contributor

With the caveats mentioned in my most recent comment, I'm going to remove the "Don't merge" label and add the "LGTM" label.

@floehopper floehopper self-assigned this Feb 4, 2016
@erkde erkde force-pushed the state_pension_calculator_amends branch from 71e9d1a to 779d7eb Compare February 4, 2016 13:46
erkde added 24 commits February 4, 2016 14:24
As both the bus pass and state pension age calculations need the user’s date of birth, this change moves the dob_age node to Q2 and shares the response for both calculations.

The duplicate bus_pass_age question is no longer needed, and the test data updated with the new ordering with dob_age now in position Q2 for both calculations.
Rename bus_pass_age_result outcome to bus_pass_result to be inline with logic doc. Inline the partial content, and remove the link to calculate state pension age.
The state_pension_age_calculator can be used for calculating the stage_pension_age, and the bus pass age. As the bus pass age defaults to :female for gender, this gender param to the new method can be optional.

With gender an optional param, changing gender from a read to a read/write accessor allows its’ value to be set in subsequent questions.
The gender is now settable via an attr_accessor so no longer needs to be passed as an argument to the pension_credit_date method.
StatePensionDateQuery was used both within the calculator and the smart answer DSL, creating a dependency in two places. As the calculator already has an existing call into StatePensionDateQuery, this change allows smart answer to do away with it’s dependency and simply call the methods on the calculator.
Rather than hardcode a period of 30 days, or 4 months, to determine how close the user is to the state_pension_date, add an optional argument that defaults to 0 days, so that the smart answer or outcome template can query how close a user is to the state pension date.
Updates the query method from ‘find’ to ‘state_pension_date’ to better describe the type of result expected back.

Adds tests around the complete set of stage pension age, pension credit age data, and bus pass qualification age data at unit level.
Removes unused methods in the state pension age calculator which were a carry over from calculating the state pension amount, and introduces new methods for showing the state pension age and bus pass age outcomes.

With the StatePensionDateQuery class now having test coverage for the pension age data, it removes the tests duplicating testing this data and adds tests around the functionality of the calculator, including edge conditions that flip boolean results of a method call.
Rename outcomes to be inline with updated logic doc, and replace three state pension age outcomes with two, one for before reaching state pension and another for when you reached.

Tidy up integration tests to cover all paths through the smart answer flow, and remove those tests that test data - such as when you reach a state pension, which are now covered at unit level
Add capitalisation and the word qualifying to ‘pension credit age’, inline with other occurrences in the smart answer
With uncertainty around the date of the new DWP state pension calculator going live, change this URL to point to the existing state pension age and handle with a redirect once launched
Replace comma with ‘and’ inline with other occurrences in the smart answer
@erkde erkde force-pushed the state_pension_calculator_amends branch from 779d7eb to d40a4e4 Compare February 4, 2016 14:24
@erkde
Copy link
Contributor Author

erkde commented Feb 4, 2016

Have just rebased with master

@floehopper
Copy link
Contributor

The 5 new commits look good to me.

erkde pushed a commit that referenced this pull request Feb 4, 2016
@erkde erkde merged commit c5c71dc into master Feb 4, 2016
@erkde erkde deleted the state_pension_calculator_amends branch February 4, 2016 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants