Skip to content
This repository
branch: master

Merge pull request #835 from alphagov/fix_uncaught_pension_errors

Don't throw an uncaught error for unparseable responses
latest commit 63e6d5a092
Aaron Keogh Shotclog authored April 24, 2014
Octocat-spinner-32 app Call notify_airbrake from controller error method April 04, 2014
Octocat-spinner-32 config Merge pull request #806 from alphagov/add_airbrake_gem_for_errbit April 03, 2014
Octocat-spinner-32 db Initial blank rails app. October 27, 2011
Octocat-spinner-32 doc Initial blank rails app. October 27, 2011
Octocat-spinner-32 lib Merge pull request #835 from alphagov/fix_uncaught_pension_errors April 24, 2014
Octocat-spinner-32 log Initial blank rails app. October 27, 2011
Octocat-spinner-32 public Remove dangling symlinks August 13, 2012
Octocat-spinner-32 script Initial blank rails app. October 27, 2011
Octocat-spinner-32 test Merge pull request #832 from alphagov/register_birth_abroad_update April 23, 2014
Octocat-spinner-32 vendor Initial blank rails app. October 27, 2011
Octocat-spinner-32 .gitignore Don't track coverage directory June 29, 2012
Octocat-spinner-32 .ruby-version Bump ruby patch version for security fixes November 25, 2013
Octocat-spinner-32 CONTRIBUTING.md Define contributing guide November 29, 2013
Octocat-spinner-32 Gemfile Adding @alext's rack_strip_client_ip gem to stop smart-answers blowin… April 14, 2014
Octocat-spinner-32 Gemfile.lock Adding @alext's rack_strip_client_ip gem to stop smart-answers blowin… April 14, 2014
Octocat-spinner-32 LICENSE.md Add an MIT license file September 18, 2013
Octocat-spinner-32 README.md Remove reference to `govuk_setenv`. April 08, 2013
Octocat-spinner-32 Rakefile Disable logging in test July 10, 2012
Octocat-spinner-32 config.ru Initial blank rails app. October 27, 2011
Octocat-spinner-32 jenkins.sh Set appropriate env variables January 14, 2013
Octocat-spinner-32 jenkins_branches.sh Add jenkins_branches.sh April 02, 2014
Octocat-spinner-32 startup.sh Add a handy script to start up the app in development. February 02, 2012
Octocat-spinner-32 tempfile [Placeholder] Update State Pension content and bug fix March 04, 2014
README.md

Smart Answers

Toolkit for building smart answers. Have a look at test/unit/flow_test.rb for example usage.

Flows are stored in lib/flows/*.rb. Corresponding text is in lib/flows/locales/*.yml.

Testing

Run unit tests by executing the following:

bundle exec rake

Issues/todos

The way that values are presented is badly factored. Values need to be formatted for presentation in two places:

  1. when displaying a collapsed question;
  2. when interpolating values into question text.

Values can come from two places:

  1. directly from a response (save_input_as);
  2. via a calculation.

To correctly present a multiple-choice response value, you need to know the question where it was posed. Other question types may also determine formatting/presentation rules on a per-question basis so it makes sense that it's determined at that point.

However, at present we don't remember which question gave rise to a saved input, so this formatting is impossible.

There are two (duplicated) implementations of formatting response labels:

  1. the node presenters, e.g. DateQuestionPresenter#response_label
  2. NodePresenter#value_for_interpolation

This is duplication and should be refactored out.

For now I don't think we ever need to interpolate in the responses of multiple choice questions, so I think we can avoid this issue by:

  1. determining formatting from the type of the value
  2. adding a money type

The AgeRelatedAllowanceChooser has been created to return the age-related personal allowance to assist with the calculation of married couple's allowance. However, the reduction of allowances that takes place in MarriedCoupleAllowanceCalculator applies to other tax calculations, as your personal allowance depends on both your age and income. So the AgeRelatedAllowanceChooser could be changed to a PersonalAllowanceCalculator and extended such that it takes all those factors into account and can be used across the system to calculate someone's personal allowance depending on their age, income, and if required, other factors:

[http://www.hmrc.gov.uk/incometax/personal-allow.htm]

Something went wrong with that request. Please try again.