mirror of
https://github.com/mastodon/mastodon.git
synced 2026-03-22 10:25:13 -05:00
Some checks failed
Check i18n / check-i18n (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 Linting / lint (push) Waiting to run
Historical data migration test / test (14-alpine) (push) Waiting to run
Historical data migration test / test (15-alpine) (push) Waiting to run
Historical data migration test / test (16-alpine) (push) Waiting to run
Historical data migration test / test (17-alpine) (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.2) (push) Blocked by required conditions
Ruby Testing / test (3.3) (push) Blocked by required conditions
Ruby Testing / Libvips tests (.ruby-version) (push) Blocked by required conditions
Ruby Testing / Libvips tests (3.2) (push) Blocked by required conditions
Ruby Testing / Libvips tests (3.3) (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.2) (push) Blocked by required conditions
Ruby Testing / End to End testing (3.3) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (.ruby-version, docker.elastic.co/elasticsearch/elasticsearch:7.17.13) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (.ruby-version, docker.elastic.co/elasticsearch/elasticsearch:8.10.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.2, docker.elastic.co/elasticsearch/elasticsearch:7.17.13) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (3.3, docker.elastic.co/elasticsearch/elasticsearch:7.17.13) (push) Blocked by required conditions
Bundler Audit / security (push) Has been cancelled
Haml Linting / lint (push) Has been cancelled
47 lines
1.6 KiB
Ruby
47 lines
1.6 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
RSpec.describe 'report interface', :attachment_processing, :js, :streaming do
|
|
include ProfileStories
|
|
|
|
let(:email) { 'admin@example.com' }
|
|
let(:password) { 'password' }
|
|
let(:confirmed_at) { Time.zone.now }
|
|
let(:finished_onboarding) { true }
|
|
|
|
let(:reported_account) { Fabricate(:account) }
|
|
let(:reported_status) { Fabricate(:status, account: reported_account) }
|
|
let(:media_attachment) { Fabricate(:media_attachment, account: reported_account, status: reported_status, file: attachment_fixture('attachment.jpg')) }
|
|
let!(:report) { Fabricate(:report, target_account: reported_account, status_ids: [media_attachment.status.id]) }
|
|
|
|
before do
|
|
as_a_logged_in_admin
|
|
visit admin_report_path(report)
|
|
end
|
|
|
|
it 'displays the report interface, including the javascript bits' do
|
|
# The report category selector React component is properly rendered
|
|
expect(page).to have_css('.report-reason-selector')
|
|
|
|
# The media React component is properly rendered
|
|
page.scroll_to(page.find('.batch-table__row'))
|
|
expect(page).to have_css('.spoiler-button__overlay__label')
|
|
end
|
|
|
|
it 'marks a report resolved from the show page actions area' do
|
|
visit admin_report_path(report)
|
|
|
|
expect { resolve_report }
|
|
.to change { report.reload.action_taken_at }.to(be_present).from(nil)
|
|
end
|
|
|
|
def resolve_report
|
|
within '.report-actions' do
|
|
click_on I18n.t('admin.reports.mark_as_resolved')
|
|
end
|
|
expect(page)
|
|
.to have_content(I18n.t('admin.reports.resolved_msg'))
|
|
end
|
|
end
|