diff --git a/app/controllers/admin/schools_controller.rb b/app/controllers/admin/schools_controller.rb index c58b4e80b..02b027316 100644 --- a/app/controllers/admin/schools_controller.rb +++ b/app/controllers/admin/schools_controller.rb @@ -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) diff --git a/app/views/admin/schools/show.html.erb b/app/views/admin/schools/show.html.erb index ebdee4c53..02b182c44 100644 --- a/app/views/admin/schools/show.html.erb +++ b/app/views/admin/schools/show.html.erb @@ -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? %> diff --git a/config/locales/admin/en.yml b/config/locales/admin/en.yml index 5c3a7cfb0..36bba6442 100644 --- a/config/locales/admin/en.yml +++ b/config/locales/admin/en.yml @@ -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" diff --git a/spec/features/admin/schools_spec.rb b/spec/features/admin/schools_spec.rb index 0a06d15ee..8d57f21e0 100644 --- a/spec/features/admin/schools_spec.rb +++ b/spec/features/admin/schools_spec.rb @@ -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 @@ -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 @@ -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 @@ -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) }