Redirect directly to the login page no registrations closed

This commit is contained in:
Raphael 2010-11-15 12:24:58 -08:00
parent 0eb91e320c
commit 0f1517af15
2 changed files with 3 additions and 3 deletions

View file

@ -25,7 +25,7 @@ class RegistrationsController < Devise::RegistrationsController
def check_registrations_open!
if APP_CONFIG[:registrations_closed]
flash[:error] = t('registrations.closed')
redirect_to root_url
redirect_to new_user_session_path
end
end
end

View file

@ -27,12 +27,12 @@ describe RegistrationsController do
it 'stops a #new request' do
get :new
flash[:error].should == I18n.t('registrations.closed')
response.should redirect_to root_url
response.should redirect_to new_user_session_path
end
it 'stops a #create request' do
post :create, @valid_params
flash[:error].should == I18n.t('registrations.closed')
response.should redirect_to root_url
response.should redirect_to new_user_session_path
end
end