Skip to content

Commit

Permalink
Adding GOV.UK One Login ID and identityVerified boolean to TRN reques…
Browse files Browse the repository at this point in the history
…t params
  • Loading branch information
Hassanmir92 committed Nov 22, 2024
1 parent fa0c8e5 commit 5404ce0
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/lib/trs/trn_request_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def call
lastName: application_form.family_name,
birthDate: application_form.date_of_birth.iso8601,
emailAddress: teacher.email,
identityVerified: true,
oneLoginUserSubject: teacher.gov_one_id,
address: {
},
genderCode: "NotAvailable",
Expand Down
48 changes: 48 additions & 0 deletions spec/lib/trs/trn_request_params_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
firstName: "Given",
genderCode: "NotAvailable",
inductionRequired: true,
identityVerified: true,
oneLoginUserSubject: nil,
initialTeacherTraining: {
ageRangeFrom: 7,
ageRangeTo: 11,
Expand Down Expand Up @@ -84,5 +86,51 @@
},
)
end

context "when the teacher has a GOV.UK One Login ID" do
let(:teacher) do
create(:teacher, email: "[email protected]", gov_one_id: "12345678")
end

it do
expect(subject).to eq(
{
address: {
},
birthDate: "1960-01-01",
emailAddress: "[email protected]",
firstName: "Given",
genderCode: "NotAvailable",
inductionRequired: true,
identityVerified: true,
oneLoginUserSubject: "12345678",
initialTeacherTraining: {
ageRangeFrom: 7,
ageRangeTo: 11,
programmeStartDate: "1990-01-01",
programmeEndDate: "1995-01-01",
providerUkprn: nil,
subject1: "100425",
subject2: "100321",
subject3: nil,
trainingCountryCode: "FR",
},
lastName: "Family",
middleName: nil,
qtsDate: "2024-01-07",
qualification: {
class: "NotKnown",
countryCode: "FR",
date: "1996-01-01",
heQualificationType: "Unknown",
providerUkprn: nil,
},
recognitionRoute: "OverseasTrainedTeachers",
teacherType: "OverseasQualifiedTeacher",
underNewOverseasRegulations: true,
},
)
end
end
end
end

0 comments on commit 5404ce0

Please sign in to comment.