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

Update National Minimum Wage for past values when over 25 #2439

Merged
merged 11 commits into from
Apr 6, 2016
5 changes: 4 additions & 1 deletion lib/data/minimum_wage_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@
:max_age: 21
:rate: 5.30
- :min_age: 21
:max_age: 1000
:max_age: 24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MarriageAbroadCalculator#per_hour_minimum_wage method uses @age < r[:max_age] which means this rate isn't picked up for people aged 24. I've created PR #2441 to fix this problem.

:rate: 6.70
- :min_age: 25
:max_age: 1000
:rate: 7.20
:apprentice_rate: 3.30
:accommodation_rate: 5.35
6 changes: 1 addition & 5 deletions lib/smart_answer/calculators/minimum_wage_calculator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,7 @@ def minimum_hourly_rate
if @is_apprentice
@minimum_wage_data[:apprentice_rate]
else
if eligible_for_living_wage?
national_living_wage_rate
else
per_hour_minimum_wage
end
per_hour_minimum_wage
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/unit/calculators/minimum_wage_calculator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class MinimumWageCalculatorTest < ActiveSupport::TestCase
end
context "when eligible for living wage?" do
should "return the national living wage rate" do
@calculator = MinimumWageCalculator.new(age: 25)
@calculator = MinimumWageCalculator.new(age: 25, date: Date.parse('2016-04-02'))
assert_equal 7.2, @calculator.minimum_hourly_rate
end
end
Expand Down