-
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 #2888 from DFE-Digital/CAPT-1689/irp/application-r…
…oute-ineligible CAPT 1689/irp/application route ineligible
- Loading branch information
Showing
5 changed files
with
125 additions
and
2 deletions.
There are no files selected for viewing
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
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
28 changes: 28 additions & 0 deletions
28
app/views/get_a_teacher_relocation_payment/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 |
---|---|---|
@@ -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> |
25 changes: 25 additions & 0 deletions
25
spec/features/get_a_teacher_relocation_payment/ineligible_route_completing_the_form_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,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 |
56 changes: 56 additions & 0 deletions
56
spec/models/policies/international_relocation_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,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 |