Skip to content

Commit

Permalink
Merge pull request #2555 from DFE-Digital/AQTS-729-ineligibility-cont…
Browse files Browse the repository at this point in the history
…ent-change

AQTS 729 ineligibility content changes
  • Loading branch information
syed87 authored Dec 13, 2024
2 parents 12514a8 + d3edfd2 commit 6be4165
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/views/eligibility_interface/result/ineligible.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<% content_for :page_title, "You’re not eligible" %>
<% content_for :back_link_url, ineligible_country ? eligibility_interface_countries_path : eligibility_interface_misconduct_path %>
<% current_date = Date.current %>

<h1 class="govuk-heading-xl">
You’re not eligible to apply for qualified teacher status (QTS) in England
Expand Down Expand Up @@ -45,7 +46,11 @@

<% if @eligibility_check.ineligible_reasons.include?(:work_experience) %>
<p class="govuk-body">
If you’re a citizen of Iceland, Norway, or Lichtenstein you can gain more teaching experience during an adaptation period.
<% if current_date <= Date.new(2024, 12, 31) %>
If you’re a citizen of Iceland, Norway, or Liechtenstein you can gain more teaching experience during an adaptation period.
<% else %>
If you’re a citizen of Iceland, Liechtenstein, Norway, or Switzerland you can gain more teaching experience during an adaptation period.
<% end %>
</p>
<% end %>
<% end %>
Expand Down
56 changes: 56 additions & 0 deletions spec/views/eligibility_interface/result/ineligible_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# frozen_string_literal: true

require "rails_helper"
require "active_support/testing/time_helpers"

RSpec.describe "eligibility_interface/result/ineligible.html.erb",
type: :view do
include ActiveSupport::Testing::TimeHelpers
subject { render }

let(:region) { create(:region) }
let(:eligibility_check) { create(:eligibility_check) }

before { assign(:eligibility_check, eligibility_check) }

it do
expect(subject).to match(
"You’re not eligible to apply for qualified teacher status",
)
end

context "when work experience is under 9 months" do
let(:eligibility_check) do
create(:eligibility_check, region:, work_experience: "under_9_months")
end

it do
expect(subject).to match(
"To apply for QTS, you’ll need at least 9 months of teaching work " \
"experience. This can be gained in any country but must be from after you qualified as a teacher.",
)
end

context "when the date is before 2025" do
it do
travel_to Date.new(2024, 12, 30) do
expect(subject).to match(
"If you’re a citizen of Iceland, Norway, or Liechtenstein you can gain " \
"more teaching experience during an adaptation period.",
)
end
end
end

context "when the date is 2025 or later" do
it do
travel_to Date.new(2025, 1, 1) do
expect(subject).to match(
"If you’re a citizen of Iceland, Liechtenstein, Norway, or Switzerland " \
"you can gain more teaching experience during an adaptation period.",
)
end
end
end
end
end

0 comments on commit 6be4165

Please sign in to comment.