Skip to content

Commit

Permalink
Merge pull request #2251 from DFE-Digital/subject-restricted-content
Browse files Browse the repository at this point in the history
Add age and subject restriction content
  • Loading branch information
thomasleese authored Jun 13, 2024
2 parents 11a9367 + c423b5e commit bd71d0e
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 13 deletions.
42 changes: 38 additions & 4 deletions app/views/shared/_teaching_qualification_information.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,41 @@
<% if region.teaching_qualification_information.present? %>
<%= raw GovukMarkdown.render(region.teaching_qualification_information) %>
<% country = region.country %>
<% region_information = region.teaching_qualification_information %>
<% country_information = country.teaching_qualification_information %>

<% if region_information.present? || country_information.present? %>
<h2 class="govuk-heading-m">Qualification criteria for <%= CountryName.from_country(country, with_definite_article: true) %></h2>

<% if region_information.present? %>
<%= raw GovukMarkdown.render(region_information) %>
<% end %>

<% if country_information.present? %>
<%= raw GovukMarkdown.render(country_information) %>
<% end %>
<% end %>

<% if region.country.teaching_qualification_information.present? %>
<%= raw GovukMarkdown.render(region.country.teaching_qualification_information) %>
<% if country.subject_limited %>
<h2 class="govuk-heading-m">Age and subject restrictions</h2>

<p class="govuk-body">
We only accept applications from teachers from <%= CountryName.from_country(country, with_definite_article: true) %> who are qualified to teach children aged 11-16 in one or more of the following specific subjects:
</p>

<p class="govuk-body">
Maths, Science, Biology, Chemistry, Physics, French, German, Italian, Japanese, Latin, Mandarin, Russian, Spanish.
</p>

<p class="govuk-body">
We do not accept related subjects, for example economics instead of maths, agricultural science instead of biology or engineering instead of physics.
</p>

<p class="govuk-body">Qualified means:</p>

<ul class="govuk-list govuk-list--bullet">
<li>Your teaching qualification specifically states that you can teach one of the subjects listed above, for example, the subject is in the title of your teaching qualification</li>
<li>Your teaching qualification certificate shows at least 25% of your teaching qualification was in one of the listed subjects</li>
<li>Your bachelor’s degree certificate shows at least 50% of your degree was in one of the listed subjects</li>
</ul>

<p class="govuk-body">We accept any of the above as evidence you are qualified to teach a specific subject.</p>
<% end %>
47 changes: 38 additions & 9 deletions spec/system/teacher_interface/qualifications_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
require "rails_helper"

RSpec.describe "Teacher qualifications", type: :system do
before do
given_i_am_authorized_as_a_user(teacher)
given_an_application_form_exists
end
before { given_i_am_authorized_as_a_user(teacher) }

it "records qualifications" do
given_an_application_form_exists
given_malware_scanning_is_enabled

when_i_visit_the(:teacher_application_page)
Expand All @@ -17,6 +15,7 @@

when_i_click_the_qualifications_task
then_i_see_the(:teacher_new_qualification_page)
and_i_dont_see_the_age_subject_restrictions

when_i_fill_in_the_qualification_information
then_i_see_the(:teacher_upload_document_page)
Expand Down Expand Up @@ -45,6 +44,7 @@
end

it "deletes qualifications" do
given_an_application_form_exists
given_malware_scanning_is_disabled
given_some_qualifications_exist

Expand All @@ -64,6 +64,19 @@
and_i_see_two_qualifications
end

it "subject restricted countries" do
given_the_country_is_subject_limited
given_an_application_form_exists

when_i_visit_the(:teacher_application_page)
then_i_see_the(:teacher_application_page)
and_i_see_the_qualifications_task

when_i_click_the_qualifications_task
then_i_see_the(:teacher_new_qualification_page)
and_i_see_the_age_subject_restrictions
end

private

def given_an_application_form_exists
Expand All @@ -80,6 +93,10 @@ def given_some_qualifications_exist
ApplicationFormSectionStatusUpdater.call(application_form:)
end

def given_the_country_is_subject_limited
@country = create(:country, :subject_limited)
end

def and_i_see_the_qualifications_task
expect(teacher_application_page.qualifications_task_item).to_not be_nil
end
Expand All @@ -88,6 +105,18 @@ def when_i_click_the_qualifications_task
teacher_application_page.qualifications_task_item.click
end

def and_i_see_the_age_subject_restrictions
expect(teacher_new_qualification_page).to have_content(
"Age and subject restrictions",
)
end

def and_i_dont_see_the_age_subject_restrictions
expect(teacher_new_qualification_page).to_not have_content(
"Age and subject restrictions",
)
end

def when_i_fill_in_the_qualification_information
teacher_new_qualification_page.form.title_field.fill_in with: "BSc Teaching"
teacher_new_qualification_page.form.institution_name_field.fill_in with:
Expand Down Expand Up @@ -207,12 +236,12 @@ def teacher
@teacher ||= create(:teacher)
end

def country
@country ||= create(:country, code: "FR")
end

def application_form
@application_form ||=
create(
:application_form,
region: create(:region, :in_country, country_code: "FR"),
teacher:,
)
create(:application_form, region: create(:region, country:), teacher:)
end
end

0 comments on commit bd71d0e

Please sign in to comment.