diff --git a/app/lib/qualifications_api/teacher.rb b/app/lib/qualifications_api/teacher.rb index bfc9907b..ea7b339e 100644 --- a/app/lib/qualifications_api/teacher.rb +++ b/app/lib/qualifications_api/teacher.rb @@ -89,11 +89,11 @@ def induction_status end def passed_induction? - api_data.induction&.status_description == "Pass" + api_data.induction&.status == "Pass" || api_data.induction_status&.status == "Pass" end def exempt_from_induction? - api_data.induction&.status == "Exempt" + api_data.induction&.status == "Exempt" || api_data.induction_status&.status == "Exempt" end def no_induction? diff --git a/spec/components/check_records/teacher_profile_summary_component_spec.rb b/spec/components/check_records/teacher_profile_summary_component_spec.rb index 1bd6a862..20d14e18 100644 --- a/spec/components/check_records/teacher_profile_summary_component_spec.rb +++ b/spec/components/check_records/teacher_profile_summary_component_spec.rb @@ -26,13 +26,13 @@ end context "when teacher has passed induction" do - let(:teacher) { QualificationsApi::Teacher.new({ 'induction' => { 'status_description' => 'Pass' }}) } + let(:teacher) { QualificationsApi::Teacher.new({ 'induction' => { 'status' => 'Pass' }}) } it { is_expected.to have_text("Passed induction") } end context "when teacher has failed induction" do - let(:teacher) { QualificationsApi::Teacher.new({ 'induction' => { 'status_description' => 'Fail' }}) } + let(:teacher) { QualificationsApi::Teacher.new({ 'induction' => { 'status' => 'Fail' }}) } it { is_expected.not_to have_text("Passed induction") } end diff --git a/spec/lib/qualifications_api/teacher_spec.rb b/spec/lib/qualifications_api/teacher_spec.rb index 01f24b65..e98c6db7 100644 --- a/spec/lib/qualifications_api/teacher_spec.rb +++ b/spec/lib/qualifications_api/teacher_spec.rb @@ -350,7 +350,7 @@ let(:teacher) { described_class.new(api_data) } context "induction status is 'Pass'" do - let(:api_data) { { "induction" => { "status_description" => "Pass", } } } + let(:api_data) { { "induction" => { "status" => "Pass", } } } it "returns true" do expect(teacher.passed_induction?).to eq true