|
|
@ -4,21 +4,24 @@ RSpec.describe HomeController, type: :controller do |
|
|
|
render_views |
|
|
|
render_views |
|
|
|
|
|
|
|
|
|
|
|
describe 'GET #index' do |
|
|
|
describe 'GET #index' do |
|
|
|
|
|
|
|
subject { get :index } |
|
|
|
|
|
|
|
|
|
|
|
context 'when not signed in' do |
|
|
|
context 'when not signed in' do |
|
|
|
|
|
|
|
context 'when requested path is tag timeline' do |
|
|
|
|
|
|
|
before { @request.path = '/web/timelines/tag/name' } |
|
|
|
|
|
|
|
it { is_expected.to redirect_to '/tags/name' } |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it 'redirects to about page' do |
|
|
|
it 'redirects to about page' do |
|
|
|
@request.path = '/' |
|
|
|
@request.path = '/' |
|
|
|
get :index |
|
|
|
is_expected.to redirect_to(about_path) |
|
|
|
expect(response).to redirect_to(about_path) |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context 'when signed in' do |
|
|
|
context 'when signed in' do |
|
|
|
let(:user) { Fabricate(:user) } |
|
|
|
let(:user) { Fabricate(:user) } |
|
|
|
|
|
|
|
|
|
|
|
subject do |
|
|
|
before { sign_in(user) } |
|
|
|
sign_in(user) |
|
|
|
|
|
|
|
get :index |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it 'assigns @body_classes' do |
|
|
|
it 'assigns @body_classes' do |
|
|
|
subject |
|
|
|
subject |
|
|
|