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

31 lines
655 B

  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