Skip to content
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

Add EFTA ineligible content #1834

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/lib/country_code.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ def european_economic_area?(code)
Country::CODES_IN_EUROPEAN_ECONOMIC_AREA.include?(code)
end

def european_free_trade_association?(code)
Country::CODES_IN_EUROPEAN_FREE_TRADE_ASSOCIATION.include?(code)
end

LOCATIONS_BY_COUNTRY_CODE =
Country::LOCATION_AUTOCOMPLETE_CANONICAL_LIST
.map { |row| [CountryCode.from_location(row.last), row.last] }
Expand Down
5 changes: 5 additions & 0 deletions app/models/country.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,10 @@ class Country < ApplicationRecord
CODES_IN_EUROPEAN_ECONOMIC_AREA =
YAML.load(File.read("lib/countries-in-european-economic-area.yaml"))

CODES_IN_EUROPEAN_FREE_TRADE_ASSOCIATION =
YAML.load(
File.read("lib/countries-in-european-free-trade-association.yaml"),
)

validates :code, inclusion: { in: CODES }
end
4 changes: 4 additions & 0 deletions app/models/eligibility_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ def england_or_wales?
CountryCode.england?(country_code) || CountryCode.wales?(country_code)
end

def european_free_trade_association?
CountryCode.european_free_trade_association?(country_code)
end

def skip_additional_questions?
country&.eligibility_skip_questions || false
end
Expand Down
10 changes: 10 additions & 0 deletions app/views/eligibility_interface/result/ineligible.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@
</ul>
<% end %>

<% if @eligibility_check.ineligible_reasons.include?(:work_experience) && @eligibility_check.european_free_trade_association? %>
<p class="govuk-body">
To apply for QTS, you’ll need at least 9 months of teaching work experience that was gained after completing your teaching qualification.
</p>

<p class="govuk-body">
The adaptation period for citizens of Iceland, Norway, and Lichtenstein can be used to gain more teaching experience; contact <%= govuk_link_to t("service.email.enquiries"), "mailto:#{t("service.email.enquiries")}" %> for more information.
</p>
<% end %>

<% unless @eligibility_check.ineligible_reasons.include?(:misconduct) || @eligibility_check.england_or_wales? %>
<p class="govuk-body">You can also:</p>

Expand Down
9 changes: 0 additions & 9 deletions lib/countries-eligible-in-february-2023.yaml

This file was deleted.

18 changes: 9 additions & 9 deletions lib/countries-in-european-economic-area.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
- AT
- BE
- BY
- HR
- CH
- CY
- CZ
- DE
- DK
- EE
- ES
- FI
- FR
- DE
- GR
- HR
- HU
- IS
- IE
- IS
- IT
- LV
- LI
- LT
- LU
- LV
- MT
- NL
- NO
- "NO"
- PL
- PT
- RO
- SK
- SI
- ES
- SE
- CH
- SI
- SK
4 changes: 4 additions & 0 deletions lib/countries-in-european-free-trade-association.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- CH
- IS
- LI
- "NO"
8 changes: 8 additions & 0 deletions spec/lib/country_code_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,12 @@

include_examples "true with codes", Country::CODES_IN_EUROPEAN_ECONOMIC_AREA
end

describe "#european_free_trade_association?" do
subject(:european_free_trade_association?) do
described_class.european_free_trade_association?(code)
end

include_examples "true with codes", %w[CH IS NO LI]
end
end
Loading