-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2947 from DFE-Digital/fe-ineligible-lack-teaching
[LUPEYALPHA-615] FE journey handle ineligible as lack teaching
- Loading branch information
Showing
8 changed files
with
86 additions
and
7 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
app/forms/journeys/further_education_payments/ineligible_form.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Journeys | ||
module FurtherEducationPayments | ||
class IneligibleForm < Form | ||
def journey_eligibility_checker | ||
@journey_eligibility_checker ||= EligibilityChecker.new(journey_session:) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
app/models/journeys/further_education_payments/eligibility_checker.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
module Journeys | ||
module FurtherEducationPayments | ||
class EligibilityChecker < Journeys::EligibilityChecker | ||
def ineligible? | ||
false | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...ews/further_education_payments/claims/_ineligible_lack_teaching_responsibilities.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<h1 class="govuk-heading-l"> | ||
You are not eligible | ||
</h1> | ||
|
||
<p class="govuk-body"> | ||
In order to claim a levelling up premium payment, you must be employed as a member of staff with teaching responsibilities. | ||
</p> | ||
|
||
<p class="govuk-body"> | ||
For more information, check the eligibility criteria for <%= govuk_link_to "levelling up premium payments for early career further education teachers", "https://www.gov.uk/guidance/levelling-up-premium-payments-for-fe-teachers", new_tab: true %>. | ||
</p> | ||
|
||
<p class="govuk-body"> | ||
The information entered is not stored. If you are unsure your information is correct, <%= govuk_link_to "start again", claim_path(current_journey_routing_name, "claim") %>. | ||
</p> | ||
</div> | ||
</div> |
2 changes: 1 addition & 1 deletion
2
app/views/further_education_payments/claims/ineligible.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
FE ineligible goes here | ||
<%= render "ineligible_#{@form.journey_eligibility_checker.ineligibility_reason}" %> |
22 changes: 22 additions & 0 deletions
22
spec/features/further_education_payments/ineligible_paths_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
require "rails_helper" | ||
|
||
RSpec.feature "Further education payments ineligible paths" do | ||
scenario "when no teaching responsibilities" do | ||
when_further_education_payments_journey_configuration_exists | ||
|
||
visit landing_page_path(Journeys::FurtherEducationPayments::ROUTING_NAME) | ||
expect(page).to have_link("Start now") | ||
click_link "Start now" | ||
|
||
expect(page).to have_content("Are you a member of staff with teaching responsibilities?") | ||
choose "No" | ||
click_button "Continue" | ||
|
||
expect(page).to have_content("You are not eligible") | ||
expect(page).to have_content("you must be employed as a member of staff with teaching responsibilities") | ||
end | ||
|
||
def when_further_education_payments_journey_configuration_exists | ||
create(:journey_configuration, :further_education_payments) | ||
end | ||
end |
23 changes: 23 additions & 0 deletions
23
spec/models/policies/further_education_payments/policy_eligibility_checker_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
require "rails_helper" | ||
|
||
describe Policies::FurtherEducationPayments::PolicyEligibilityChecker do | ||
let(:answers) do | ||
build(:further_education_payments_answers) | ||
end | ||
|
||
subject { described_class.new(answers: answers) } | ||
|
||
describe "#status, #ineligible?, #ineligibility_reason" do | ||
context "when ineligible as lacking teaching responsibility" do | ||
let(:answers) do | ||
build(:further_education_payments_answers, teaching_responsibilities: false) | ||
end | ||
|
||
it "is ineligble as :lack_teaching_responsibilities" do | ||
expect(subject).to be_ineligible | ||
expect(subject.status).to eql(:ineligible) | ||
expect(subject.ineligibility_reason).to eql(:lack_teaching_responsibilities) | ||
end | ||
end | ||
end | ||
end |