Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def require_user
def require_no_user
if current_user
store_location
flash[:notice] = t :not_logged_in
flash[:notice] = t :already_signed_in
redirect_to root_path
false
end
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ en:
please contact us.
none: none
not_logged_in: Not logged in
already_signed_in: You are already signed in.
note_created_error_message: There was a problem creating this note
notes: Notes
notes_about_this: Optional notes for this %{class_name}
Expand Down
1 change: 1 addition & 0 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ es:
no_user_with_that_email: Parece haber un problema. Si esto continua, por favor contacta con nosotros.
none: Ninguna
not_logged_in: No tienes ninguna sesión abierta
already_signed_in: Ya tienes una sesión abierta.
note_created_error_message: Ocurrió un problema al crear este comentario
notes: Comentarios
notes_about_this: Comentarios adicionales para este %{class_name}
Expand Down
1 change: 1 addition & 0 deletions config/locales/pt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ pt:
entre em contato conosco.
none: nenhum
not_logged_in: Não logado
already_signed_in: Você já está conectado.
note_created_error_message: Houve um problema ao criar esta nota
notes: Notas
notes_about_this: Notas opcionais para este %{class_name}
Expand Down
9 changes: 9 additions & 0 deletions test/functional/password_resets_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ class PasswordResetsControllerTest < ActionController::TestCase
assert_response :success
end

test 'redirects signed in users away with the right message' do
@controller.session['user'] = users(:founder)

get :new

assert_redirected_to root_path
assert_equal I18n.t(:already_signed_in), flash[:notice]
end

test 'create sends reset instructions for a valid email' do
user = users(:founder)
emails_before = ActionMailer::Base.deliveries.size
Expand Down
Loading