Skip to content

Remove validation and old tests#678

Open
jamiebenstead wants to merge 4 commits intomainfrom
1155-remove-validation-on-creating-students-and-inviting-teachers
Open

Remove validation and old tests#678
jamiebenstead wants to merge 4 commits intomainfrom
1155-remove-validation-on-creating-students-and-inviting-teachers

Conversation

@jamiebenstead
Copy link
Contributor

Status

What's changed?

  • Removed the school is verified validation on creating students
  • Removed the school is verified validation on inviting teachers
  • Removed related tests

Copilot AI review requested due to automatic review settings February 12, 2026 11:21
@cla-bot cla-bot bot added the cla-signed label Feb 12, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the “school must be verified” validation from the school student creation flow and teacher invitation flow, aligning behavior with the linked issue.

Changes:

  • Removed the verified-school guard from SchoolStudent::Create validation.
  • Removed the verified-school model validation from TeacherInvitation.
  • Deleted specs that asserted the old “unverified school” failure behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
lib/concepts/school_student/create.rb Stops rejecting student creation based on school.verified?.
app/models/teacher_invitation.rb Removes school_is_verified model validation.
spec/concepts/school_student/create_spec.rb Removes spec coverage for the old unverified-school rejection.
spec/concepts/school_teacher/invite_spec.rb Removes spec coverage for the old unverified-school rejection.
Comments suppressed due to low confidence (1)

spec/concepts/school_student/create_spec.rb:85

  • After removing the "school is not verified" failure case, there’s no spec asserting the new expected behavior (that an unverified school can still create a student successfully). Add a context/example for an unverified school to prevent regressions back to the old restriction.
  context 'when the student cannot be created in profile api because of a 422 response' do
    let(:error) { { 'message' => "something's up with the username" } }
    let(:exception) { ProfileApiClient::Student422Error.new(error) }

    before do
      allow(ProfileApiClient).to receive(:create_school_student).and_raise(exception)
    end

@mwtrew mwtrew self-assigned this Feb 12, 2026
@mwtrew
Copy link
Contributor

mwtrew commented Feb 13, 2026

Looks fine to me but let's not merge yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants