mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-26 07:51:37 +01:00
Add coverage to /admin/accounts/:id
(#30386)
This commit is contained in:
parent
89f89d738f
commit
32223863a5
1 changed files with 25 additions and 4 deletions
|
@ -53,7 +53,9 @@ RSpec.describe Admin::AccountsController do
|
||||||
|
|
||||||
describe 'GET #show' do
|
describe 'GET #show' do
|
||||||
let(:current_user) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
|
let(:current_user) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
|
||||||
let(:account) { Fabricate(:account) }
|
|
||||||
|
context 'with a remote account' do
|
||||||
|
let(:account) { Fabricate(:account, domain: 'example.com') }
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :show, params: { id: account.id }
|
get :show, params: { id: account.id }
|
||||||
|
@ -61,6 +63,25 @@ RSpec.describe Admin::AccountsController do
|
||||||
end
|
end
|
||||||
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
|
||||||
|
|
||||||
describe 'POST #memorialize' do
|
describe 'POST #memorialize' do
|
||||||
subject { post :memorialize, params: { id: account.id } }
|
subject { post :memorialize, params: { id: account.id } }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue