Skip to content

Commit

Permalink
Adjust induction check to work on the find API
Browse files Browse the repository at this point in the history
  • Loading branch information
richardpattinson committed Oct 25, 2024
1 parent 21776c9 commit 6be5829
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/lib/qualifications_api/teacher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/qualifications_api/teacher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6be5829

Please sign in to comment.