logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

silences_controller_spec.rb (806B)


  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