闭社主体 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.

23 lines
601 B

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