Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions app/controllers/admin/schools_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,6 @@ def verify
redirect_to admin_school_path(requested_resource)
end

def reject
service = SchoolVerificationService.new(requested_resource)

if service.reject
flash[:notice] = t('administrate.controller.reject_school.success')
else
flash[:error] = t('administrate.controller.reject_school.error')
end

redirect_to admin_school_path(requested_resource)
end

def reopen
service = SchoolVerificationService.new(requested_resource)

Expand Down
9 changes: 0 additions & 9 deletions app/views/admin/schools/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,6 @@ as well as a link to its edit page.
style: "background-color: darkorange; margin: 5px;",
data: { confirm: t("administrate.actions.confirm_reopen_school") }
) unless page.resource.verified? || !page.resource.rejected? %>

<%= link_to(
t("administrate.actions.reject_school"),
reject_admin_school_path(page.resource),
class: "button button--danger",
method: :patch,
style: "background-color: hsla(0, 88%, 33%, 1); margin: 5px 5px 5px 0;",
data: { confirm: t("administrate.actions.confirm_reject_school") }
) unless page.resource.verified? || page.resource.rejected? %>
</div>
</header>

Expand Down
5 changes: 0 additions & 5 deletions config/locales/admin/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,12 @@ en:
confirm_discard: Are you sure you want to discard this record?
verify_school: Verify School
confirm_verify_school: Are you sure you want to verify this school?
reject_school: Reject School
confirm_reject_school: Are you sure you want to reject this school?
reopen_school: Reopen School
confirm_reopen_school: Are you sure you want to reopen this school?
controller:
verify_school:
success: "Successfully verified."
error: "There was an error verifying the school"
reject_school:
success: "Successfully rejected."
error: "There was an error rejecting the school"
reopen_school:
success: "Successfully reopened."
error: "There was an error reopening the school"
Expand Down
54 changes: 0 additions & 54 deletions spec/features/admin/schools_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@
expect(response.body).to include(I18n.t('administrate.actions.verify_school'))
end

it 'includes link to reject school' do
expect(response.body).to include(I18n.t('administrate.actions.reject_school'))
end

it 'does not include a link to search for this school by its ZIP code in the NCES public schools database' do
expect(response.body).not_to include('Search for this school in the NCES database')
end
Comment on lines 36 to 41
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

PR description/title says the reject button/function/tests were removed, but there are still specs covering SchoolVerificationService#reject (spec/services/school_verification_service_spec.rb) and the service still delegates :reject. If the intent is to remove reject functionality entirely, those should be removed/updated; otherwise consider updating the PR description to clarify this is only removing the admin UI/controller reject behavior.

Copilot uses AI. Check for mistakes.
Expand All @@ -52,10 +48,6 @@
expect(response.body).not_to include(I18n.t('administrate.actions.verify_school'))
end

it 'does not include a link to reject school' do
expect(response.body).not_to include(I18n.t('administrate.actions.reject_school'))
end

it 'does not include a link to reopen school' do
expect(response.body).not_to include(I18n.t('administrate.actions.reopen_school'))
end
Expand All @@ -68,10 +60,6 @@
expect(response.body).not_to include(I18n.t('administrate.actions.verify_school'))
end

it 'does not include a link to reject school' do
expect(response.body).not_to include(I18n.t('administrate.actions.reject_school'))
end

it 'includes link to reopen school' do
expect(response.body).to include(I18n.t('administrate.actions.reopen_school'))
end
Expand Down Expand Up @@ -132,48 +120,6 @@
end
end

describe 'PUT #reject' do
let(:creator) { create(:user) }
let(:school) { create(:school, creator_id: creator.id) }
let(:rejection_result) { nil }
let(:verification_service) { instance_double(SchoolVerificationService, reject: rejection_result) }

before do
stub_user_info_api_for(creator)
allow(SchoolVerificationService).to receive(:new).with(school).and_return(verification_service)

patch reject_admin_school_path(school)
end

it 'redirects to school path' do
expect(response).to redirect_to(admin_school_path(school))
end

describe 'when rejection was successful' do
let(:rejection_result) { true }

before do
follow_redirect!
end

it 'displays success message' do
expect(response.body).to include(I18n.t('administrate.controller.reject_school.success'))
end
end

describe 'when rejection was unsuccessful' do
let(:rejection_result) { false }

before do
follow_redirect!
end

it 'displays failure message' do
expect(response.body).to include(I18n.t('administrate.controller.reject_school.error'))
end
end
end

describe 'PUT #reopen' do
let(:creator) { create(:user) }
let(:school) { create(:verified_school, creator_id: creator.id) }
Expand Down
Loading