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

33 lines
806 B

  1. require 'rails_helper'
  2. describe Admin::SilencesController do
  3. render_views
  4. before do
  5. sign_in Fabricate(:user, admin: true), scope: :user
  6. end
  7. describe 'POST #create' do
  8. it 'redirects to admin accounts page' do
  9. account = Fabricate(:account, silenced: false)
  10. post :create, params: { account_id: account.id }
  11. account.reload
  12. expect(account.silenced?).to eq true
  13. expect(response).to redirect_to(admin_accounts_path)
  14. end
  15. end
  16. describe 'DELETE #destroy' do
  17. it 'redirects to admin accounts page' do
  18. account = Fabricate(:account, silenced: true)
  19. delete :destroy, params: { account_id: account.id }
  20. account.reload
  21. expect(account.silenced?).to eq false
  22. expect(response).to redirect_to(admin_accounts_path)
  23. end
  24. end
  25. end