mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
Cover Settings::ExportsController more (#3358)
This commit is contained in:
parent
7d33b60f3f
commit
bd4dd4c4a0
@ -3,15 +3,29 @@ require 'rails_helper'
|
|||||||
describe Settings::ExportsController do
|
describe Settings::ExportsController do
|
||||||
render_views
|
render_views
|
||||||
|
|
||||||
|
describe 'GET #show' do
|
||||||
|
context 'when signed in' do
|
||||||
|
let(:user) { Fabricate(:user) }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
sign_in Fabricate(:user), scope: :user
|
sign_in user, scope: :user
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'GET #show' do
|
it 'renders export' do
|
||||||
it 'returns http success' do
|
|
||||||
get :show
|
get :show
|
||||||
|
|
||||||
|
export = assigns(:export)
|
||||||
|
expect(export).to be_instance_of Export
|
||||||
|
expect(export.account).to eq user.account
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(:success)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when not signed in' do
|
||||||
|
it 'redirects' do
|
||||||
|
get :show
|
||||||
|
expect(response).to redirect_to '/auth/sign_in'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user