From 567d59e48a0bca7ad7f4d8173f774620702402d7 Mon Sep 17 00:00:00 2001 From: Jack Dempsey Date: Thu, 14 Apr 2011 00:48:30 +0800 Subject: [PATCH] update verbiage to be more concise --- config/locales/en.yml | 2 +- lib/devise/controllers/internal_helpers.rb | 2 +- test/controllers/internal_helpers_test.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 258316ca..5249aa5b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -12,7 +12,7 @@ en: devise: failure: - no_authentication_allowed: 'You are attempting to access a resource as an authenticated user when that is not allowed. Please sign out and try again.' + already_authenticated: 'You are already signed in.' unauthenticated: 'You need to sign in or sign up before continuing.' unconfirmed: 'You have to confirm your account before continuing.' locked: 'Your account is locked.' diff --git a/lib/devise/controllers/internal_helpers.rb b/lib/devise/controllers/internal_helpers.rb index ce078936..86ad80db 100644 --- a/lib/devise/controllers/internal_helpers.rb +++ b/lib/devise/controllers/internal_helpers.rb @@ -114,7 +114,7 @@ MESSAGE def require_no_authentication if warden.authenticated?(resource_name) resource = warden.user(resource_name) - flash[:alert] = I18n.t("devise.failure.no_authentication_allowed") + flash[:alert] = I18n.t("devise.failure.already_authenticated") redirect_to after_sign_in_path_for(resource) end end diff --git a/test/controllers/internal_helpers_test.rb b/test/controllers/internal_helpers_test.rb index a44269d8..66a1b3fe 100644 --- a/test/controllers/internal_helpers_test.rb +++ b/test/controllers/internal_helpers_test.rb @@ -50,7 +50,7 @@ class HelpersTest < ActionController::TestCase @mock_warden.expects(:user).with(:user).returns(User.new) @controller.expects(:redirect_to).with(root_path) @controller.send :require_no_authentication - assert flash[:alert] == I18n.t("devise.failure.no_authentication_allowed") + assert flash[:alert] == I18n.t("devise.failure.already_authenticated") end test 'signed in resource returns signed in resource for current scope' do