update verbiage to be more concise

This commit is contained in:
Jack Dempsey 2011-04-14 00:48:30 +08:00 committed by José Valim
parent f89f71262d
commit 567d59e48a
3 changed files with 3 additions and 3 deletions

View File

@ -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.'

View File

@ -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

View File

@ -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