-
Notifications
You must be signed in to change notification settings - Fork 120
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
Conversation
7b76c2e
to
1eaa426
Compare
@@ -161,6 +161,12 @@ class MinimumWageCalculatorTest < ActiveSupport::TestCase | |||
assert !@calculator.eligible_for_living_wage? | |||
end | |||
end | |||
|
|||
should 'return false if age is over 25, and date is before 2016-04-01' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: The narrative here I feel should read thus:
ruby should 'return false if age is over 25, and date is on or before 2016-04-01' do
This is based on line 174 in lib/smart_answer/calculators/minimum_wage_calculator.rb
@pmanrubia Apart from the test narratives here.. This PR LGTM |
PR #2423 included an issue when calculating the minimum wage for past years if the user is over 25. The returned value is £7.20, which is the minimum living wage, and it should be calculated according to the the yaml file. This commit revert the artefacts as a firs step to fix this issue. This way we can start fresh, so any change on the artefacts can be checked against a working version.
This value was introduced as a way to exercise code for outcomes: `current_payment_above.govspeak` and `current_payment_below.govspeak` Unfortunately, as the date is fixed to 2015-01-01, there is no point in creating new paths in the flow, as they would not be adding value.
This integration test was added to cover the scenario when the user is 24 and the current date is > 2016-04-01 Unfortunately, this date was fixed on 2015-01-01, so this scenario is not adding value.
This method is no longer used, so it can be safely removed.
A user is eligible for living wage only when: - Is over 25 years old - The reference date is 2016-04-01
Previous implementation had the value hardcoded to 7.2 This commit uses the `national_hourly_rate` method because they both share the same values in the yaml file. This will be valid until October. So a more robust solution should be put in place. This improvement would be out of the scope of this PR because of a strict deadline.
`minimum_hourly_rate` in the calculator relies on the yaml file to do calculations. The reason is: after 2015-10-01 the national minimum wage and the national living wage share the same values. This could change, though, in October. The yaml file with the rates have been update to calculate the minimum living wage for users over 25. Due to the strict deadline no further refactoring is done.
1eaa426
to
a955989
Compare
Hi @ikennaokpala thanks for your quick review. I have updated with your comments. I have also rebased and pushed in preparation for merging. |
@pmanrubia great use of |
@@ -136,7 +136,10 @@ | |||
:max_age: 21 | |||
:rate: 5.30 | |||
- :min_age: 21 | |||
:max_age: 1000 | |||
:max_age: 24 |
There was a problem hiding this comment.
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.
Trello card: https://trello.com/c/nV9KmLD1/90-fix-issue-national-living-wage-for-past-years-when-over-25
Addresses issue with #2423 as paths related to old years when user is over 25 are not honoring the specification document with the required changes
Factchecks
Expected Changes
Before

### After