From 4f5efa23ac27d132c3cd815bf31e21a302c41cb2 Mon Sep 17 00:00:00 2001 From: James Mead Date: Tue, 6 May 2025 15:09:25 +0100 Subject: [PATCH] Add invite spec example to diagnose flakey example The example just before this one keeps failing in the CircleCI build, but I haven't been able to replicate it locally. It's hard to work out what's going on, because `SchoolTeacher::Invite#call` swallows any exception. I'm hoping that this new assertion _might_ fail for the same reason, but then display the exception message to give us more clues. --- spec/concepts/school_teacher/invite_spec.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/concepts/school_teacher/invite_spec.rb b/spec/concepts/school_teacher/invite_spec.rb index 6cb579110..43439010b 100644 --- a/spec/concepts/school_teacher/invite_spec.rb +++ b/spec/concepts/school_teacher/invite_spec.rb @@ -16,6 +16,11 @@ expect(response.success?).to be(true) end + it 'does not return an error in operation response' do + response = described_class.call(school:, school_teacher_params:, token:) + expect(response[:error]).to be_blank + end + it 'creates a TeacherInvitation' do expect { described_class.call(school:, school_teacher_params:, token:) }.to change(TeacherInvitation, :count) end