]> cat aescling's git repositories - mastodon.git/commitdiff
Fix #390 - fix redirect after sign-up (to login page instead of homepage)
authorEugen Rochko <eugen@zeonfederated.com>
Wed, 4 Jan 2017 14:31:25 +0000 (15:31 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Wed, 4 Jan 2017 14:31:25 +0000 (15:31 +0100)
app/controllers/auth/registrations_controller.rb
spec/controllers/auth/registrations_controller_spec.rb

index 60eb9905a3767c022ecbc4a749eadf7c7cb46fb4..6ce4984bb31ee9e1d3467c2fafea7c7d81796389 100644 (file)
@@ -23,6 +23,10 @@ class Auth::RegistrationsController < Devise::RegistrationsController
     new_user_session_path
   end
 
+  def after_inactive_sign_up_path_for(_resource)
+    new_user_session_path
+  end
+
   def check_single_user_mode
     redirect_to root_path if Rails.configuration.x.single_user_mode
   end
index f7ebebbcb8dec3e7345f74ba2f9f04a05ad591c6..27ad6cbde5c0d2a646b6cbc3e352715d4f4dc0f4 100644 (file)
@@ -20,8 +20,8 @@ RSpec.describe Auth::RegistrationsController, type: :controller do
       post :create, params: { user: { account_attributes: { username: 'test' }, email: 'test@example.com', password: '12345678', password_confirmation: '12345678' } }
     end
 
-    it 'redirects to home page' do
-      expect(response).to redirect_to root_path
+    it 'redirects to login page' do
+      expect(response).to redirect_to new_user_session_path
     end
 
     it 'creates user' do