mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-05 17:31:12 +00:00
24 lines
568 B
Ruby
24 lines
568 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
RSpec.describe 'Admin Accounts Header' do
|
|
before { sign_in user }
|
|
|
|
describe 'DELETE #destroy' do
|
|
let(:user) { Fabricate(:user, role: role) }
|
|
let(:account) { Fabricate(:account, header: fixture_file_upload('attachment.jpg', 'image/jpeg')) }
|
|
|
|
context 'when user is not admin' do
|
|
let(:role) { UserRole.everyone }
|
|
|
|
it 'fails to remove header' do
|
|
delete "/admin/accounts/#{account.id}/header"
|
|
|
|
expect(response)
|
|
.to have_http_status 403
|
|
end
|
|
end
|
|
end
|
|
end
|