mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
Merge commit '4f99b48e8e8c9818f85be1b2ac9abad75f538585' into glitch-soc/merge-upstream
This commit is contained in:
@@ -109,15 +109,6 @@ RSpec.describe Admin::AccountsController do
|
||||
context 'when user is admin' do
|
||||
let(:current_role) { UserRole.find_by(name: 'Admin') }
|
||||
|
||||
context 'when target user is admin' do
|
||||
let(:target_role) { UserRole.find_by(name: 'Admin') }
|
||||
|
||||
it 'fails to memorialize account' do
|
||||
expect(subject).to have_http_status 403
|
||||
expect(account.reload).to_not be_memorial
|
||||
end
|
||||
end
|
||||
|
||||
context 'when target user is not admin' do
|
||||
let(:target_role) { UserRole.find_by(name: 'Moderator') }
|
||||
|
||||
@@ -127,28 +118,6 @@ RSpec.describe Admin::AccountsController do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when user is not admin' do
|
||||
let(:current_role) { UserRole.find_by(name: 'Moderator') }
|
||||
|
||||
context 'when target user is admin' do
|
||||
let(:target_role) { UserRole.find_by(name: 'Admin') }
|
||||
|
||||
it 'fails to memorialize account' do
|
||||
expect(subject).to have_http_status 403
|
||||
expect(account.reload).to_not be_memorial
|
||||
end
|
||||
end
|
||||
|
||||
context 'when target user is not admin' do
|
||||
let(:target_role) { UserRole.find_by(name: 'Moderator') }
|
||||
|
||||
it 'fails to memorialize account' do
|
||||
expect(subject).to have_http_status 403
|
||||
expect(account.reload).to_not be_memorial
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'POST #enable' do
|
||||
@@ -166,15 +135,6 @@ RSpec.describe Admin::AccountsController do
|
||||
expect(user.reload).to_not be_disabled
|
||||
end
|
||||
end
|
||||
|
||||
context 'when user is not admin' do
|
||||
let(:role) { UserRole.everyone }
|
||||
|
||||
it 'fails to enable account' do
|
||||
expect(subject).to have_http_status 403
|
||||
expect(user.reload).to be_disabled
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'POST #approve' do
|
||||
@@ -204,15 +164,6 @@ RSpec.describe Admin::AccountsController do
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when user is not admin' do
|
||||
let(:role) { UserRole.everyone }
|
||||
|
||||
it 'fails to approve account' do
|
||||
expect(subject).to have_http_status 403
|
||||
expect(user.reload).to_not be_approved
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'POST #reject' do
|
||||
@@ -241,15 +192,6 @@ RSpec.describe Admin::AccountsController do
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when user is not admin' do
|
||||
let(:role) { UserRole.everyone }
|
||||
|
||||
it 'fails to reject account' do
|
||||
expect(subject).to have_http_status 403
|
||||
expect(user.reload).to_not be_approved
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'POST #redownload' do
|
||||
@@ -270,14 +212,6 @@ RSpec.describe Admin::AccountsController do
|
||||
expect(subject).to redirect_to admin_account_path(account.id)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when user is not admin' do
|
||||
let(:role) { UserRole.everyone }
|
||||
|
||||
it 'fails to redownload' do
|
||||
expect(subject).to have_http_status 403
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'POST #remove_avatar' do
|
||||
@@ -293,14 +227,6 @@ RSpec.describe Admin::AccountsController do
|
||||
expect(subject).to redirect_to admin_account_path(account.id)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when user is not admin' do
|
||||
let(:role) { UserRole.everyone }
|
||||
|
||||
it 'fails to remove avatar' do
|
||||
expect(subject).to have_http_status 403
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'POST #unblock_email' do
|
||||
@@ -322,15 +248,6 @@ RSpec.describe Admin::AccountsController do
|
||||
expect(response).to redirect_to admin_account_path(account.id)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when user is not admin' do
|
||||
let(:role) { UserRole.everyone }
|
||||
|
||||
it 'fails to remove avatar' do
|
||||
subject
|
||||
expect(response).to have_http_status 403
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'POST #unsensitive' do
|
||||
@@ -349,16 +266,6 @@ RSpec.describe Admin::AccountsController do
|
||||
expect(response).to redirect_to admin_account_path(account.id)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when user is not admin' do
|
||||
let(:role) { UserRole.everyone }
|
||||
|
||||
it 'fails to change account' do
|
||||
subject
|
||||
|
||||
expect(response).to have_http_status 403
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'POST #unsilence' do
|
||||
@@ -377,16 +284,6 @@ RSpec.describe Admin::AccountsController do
|
||||
expect(response).to redirect_to admin_account_path(account.id)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when user is not admin' do
|
||||
let(:role) { UserRole.everyone }
|
||||
|
||||
it 'fails to change account' do
|
||||
subject
|
||||
|
||||
expect(response).to have_http_status 403
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'POST #unsuspend' do
|
||||
@@ -409,16 +306,6 @@ RSpec.describe Admin::AccountsController do
|
||||
expect(response).to redirect_to admin_account_path(account.id)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when user is not admin' do
|
||||
let(:role) { UserRole.everyone }
|
||||
|
||||
it 'fails to change account' do
|
||||
subject
|
||||
|
||||
expect(response).to have_http_status 403
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'POST #destroy' do
|
||||
@@ -445,16 +332,6 @@ RSpec.describe Admin::AccountsController do
|
||||
expect(response).to redirect_to admin_account_path(account.id)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when user is not admin' do
|
||||
let(:role) { UserRole.everyone }
|
||||
|
||||
it 'fails to change account' do
|
||||
subject
|
||||
|
||||
expect(response).to have_http_status 403
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user