0
0
Fork 0

Enable Rubocop HTTP status rules (#23717)

This commit is contained in:
Nick Schonning 2023-02-19 21:16:40 -05:00 committed by GitHub
parent bd1d57c230
commit aef0051fd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 77 additions and 242 deletions

View file

@ -83,7 +83,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
let(:target_role) { UserRole.find_by(name: 'Admin') }
it 'fails to memorialize account' do
is_expected.to have_http_status :forbidden
is_expected.to have_http_status 403
expect(account.reload).to_not be_memorial
end
end
@ -105,7 +105,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
let(:target_role) { UserRole.find_by(name: 'Admin') }
it 'fails to memorialize account' do
is_expected.to have_http_status :forbidden
is_expected.to have_http_status 403
expect(account.reload).to_not be_memorial
end
end
@ -114,7 +114,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
let(:target_role) { UserRole.find_by(name: 'Moderator') }
it 'fails to memorialize account' do
is_expected.to have_http_status :forbidden
is_expected.to have_http_status 403
expect(account.reload).to_not be_memorial
end
end
@ -141,7 +141,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
let(:role) { UserRole.everyone }
it 'fails to enable account' do
is_expected.to have_http_status :forbidden
is_expected.to have_http_status 403
expect(user.reload).to be_disabled
end
end
@ -167,7 +167,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
end
it 'logs action' do
is_expected.to have_http_status :found
is_expected.to have_http_status 302
log_item = Admin::ActionLog.last
@ -182,7 +182,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
let(:role) { UserRole.everyone }
it 'fails to approve account' do
is_expected.to have_http_status :forbidden
is_expected.to have_http_status 403
expect(user.reload).to_not be_approved
end
end
@ -207,7 +207,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
end
it 'logs action' do
is_expected.to have_http_status :found
is_expected.to have_http_status 302
log_item = Admin::ActionLog.last
@ -222,7 +222,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
let(:role) { UserRole.everyone }
it 'fails to reject account' do
is_expected.to have_http_status :forbidden
is_expected.to have_http_status 403
expect(user.reload).to_not be_approved
end
end
@ -250,7 +250,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
let(:role) { UserRole.everyone }
it 'fails to redownload' do
is_expected.to have_http_status :forbidden
is_expected.to have_http_status 403
end
end
end
@ -273,7 +273,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
let(:role) { UserRole.everyone }
it 'fails to remove avatar' do
is_expected.to have_http_status :forbidden
is_expected.to have_http_status 403
end
end
end
@ -303,7 +303,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
it 'fails to remove avatar' do
subject
expect(response).to have_http_status :forbidden
expect(response).to have_http_status 403
end
end
end