Redirect directly to the login page no registrations closed
This commit is contained in:
parent
0eb91e320c
commit
0f1517af15
2 changed files with 3 additions and 3 deletions
|
|
@ -25,7 +25,7 @@ class RegistrationsController < Devise::RegistrationsController
|
||||||
def check_registrations_open!
|
def check_registrations_open!
|
||||||
if APP_CONFIG[:registrations_closed]
|
if APP_CONFIG[:registrations_closed]
|
||||||
flash[:error] = t('registrations.closed')
|
flash[:error] = t('registrations.closed')
|
||||||
redirect_to root_url
|
redirect_to new_user_session_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,12 @@ describe RegistrationsController do
|
||||||
it 'stops a #new request' do
|
it 'stops a #new request' do
|
||||||
get :new
|
get :new
|
||||||
flash[:error].should == I18n.t('registrations.closed')
|
flash[:error].should == I18n.t('registrations.closed')
|
||||||
response.should redirect_to root_url
|
response.should redirect_to new_user_session_path
|
||||||
end
|
end
|
||||||
it 'stops a #create request' do
|
it 'stops a #create request' do
|
||||||
post :create, @valid_params
|
post :create, @valid_params
|
||||||
flash[:error].should == I18n.t('registrations.closed')
|
flash[:error].should == I18n.t('registrations.closed')
|
||||||
response.should redirect_to root_url
|
response.should redirect_to new_user_session_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue