1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

Add coverage to /admin/accounts/:id (#30386)

This commit is contained in:
Claire 2024-05-21 15:17:34 +02:00 committed by GitHub
parent 89f89d738f
commit 32223863a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -53,11 +53,32 @@ RSpec.describe Admin::AccountsController do
describe 'GET #show' do
let(:current_user) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
let(:account) { Fabricate(:account) }
it 'returns http success' do
get :show, params: { id: account.id }
expect(response).to have_http_status(200)
context 'with a remote account' do
let(:account) { Fabricate(:account, domain: 'example.com') }
it 'returns http success' do
get :show, params: { id: account.id }
expect(response).to have_http_status(200)
end
end
context 'with a local account' do
let(:account) { Fabricate(:account, domain: nil) }
it 'returns http success' do
get :show, params: { id: account.id }
expect(response).to have_http_status(200)
end
end
context 'with a local deleted account' do
let(:account) { Fabricate(:account, domain: nil, user: nil) }
it 'returns http success' do
get :show, params: { id: account.id }
expect(response).to have_http_status(200)
end
end
end