Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

Allow users to select a child benefit stop date in years up to 2013 #140

Merged
merged 2 commits into from
Jun 15, 2016
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
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ Calculators
This is an application to contain custom-built calculators. These will initially replace some smart-answers that have
outgrown the framework.

## Child benefit tax calculator
Currently the only calculator in this application is the Child benefit tax calculator.

This calculator reports how much child benefit tax you are entitled during a tax year.

There is a cut-off date of 7 January 2013. This is the date [High Income Child Benefit Tax Charge](https://www.gov.uk/child-benefit-tax-charge/overview) came in effect.
This means that if the 2012 tax year is selected the calculator will only calculate the child benefit you are entitled to from 7 Jan 2013 to 5 Apr 2013, not for the entire tax year.


## Running the app

```
Expand Down
2 changes: 1 addition & 1 deletion app/views/child_benefit_tax/_starting_child.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
<% end %>
<%= select_date (child ? child.end_date : nil), :prefix => "starting_children[#{index}][stop]",
:prompt => {:day => "Day", :month => "Month", :year => "Year" }, :order => [:day, :month, :year],
:start_year => 2.years.ago(Date.today).year, :end_year => 10.years.since(Date.today).year %>
:start_year => 3.years.ago(Date.today).year, :end_year => 10.years.since(Date.today).year %>
</div>
9 changes: 9 additions & 0 deletions spec/features/child_benefit_tax_calculator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@
)
end

it "should allow stop date to be three years in the past" do
Timecop.freeze('2014-04-04')
visit "/child-benefit-tax-calculator"
click_on "Start now"

expected_year_list = ("2011".."2024").to_a
expect(page).to have_select("starting_children_0_stop_year", options: expected_year_list.unshift("Year"))
end

it "should show error if no children are present in the selected tax year" do
Timecop.travel "2014-09-01"
visit "/child-benefit-tax-calculator"
Expand Down