闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
585 B

  1. require 'rails_helper'
  2. describe Admin::ReportedStatusesController do
  3. let(:user) { Fabricate(:user, admin: true) }
  4. before do
  5. sign_in user, scope: :user
  6. end
  7. describe 'DELETE #destroy' do
  8. it 'removes a status' do
  9. report = Fabricate(:report)
  10. status = Fabricate(:status)
  11. allow(RemovalWorker).to receive(:perform_async)
  12. delete :destroy, params: { report_id: report, id: status }
  13. expect(response).to redirect_to(admin_report_path(report))
  14. expect(RemovalWorker).
  15. to have_received(:perform_async).with(status.id)
  16. end
  17. end
  18. end