Skip to content

Commit 4e3a399

Browse files
committed
Add test for not returning user if user is creator of rejected school
1 parent 9c5b01c commit 4e3a399

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

spec/models/school_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,14 @@
489489
user = build(:user)
490490
expect { described_class.find_for_user!(user) }.to raise_error(ActiveRecord::RecordNotFound)
491491
end
492+
493+
it('raises ActiveRecord::RecordNotFound if the user is the creator of a rejected school') do
494+
creator = create(:user)
495+
school.update!(creator_id: creator.id)
496+
school.reject
497+
498+
expect { described_class.find_for_user!(creator) }.to raise_error(ActiveRecord::RecordNotFound)
499+
end
492500
end
493501

494502
describe '#verified?' do

0 commit comments

Comments
 (0)