Skip to content

Commit e934eed

Browse files
committed
Remove reject button, function, and tests
1 parent c1f5481 commit e934eed

4 files changed

Lines changed: 0 additions & 80 deletions

File tree

app/controllers/admin/schools_controller.rb

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,6 @@ def verify
1414
redirect_to admin_school_path(requested_resource)
1515
end
1616

17-
def reject
18-
service = SchoolVerificationService.new(requested_resource)
19-
20-
if service.reject
21-
flash[:notice] = t('administrate.controller.reject_school.success')
22-
else
23-
flash[:error] = t('administrate.controller.reject_school.error')
24-
end
25-
26-
redirect_to admin_school_path(requested_resource)
27-
end
28-
2917
def reopen
3018
service = SchoolVerificationService.new(requested_resource)
3119

app/views/admin/schools/show.html.erb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,6 @@ as well as a link to its edit page.
4545
style: "background-color: darkorange; margin: 5px;",
4646
data: { confirm: t("administrate.actions.confirm_reopen_school") }
4747
) unless page.resource.verified? || !page.resource.rejected? %>
48-
49-
<%= link_to(
50-
t("administrate.actions.reject_school"),
51-
reject_admin_school_path(page.resource),
52-
class: "button button--danger",
53-
method: :patch,
54-
style: "background-color: hsla(0, 88%, 33%, 1); margin: 5px 5px 5px 0;",
55-
data: { confirm: t("administrate.actions.confirm_reject_school") }
56-
) unless page.resource.verified? || page.resource.rejected? %>
5748
</div>
5849
</header>
5950

config/locales/admin/en.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,12 @@ en:
66
confirm_discard: Are you sure you want to discard this record?
77
verify_school: Verify School
88
confirm_verify_school: Are you sure you want to verify this school?
9-
reject_school: Reject School
10-
confirm_reject_school: Are you sure you want to reject this school?
119
reopen_school: Reopen School
1210
confirm_reopen_school: Are you sure you want to reopen this school?
1311
controller:
1412
verify_school:
1513
success: "Successfully verified."
1614
error: "There was an error verifying the school"
17-
reject_school:
18-
success: "Successfully rejected."
19-
error: "There was an error rejecting the school"
2015
reopen_school:
2116
success: "Successfully reopened."
2217
error: "There was an error reopening the school"

spec/features/admin/schools_spec.rb

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@
3636
expect(response.body).to include(I18n.t('administrate.actions.verify_school'))
3737
end
3838

39-
it 'includes link to reject school' do
40-
expect(response.body).to include(I18n.t('administrate.actions.reject_school'))
41-
end
42-
4339
it 'does not include a link to search for this school by its ZIP code in the NCES public schools database' do
4440
expect(response.body).not_to include('Search for this school in the NCES database')
4541
end
@@ -52,10 +48,6 @@
5248
expect(response.body).not_to include(I18n.t('administrate.actions.verify_school'))
5349
end
5450

55-
it 'does not include a link to reject school' do
56-
expect(response.body).not_to include(I18n.t('administrate.actions.reject_school'))
57-
end
58-
5951
it 'does not include a link to reopen school' do
6052
expect(response.body).not_to include(I18n.t('administrate.actions.reopen_school'))
6153
end
@@ -68,10 +60,6 @@
6860
expect(response.body).not_to include(I18n.t('administrate.actions.verify_school'))
6961
end
7062

71-
it 'does not include a link to reject school' do
72-
expect(response.body).not_to include(I18n.t('administrate.actions.reject_school'))
73-
end
74-
7563
it 'includes link to reopen school' do
7664
expect(response.body).to include(I18n.t('administrate.actions.reopen_school'))
7765
end
@@ -132,48 +120,6 @@
132120
end
133121
end
134122

135-
describe 'PUT #reject' do
136-
let(:creator) { create(:user) }
137-
let(:school) { create(:school, creator_id: creator.id) }
138-
let(:rejection_result) { nil }
139-
let(:verification_service) { instance_double(SchoolVerificationService, reject: rejection_result) }
140-
141-
before do
142-
stub_user_info_api_for(creator)
143-
allow(SchoolVerificationService).to receive(:new).with(school).and_return(verification_service)
144-
145-
patch reject_admin_school_path(school)
146-
end
147-
148-
it 'redirects to school path' do
149-
expect(response).to redirect_to(admin_school_path(school))
150-
end
151-
152-
describe 'when rejection was successful' do
153-
let(:rejection_result) { true }
154-
155-
before do
156-
follow_redirect!
157-
end
158-
159-
it 'displays success message' do
160-
expect(response.body).to include(I18n.t('administrate.controller.reject_school.success'))
161-
end
162-
end
163-
164-
describe 'when rejection was unsuccessful' do
165-
let(:rejection_result) { false }
166-
167-
before do
168-
follow_redirect!
169-
end
170-
171-
it 'displays failure message' do
172-
expect(response.body).to include(I18n.t('administrate.controller.reject_school.error'))
173-
end
174-
end
175-
end
176-
177123
describe 'PUT #reopen' do
178124
let(:creator) { create(:user) }
179125
let(:school) { create(:verified_school, creator_id: creator.id) }

0 commit comments

Comments
 (0)