mirror of
https://github.com/mastodon/mastodon.git
synced 2026-06-10 09:37:24 -05:00
Some checks failed
Check i18n / check-i18n (push) Waiting to run
Chromatic / Check for relevant changes (push) Waiting to run
Chromatic / Run Chromatic (push) Blocked by required conditions
CodeQL / Analyze (actions) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (ruby) (push) Waiting to run
Check formatting / lint (push) Waiting to run
Ruby Testing / build (production) (push) Waiting to run
Ruby Testing / build (test) (push) Waiting to run
Ruby Testing / test (.ruby-version) (push) Blocked by required conditions
Ruby Testing / test (3.3) (push) Blocked by required conditions
Ruby Testing / test (3.4) (push) Blocked by required conditions
Ruby Testing / End to End testing (.ruby-version) (push) Blocked by required conditions
Ruby Testing / End to End testing (3.3) (push) Blocked by required conditions
Ruby Testing / End to End testing (3.4) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (.ruby-version, docker.elastic.co/elasticsearch/elasticsearch:7.17.29) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (.ruby-version, docker.elastic.co/elasticsearch/elasticsearch:8.19.2) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (.ruby-version, opensearchproject/opensearch:2) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (3.3, docker.elastic.co/elasticsearch/elasticsearch:7.17.29) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (3.4, docker.elastic.co/elasticsearch/elasticsearch:7.17.29) (push) Blocked by required conditions
Bundler Audit / security (push) Has been cancelled
Haml Linting / lint (push) Has been cancelled
Ruby Linting / lint (push) Has been cancelled
Historical data migration test / test (14-alpine) (push) Has been cancelled
Historical data migration test / test (15-alpine) (push) Has been cancelled
Historical data migration test / test (16-alpine) (push) Has been cancelled
Historical data migration test / test (17-alpine) (push) Has been cancelled
69 lines
1.5 KiB
Ruby
69 lines
1.5 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
RSpec.describe 'Admin Reports' do
|
|
describe 'GET /admin/reports' do
|
|
before do
|
|
sign_in Fabricate(:admin_user)
|
|
|
|
Fabricate.times(2, :report)
|
|
end
|
|
|
|
it 'returns success' do
|
|
get admin_reports_path
|
|
|
|
expect(response)
|
|
.to have_http_status(200)
|
|
end
|
|
end
|
|
|
|
describe 'GET /admin/reports/:id' do
|
|
let(:report) { Fabricate(:report) }
|
|
|
|
before do
|
|
sign_in Fabricate(:admin_user)
|
|
end
|
|
|
|
shared_examples 'successful return' do
|
|
it 'returns success' do
|
|
get admin_report_path(report)
|
|
|
|
expect(response)
|
|
.to have_http_status(200)
|
|
end
|
|
end
|
|
|
|
context 'with a simple report' do
|
|
it_behaves_like 'successful return'
|
|
end
|
|
|
|
context 'with a reported status' do
|
|
before do
|
|
status = Fabricate(:status, account: report.target_account)
|
|
report.update(status_ids: [status.id])
|
|
end
|
|
|
|
it_behaves_like 'successful return'
|
|
end
|
|
|
|
context 'with a reported collection' do
|
|
before do
|
|
report.collections << Fabricate(:collection, account: report.target_account)
|
|
end
|
|
|
|
it_behaves_like 'successful return'
|
|
end
|
|
|
|
context 'with both status and collection' do
|
|
before do
|
|
status = Fabricate(:status, account: report.target_account)
|
|
report.update(status_ids: [status.id])
|
|
report.collections << Fabricate(:collection, account: report.target_account)
|
|
end
|
|
|
|
it_behaves_like 'successful return'
|
|
end
|
|
end
|
|
end
|