]> cat aescling's git repositories - mastodon.git/blob - spec/controllers/home_controller_spec.rb
Export and import `hide_notifications` alongside user mutes (#10335)
[mastodon.git] / spec / controllers / home_controller_spec.rb
1 require 'rails_helper'
2
3 RSpec.describe HomeController, type: :controller do
4 render_views
5
6 describe 'GET #index' do
7 subject { get :index }
8
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' }
13 end
14
15 it 'redirects to about page' do
16 @request.path = '/'
17 is_expected.to redirect_to(about_path)
18 end
19 end
20
21 context 'when signed in' do
22 let(:user) { Fabricate(:user) }
23
24 before { sign_in(user) }
25
26 it 'assigns @body_classes' do
27 subject
28 expect(assigns(:body_classes)).to eq 'app-body'
29 end
30
31 it 'assigns @initial_state_json' do
32 subject
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
39 end
40 end
41 end
42 end
This page took 0.176779 seconds and 4 git commands to generate.