logo

mastofe

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

exports_controller_spec.rb (655B)


  1. require 'rails_helper'
  2. describe Settings::ExportsController do
  3. render_views
  4. describe 'GET #show' do
  5. context 'when signed in' do
  6. let(:user) { Fabricate(:user) }
  7. before do
  8. sign_in user, scope: :user
  9. end
  10. it 'renders export' do
  11. get :show
  12. export = assigns(:export)
  13. expect(export).to be_instance_of Export
  14. expect(export.account).to eq user.account
  15. expect(response).to have_http_status(:success)
  16. end
  17. end
  18. context 'when not signed in' do
  19. it 'redirects' do
  20. get :show
  21. expect(response).to redirect_to '/auth/sign_in'
  22. end
  23. end
  24. end
  25. end