-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We have expanded the sanctions list to also display a description alongside the title. This data isn't provided by the API so we opted to define it the same way we do with the titles. The descriptions contain links and we want them to be clickable so using markdown made sense here. The library is already being used elsewhere in the app, so there is no extra dependency required. Also, we control the markdown text itself, so there is no security risk by rendering this using the `html_safe` method. The use of `CHOMP` on the heredoc is to ensure we avoid the trailing newline character that a heredoc automatically adds.
- Loading branch information
1 parent
f42da44
commit 0ab63bc
Showing
6 changed files
with
248 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,39 +7,226 @@ def initialize(api_data) | |
end | ||
|
||
SANCTIONS = { | ||
"A13" => { title: "Suspension order - with conditions" }, | ||
"A14" => { title: "Suspension order - with conditions" }, | ||
"A18" => { title: "Conditional registration order - conviction of a relevant offence" }, | ||
"A19" => { title: "Suspension order" }, | ||
"A1A" => { title: "Prohibition by the General Teaching Council England (GTCE)" }, | ||
"A1B" => { title: "Prohibition by the General Teaching Council England (GTCE)" }, | ||
"A2" => { title: "Suspension order" }, | ||
"A20" => { title: "Suspension order - with conditions" }, | ||
"A21A" => { title: "Prohibition by the General Teaching Council England (GTCE)" }, | ||
"A21B" => { title: "Prohibition by the General Teaching Council England (GTCE)" }, | ||
"A23" => { title: "Suspension order" }, | ||
"A24" => { title: "Suspension order - with conditions" }, | ||
"A25A" => { title: "Prohibition by the General Teaching Council England (GTCE)" }, | ||
"A25B" => { title: "Prohibition by the General Teaching Council England (GTCE)" }, | ||
"A3" => { title: "Conditional registration order - unacceptable professional conduct" }, | ||
"A5A" => { title: "Prohibition by the General Teaching Council England (GTCE)" }, | ||
"A5B" => { title: "Prohibition by the General Teaching Council England (GTCE)" }, | ||
"A6" => { title: "Suspension order" }, | ||
"A7" => { title: "Conditional registration order - serious professional incompetence" }, | ||
"B3" => { title: "Prohibition by the Secretary of State or an Independent Schools Tribunal" }, | ||
"C1" => { title: "Prohibition by the Secretary of State" }, | ||
"C2" => { title: "Failed induction" }, | ||
"C3" => { title: "Restriction by the Secretary of State" }, | ||
"G1" => { title: "Record found" }, | ||
"T1" => { title: "Prohibition by the Secretary of State" }, | ||
"T2" => { title: "Interim prohibition by the Secretary of State" }, | ||
"T3" => { title: "Prohibition by the Secretary of State - deregistered by GTC Scotland" }, | ||
"T4" => { title: "Prohibition by the Secretary of State - refer to the Education Workforce Council, Wales" }, | ||
"T5" => { title: "Prohibition by the Secretary of State - refer to GTC Northern Ireland" }, | ||
"T6" => { title: "Secretary of State decision - no prohibition" }, | ||
"T7" => { title: "Section 128 barring direction" } | ||
"A13" => { | ||
title: "Suspension order with conditions", | ||
description: <<~DESCRIPTION.chomp | ||
Suspended by the General Teaching Council for England. | ||
Must meet conditions to teach in a maintained school, pupil referral unit or non-maintained special school in England. | ||
Call the Teaching Regulation Agency (TRA) on 0207 593 5393 to check the conditions. | ||
DESCRIPTION | ||
}, | ||
"A14" => { | ||
title: "Suspension order with conditions", | ||
description: <<~DESCRIPTION.chomp | ||
Suspended by the General Teaching Council for England. | ||
Must meet conditions to teach in a maintained school, pupil referral unit or non-maintained special school in England. | ||
Call the Teaching Regulation Agency (TRA) on 0207 593 5393 to check the conditions. | ||
DESCRIPTION | ||
}, | ||
"A18" => { | ||
title: "Registration order with conditions", | ||
description: <<~DESCRIPTION.chomp | ||
Given a registration order by the General Teaching Council for England. | ||
Must meet conditions to teach in a maintained school, pupil referral unit or non-maintained special school in England. | ||
Call the Teaching Regulation Agency (TRA) on 0207 593 5393 to check the conditions. | ||
DESCRIPTION | ||
}, | ||
"A1A" => { | ||
title: "Prohibition order", | ||
description: <<~DESCRIPTION.chomp | ||
Prevented from teaching by the General Teaching Council for England because of unacceptable professional conduct. | ||
Cannot teach in a maintained school, pupil referral unit or non-maintained special school in England. | ||
Call the Teaching Regulation Agency (TRA) on 0207 593 5393 for more information. | ||
DESCRIPTION | ||
}, | ||
"A1B" => { | ||
title: "Prohibition order", | ||
description: <<~DESCRIPTION.chomp | ||
Prevented from teaching by the General Teaching Council for England because of unacceptable professional conduct. | ||
Cannot teach in a maintained school, pupil referral unit or non-maintained special school in England. | ||
Call the Teaching Regulation Agency (TRA) on 0207 593 5393 for more information. | ||
DESCRIPTION | ||
}, | ||
"A20" => { | ||
title: "Suspension order with conditions", | ||
description: <<~DESCRIPTION.chomp | ||
Suspended by the General Teaching Council for England. | ||
Must meet conditions to teach in a maintained school, pupil referral unit or non-maintained special school in England. | ||
Call the Teaching Regulation Agency (TRA) on 0207 593 5393 to check the conditions. | ||
DESCRIPTION | ||
}, | ||
"A21A" => { | ||
title: "Prohibition order", | ||
description: <<~DESCRIPTION.chomp | ||
Prevented from teaching by the General Teaching Council for England because of a criminal offence which is relevant to fitness to teach. | ||
Cannot teach in a maintained school, pupil referral unit or non-maintained special school in England. | ||
Call the Teaching Regulation Agency (TRA) on 0207 593 5393 for more information. | ||
DESCRIPTION | ||
}, | ||
"A21B" => { | ||
title: "Prohibition order", | ||
description: <<~DESCRIPTION.chomp | ||
Prevented from teaching by the General Teaching Council for England because of a criminal offence which is relevant to their fitness to teach. | ||
Cannot teach in a maintained school, pupil referral unit or non-maintained special school in England. | ||
Call the Teaching Regulation Agency (TRA) on 0207 593 5393 for more information. | ||
DESCRIPTION | ||
}, | ||
"A3" => { | ||
title: "Registration order with conditions", | ||
description: <<~DESCRIPTION.chomp | ||
Given a registration order by the General Teaching Council. | ||
Must meet conditions to teach in a maintained school, pupil referral unit or non-maintained special school in England. | ||
Call the Teaching Regulation Agency (TRA) on 0207 593 5393 to check the conditions. | ||
DESCRIPTION | ||
}, | ||
"A5A" => { | ||
title: "Prohibition order", | ||
description: <<~DESCRIPTION.chomp | ||
Prevented from teaching by the General Teaching Council for England because of serious professional incompetence. | ||
Cannot teach in a maintained school, pupil referral unit or non-maintained special school in England. | ||
Call the Teaching Regulation Agency (TRA) on 0207 593 5393 for more information. | ||
DESCRIPTION | ||
}, | ||
"A5B" => { | ||
title: "Prohibition order", | ||
description: <<~DESCRIPTION.chomp | ||
Prevented from teaching by the General Teaching Council for England because of serious professional incompetence. | ||
Cannot teach in a maintained school, pupil referral unit or non-maintained special school in England. | ||
Call the Teaching Regulation Agency (TRA) on 0207 593 5393 for more information. | ||
DESCRIPTION | ||
}, | ||
"A7" => { | ||
title: "Registration order with conditions", | ||
description: <<~DESCRIPTION.chomp | ||
Given a registration order by the General Teaching Council for England. | ||
Must meet conditions to teach in maintained schools, pupil referral units and non-maintained special schools in England. | ||
Call the Teaching Regulation Agency (TRA) on 0207 593 5393 to check the conditions. | ||
DESCRIPTION | ||
}, | ||
"B3" => { | ||
title: "Prohibition order", | ||
description: <<~DESCRIPTION.chomp | ||
Prevented from teaching by the Secretary of State or an independent schools tribunal. | ||
Cannot teach in any school in England, including sixth-form colleges, relevant youth accommodation and children’s homes. | ||
Call the Teaching Regulation Agency (TRA) on 0207 593 5393 for more information. | ||
DESCRIPTION | ||
}, | ||
"C1" => { | ||
title: "Prohibition order", | ||
description: <<~DESCRIPTION.chomp | ||
Prevented from teaching because they failed probation. | ||
Cannot teach in a maintained school, pupil referral unit or non-maintained special school in England. | ||
Call the Teaching Regulation Agency (TRA) on 0207 593 5393 for more information. | ||
DESCRIPTION | ||
}, | ||
"C2" => { | ||
title: "Prohibition order", | ||
description: <<~DESCRIPTION.chomp | ||
Prevented from teaching because they failed induction. | ||
Cannot teach in a maintained school, pupil referral unit or non-maintained special school in England. | ||
Call the Teaching Regulation Agency (TRA) on 0207 593 5393 for more information. | ||
DESCRIPTION | ||
}, | ||
"C3" => { | ||
title: "Restriction", | ||
description: <<~DESCRIPTION.chomp | ||
Prevented from teaching because they failed probation. | ||
Call the Teaching Regulation Agency (TRA) on 0207 593 5393 for more information. | ||
DESCRIPTION | ||
}, | ||
"G1" => { | ||
title: "Possible match on the children’s barred list", | ||
description: <<~DESCRIPTION.chomp | ||
Email the Disclosure and Barring Service (DBS) at [[email protected]](mailto:[email protected]) to check if this person is allowed to work with children. | ||
DESCRIPTION | ||
}, | ||
"T1" => { | ||
title: "Prohibition order", | ||
description: <<~DESCRIPTION.chomp | ||
Found guilty of of serious misconduct. | ||
Cannot teach in any school in England, including sixth-form colleges, relevant youth accommodation and children’s homes. | ||
Check the [list of published decisions on GOV.UK](https://www.gov.uk/search/all?parent=&keywords=panel+outcome+misconduct&level_one_taxon=&manual=&organisations%5B%5D=teaching-regulation-agency&organisations%5B%5D=national-college-for-teaching-and-leadership&public_timestamp%5Bfrom%5D=&public_timestamp%5Bto%5D=&order=updated-newest) for more details. | ||
DESCRIPTION | ||
}, | ||
"T2" => { | ||
title: "Interim prohibition order", | ||
description: <<~DESCRIPTION.chomp | ||
Prevented from teaching during an investigation for serious misconduct. | ||
Cannot teach in any school in England, including sixth-form colleges, relevant youth accommodation and children’s homes. | ||
Call the Teaching Regulation Agency (TRA) on 0207 593 5393 for more information. | ||
DESCRIPTION | ||
}, | ||
"T3" => { | ||
title: "Prohibition order", | ||
description: <<~DESCRIPTION.chomp | ||
Deregistered by the General Teaching Council for Scotland because of serious misconduct. | ||
Cannot teach in any school, including sixth-form colleges, relevant youth accommodation and children’s homes. | ||
DESCRIPTION | ||
}, | ||
"T4" => { | ||
title: "Prohibition order", | ||
description: <<~DESCRIPTION.chomp | ||
Deregistered by the Education Workforce Council, Wales because of serious misconduct. | ||
Cannot teach in any school, including sixth-form colleges, relevant youth accommodation and children’s homes. | ||
DESCRIPTION | ||
}, | ||
"T5" => { | ||
title: "Prohibition order", | ||
description: <<~DESCRIPTION.chomp | ||
Found guilty of serious misconduct by the General Teaching Council for Northern Ireland. | ||
Cannot teach in any school, including sixth-form colleges, relevant youth accommodation and children’s homes. | ||
DESCRIPTION | ||
}, | ||
"T6" => { | ||
title: "Found guilty by misconduct panel but not prevented from teaching", | ||
description: <<~DESCRIPTION.chomp | ||
Check the [list of published decisions on GOV.UK](https://www.gov.uk/search/all?parent=&keywords=panel+outcome+misconduct&level_one_taxon=&manual=&organisations%5B%5D=teaching-regulation-agency&organisations%5B%5D=national-college-for-teaching-and-leadership&public_timestamp%5Bfrom%5D=&public_timestamp%5Bto%5D=&order=updated-newest) for more details. | ||
DESCRIPTION | ||
} | ||
}.freeze | ||
|
||
def description | ||
SANCTIONS[code][:description] if SANCTIONS[code] | ||
end | ||
|
||
def title | ||
SANCTIONS[code][:title] if SANCTIONS[code] | ||
end | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
subject { sanction.title } | ||
|
||
context 'when type exists in SANCTIONS' do | ||
it { is_expected.to eq('Suspension order - with conditions') } | ||
it { is_expected.to eq('Suspension order with conditions') } | ||
end | ||
|
||
context 'when type does not exist in SANCTIONS' do | ||
|
@@ -25,6 +25,27 @@ | |
end | ||
end | ||
|
||
describe '#description' do | ||
subject(:description) { sanction.description } | ||
|
||
context 'when type exists in SANCTIONS' do | ||
let(:code) { "G1" } | ||
|
||
it "returns the description as markdown" do | ||
expect(description) | ||
.to eq('Email the Disclosure and Barring Service (DBS) at [[email protected]](mailto:[email protected]) ' \ | ||
'to check if this person is allowed to work with children.') | ||
end | ||
end | ||
|
||
context 'when type does not exist in SANCTIONS' do | ||
let(:code) { "Z99" } | ||
|
||
it { is_expected.to be_nil } | ||
end | ||
end | ||
|
||
|
||
describe "start_date" do | ||
subject { sanction.start_date } | ||
|
||
|
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
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