Skip to content

Commit

Permalink
Merge pull request #2888 from DFE-Digital/CAPT-1689/irp/application-r…
Browse files Browse the repository at this point in the history
…oute-ineligible

CAPT 1689/irp/application route ineligible
  • Loading branch information
rjlynch authored Jun 20, 2024
2 parents 49b7dcc + 0630b80 commit 15e87b3
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ class SlugSequence
]

RESULTS_SLUGS = [
"check-your-answers"
"check-your-answers",
"ineligible"
].freeze

SLUGS = ELIGIBILITY_SLUGS + RESULTS_SLUGS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,24 @@ def initialize(answers:)
end

def status
return :ineligible if ineligible?

:eligible_now
end

def ineligible?
false
ineligible_reason.present?
end

private

def ineligible_reason
case answers.attributes.symbolize_keys
in application_route: "other"
"application route other not accecpted"
else
nil
end
end
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<h1 class="govuk-heading-l">
We’re sorry, but you are not currently eligible
for the international relocation payment
</h1>
</div>
</div>

<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<p class="govuk-body">
<%= govuk_link_to(
"Check full eligibility details for teachers.",
"https://getintoteaching.education.gov.uk/non-uk-teachers/get-an-international-relocation-payment/#criteria-for-teachers",
target: "_blank"
) %>
</p>

<p class="govuk-body">
<%= govuk_link_to(
"Check full eligibility details for trainees.",
"https://getintoteaching.education.gov.uk/non-uk-teachers/get-an-international-relocation-payment/#criteria-for-trainee-teachers",
target: "_blank"
) %>
</p>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
require "rails_helper"

describe "ineligible route: completing the form" do
include GetATeacherRelocationPayment::StepHelpers

before do
create(:journey_configuration, :get_a_teacher_relocation_payment)
end

describe "navigating forward" do
context "ineligible application route" do
it "shows the ineligible page" do
when_i_start_the_form
and_i_complete_application_route_question_with(option: "Other")
then_i_see_the_ineligible_page
end
end
end

def then_i_see_the_ineligible_page
expect(page).to have_content(
"We’re sorry, but you are not currently eligible for the international relocation payment"
)
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
require "rails_helper"

describe Policies::InternationalRelocationPayments::PolicyEligibilityChecker do
let(:answers) do
build(
:get_a_teacher_relocation_payment_answers,
application_route: application_route
)
end

let(:checker) { described_class.new(answers: answers) }

describe "#status" do
subject { checker.status }

context "when the application route is 'other'" do
let(:application_route) { "other" }

it { is_expected.to eq(:ineligible) }
end

context "when the application route is 'teacher'" do
let(:application_route) { "teacher" }

it { is_expected.to eq(:eligible_now) }
end

context "when the application route is 'salaried_trainee'" do
let(:application_route) { "salaried_trainee" }

it { is_expected.to eq(:eligible_now) }
end
end

describe "#ineligible?" do
subject { checker.ineligible? }

context "when the application route is 'other'" do
let(:application_route) { "other" }

it { is_expected.to eq(true) }
end

context "when the application route is 'teacher'" do
let(:application_route) { "teacher" }

it { is_expected.to eq(false) }
end

context "when the application route is 'salaried_trainee'" do
let(:application_route) { "salaried_trainee" }

it { is_expected.to eq(false) }
end
end
end

0 comments on commit 15e87b3

Please sign in to comment.