]>
cat aescling's git repositories - mastodon.git/blob - spec/controllers/home_controller_spec.rb
3 RSpec
.describe HomeController
, type
: :controller do
6 describe
'GET #index' do
9 context
'when not signed in' do
10 context
'when requested path is tag timeline' do
11 before
{ @request.path
= '/web/timelines/tag/name' }
12 it
{ is_expected
.to redirect_to
'/tags/name' }
15 it
'redirects to about page' do
17 is_expected
.to
redirect_to(about_path
)
21 context
'when signed in' do
22 let(:user) { Fabricate(:user) }
24 before
{ sign_in(user
) }
26 it
'assigns @body_classes' do
28 expect(assigns(:body_classes)).to eq
'app-body'
31 it
'assigns @initial_state_json' do
33 initial_state_json
= json_str_to_hash(assigns(:initial_state_json))
34 expect(initial_state_json
[:meta]).to_not be_nil
35 expect(initial_state_json
[:compose]).to_not be_nil
36 expect(initial_state_json
[:accounts]).to_not be_nil
37 expect(initial_state_json
[:settings]).to_not be_nil
38 expect(initial_state_json
[:media_attachments]).to_not be_nil
This page took 0.176779 seconds and 4 git commands to generate.