-<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
- <%= devise_error_messages! %>
+
<%= link_to t("devise_views.registrations.edit.back_link"), :back, class: "left back" %>
-
- <%= f.label :email, t("devise_views.registrations.edit.email_label") %>
- <%= f.email_field :email, autofocus: true %>
+
<%= t("devise_views.registrations.edit.edit") %> <%= resource_name.to_s.humanize %>
+
+ <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
+ <%= devise_error_messages! %>
+
+
+ <%= f.label :email, t("devise_views.registrations.edit.email_label") %>
+ <%= f.email_field :email, autofocus: true, placeholder: t("devise_views.registrations.edit.email_label") %>
+
+
+
+ <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
+
<%= t("devise_views.registrations.edit.waiting_for") %> <%= resource.unconfirmed_email %>
+ <% end %>
+
+
+
+ <%= f.label :password, t("devise_views.registrations.edit.password_label") %>
+ <%= t("devise_views.registrations.edit.leave_blank") %>
+ <%= f.password_field :password, autocomplete: "off", placeholder: t("devise_views.registrations.edit.password_label") %>
+
+
+
+ <%= f.label :password_confirmation, t("devise_views.registrations.edit.password_confirmation_label") %>
+ <%= f.password_field :password_confirmation, autocomplete: "off", placeholder: t("devise_views.registrations.edit.password_confirmation_label") %>
+
+
+
+ <%= f.label :current_password, t("devise_views.registrations.edit.current_password_label") %>
+ <%= t("devise_views.registrations.edit.need_current") %>
+ <%= f.password_field :current_password, autocomplete: "off", placeholder: t("devise_views.registrations.edit.current_password_label") %>
+
+
+
+ <%= f.submit t("devise_views.registrations.edit.update_submit"), class: "button radius" %>
+
+
+ <% end %>
-
- <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
-
<%= t("devise_views.registrations.edit.waiting_for") %> <%= resource.unconfirmed_email %>
- <% end %>
-
-
- <%= f.label :password, t("devise_views.registrations.edit.password_label") %> <%= t("devise_views.registrations.edit.leave_blank") %>
- <%= f.password_field :password, autocomplete: "off" %>
-
-
-
- <%= f.label :password_confirmation, t("devise_views.registrations.edit.password_confirmation_label") %>
- <%= f.password_field :password_confirmation, autocomplete: "off" %>
-
-
-
- <%= f.label :current_password, t("devise_views.registrations.edit.current_password_label") %> <%= t("devise_views.registrations.edit.need_current") %>
- <%= f.password_field :current_password, autocomplete: "off" %>
-
-
-
- <%= f.submit t("devise_views.registrations.edit.update_submit") %>
-
-<% end %>
-
-
<%= t("devise_views.registrations.edit.cancel_title") %>
-
-
<%= t("devise_views.registrations.edit.cancel_text") %> <%= button_to t("devise_views.registrations.edit.cancel_link"), registration_path(resource_name), data: { confirm: t("devise_views.registrations.edit.cancel_confirm") }, method: :delete %>
-
-<%= link_to t("devise_views.registrations.edit.back_link"), :back %>
+
\ No newline at end of file
diff --git a/config/locales/devise_views.en.yml b/config/locales/devise_views.en.yml
index 7675a204e..ae778d00f 100644
--- a/config/locales/devise_views.en.yml
+++ b/config/locales/devise_views.en.yml
@@ -41,16 +41,12 @@ en:
edit: "Edit"
email_label: "Email"
waiting_for: "Currently waiting confirmation for:"
- leave_blank: "(leave blank if you don't want to change it)"
+ leave_blank: "Leave blank if you don't want to change it"
password_label: "New password"
password_confirmation_label: "Confirm new password"
current_password_label: "Current password"
- need_current: "(we need your current password to confirm your changes)"
+ need_current: "We need your current password to confirm your changes"
update_submit: "Update"
- cancel_title: "Cancel my account"
- cancel_text: "Unhappy?"
- cancel_link: "Cancel my account"
- cancel_confirm: "Are you sure?"
back_link: "Back"
new:
title: "Sign up"
diff --git a/config/locales/devise_views.es.yml b/config/locales/devise_views.es.yml
index 63e3159e0..647dd3237 100644
--- a/config/locales/devise_views.es.yml
+++ b/config/locales/devise_views.es.yml
@@ -41,16 +41,12 @@ es:
edit: "Editar"
email_label: "Email"
waiting_for: "Esperando confirmación de:"
- leave_blank: "(dejar en blanco si no deseas cambiarla)"
+ leave_blank: "Dejar en blanco si no deseas cambiarla"
password_label: "Contraseña nueva"
password_confirmation_label: "Confirmar contraseña nueva"
current_password_label: "Contraseña actual"
- need_current: "(necesitamos tu contraseña actual para confirmar los cambios)"
+ need_current: "Necesitamos tu contraseña actual para confirmar los cambios"
update_submit: "Actualizar"
- cancel_title: "Cancelar cuenta"
- cancel_text: "¿Deseas borrar tu cuenta?"
- cancel_link: "Cancelar mi cuenta"
- cancel_confirm: "¿Seguro?"
back_link: "Atrás"
new:
title: "Registrarse"
diff --git a/config/locales/es.yml b/config/locales/es.yml
index 6d877770d..2e2473a1a 100644
--- a/config/locales/es.yml
+++ b/config/locales/es.yml
@@ -63,9 +63,9 @@ es:
show:
title: "Mi cuenta"
save_changes_submit: "Guardar cambios"
+ change_credentials_link: "Cambiar mis credenciales"
email_on_debate_comment_label: "Recibir un email cuando alguien commenta en mis debates"
email_on_comment_reply_label: "Recibir un email cuando alguien contesta a mis comentarios"
- change_credentials_link: "Cambiar mi contraseña"
first_name_label: "Nombre"
last_name_label: "Apellidos"
use_nickname_label: "Usar pseudónimo"
diff --git a/spec/features/account_spec.rb b/spec/features/account_spec.rb
index e622c83c1..174145a7f 100644
--- a/spec/features/account_spec.rb
+++ b/spec/features/account_spec.rb
@@ -15,6 +15,20 @@ feature 'Account' do
expect(page).to have_selector("input[value='Colau']")
end
+ scenario "Failed Edit" do
+ login_as(@user)
+ visit account_path
+
+ fill_in 'account_first_name', with: ''
+ fill_in 'account_last_name', with: ''
+ fill_in 'account_nickname', with: ''
+ click_button 'Save changes'
+
+ expect(page).to have_content "2 errors prohibited this debate from being saved"
+ expect(page).to have_content "First name can't be blank"
+ expect(page).to have_content "First name can't be blank"
+ end
+
scenario 'Edit' do
login_as(@user)
visit account_path