From 0f1517af15202f864a7d0c11963a09262f706dc0 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 15 Nov 2010 12:24:58 -0800 Subject: [PATCH] Redirect directly to the login page no registrations closed --- app/controllers/registrations_controller.rb | 2 +- spec/controllers/registrations_controller_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 4cb5be489..948e5d02d 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -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 diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb index 4881eb796..9f8e5299a 100644 --- a/spec/controllers/registrations_controller_spec.rb +++ b/spec/controllers/registrations_controller_spec.rb @@ -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