about summary refs log tree commit diff
path: root/spec
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>2018-03-06 03:29:36 +0900
committerEugen Rochko <eugen@zeonfederated.com>2018-03-05 19:29:36 +0100
commita38dbd9c8a5de4626f55d1a0dcd19ccb4a7e2c91 (patch)
tree1ac9dce407c6c65af33bff0cc25167384ae70a6a /spec
parentf6a8d835d30f61628ca731462ecfe4f6005e6a9e (diff)
Redirect from Web tag timeline to public tag timeline if not signed in (#6633)
This is also implemented in Pawoo:
https://github.com/pixiv/mastodon/commit/ceafdbd1bbf30fe20a2a814df0f8cae429a4e9db
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/home_controller_spec.rb15
1 files changed, 9 insertions, 6 deletions
diff --git a/spec/controllers/home_controller_spec.rb b/spec/controllers/home_controller_spec.rb
index 1077a7288..f43cf0c27 100644
--- a/spec/controllers/home_controller_spec.rb
+++ b/spec/controllers/home_controller_spec.rb
@@ -4,21 +4,24 @@ RSpec.describe HomeController, type: :controller do
   render_views
 
   describe 'GET #index' do
+    subject { get :index }
+
     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
         @request.path = '/'
-        get :index
-        expect(response).to redirect_to(about_path)
+        is_expected.to redirect_to(about_path)
       end
     end
 
     context 'when signed in' do
       let(:user) { Fabricate(:user) }
 
-      subject do
-        sign_in(user)
-        get :index
-      end
+      before { sign_in(user) }
 
       it 'assigns @body_classes' do
         subject