fixes failing i18n specs
Eliminates registering_with_oauth attr_accessor ELIMINATE Conflicts: app/views/users/registrations/finish_signup.html.erb improves devise confirmation message improves devise omniauth confirmation message improves devise omniauth confirmation message do not use nils on finish_signup fields Fixes auth specs after changing the i18n
This commit is contained in:
@@ -39,7 +39,6 @@ class User < ActiveRecord::Base
|
|||||||
accepts_nested_attributes_for :organization, update_only: true
|
accepts_nested_attributes_for :organization, update_only: true
|
||||||
|
|
||||||
attr_accessor :skip_password_validation
|
attr_accessor :skip_password_validation
|
||||||
attr_accessor :registering_with_oauth
|
|
||||||
|
|
||||||
scope :administrators, -> { joins(:administrators) }
|
scope :administrators, -> { joins(:administrators) }
|
||||||
scope :moderators, -> { joins(:moderator) }
|
scope :moderators, -> { joins(:moderator) }
|
||||||
|
|||||||
@@ -1,25 +1,19 @@
|
|||||||
<div class="auth row">
|
<h2><%= t('omniauth.finish_signup.title') %></h2>
|
||||||
<div class="small-12 medium-8 large-5 column small-centered">
|
|
||||||
<div class="panel">
|
|
||||||
<h1><%= t('omniauth.finish_signup.title') %></h1>
|
|
||||||
|
|
||||||
<%= form_for current_user, as: :user, url: do_finish_signup_path, html: { role: 'form'} do |f| %>
|
<%= form_for current_user, as: :user, url: do_finish_signup_path, html: { role: 'form'} do |f| %>
|
||||||
<%= render 'shared/errors', resource: current_user %>
|
<%= render 'shared/errors', resource: current_user %>
|
||||||
|
|
||||||
<% if current_user.errors.include? :username %>
|
<% if current_user.errors.include? :username %>
|
||||||
<%= f.text_field :username, placeholder: t("devise_views.users.registrations.new.username_label"), value: nil %>
|
<%= f.text_field :username, placeholder: t("devise_views.users.registrations.new.username_label") %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= f.hidden_field :username %>
|
<%= f.hidden_field :username %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if current_user.errors.include? :email %>
|
<% if current_user.errors.include? :email %>
|
||||||
<%= f.email_field :email, placeholder: t("devise_views.users.registrations.new.email_label"), value: nil %>
|
<%= f.email_field :email, placeholder: t("devise_views.users.registrations.new.email_label") %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= f.hidden_field :email %>
|
<%= f.hidden_field :email %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= f.submit t("devise_views.users.registrations.new.submit"), class: 'button radius expand' %>
|
<%= f.submit t("devise_views.users.registrations.new.submit"), class: 'button radius expand' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ en:
|
|||||||
not_found_in_database: "Invalid %{authentication_keys} or password."
|
not_found_in_database: "Invalid %{authentication_keys} or password."
|
||||||
timeout: "Your session has expired. Please sign in again to continue."
|
timeout: "Your session has expired. Please sign in again to continue."
|
||||||
unauthenticated: "You must sign in or register to continue."
|
unauthenticated: "You must sign in or register to continue."
|
||||||
unconfirmed: "You must confirm your account to continue."
|
unconfirmed: "To continue, please click on the confirmation link that we have sent you via email"
|
||||||
mailer:
|
mailer:
|
||||||
confirmation_instructions:
|
confirmation_instructions:
|
||||||
subject: "Confirmation instructions"
|
subject: "Confirmation instructions"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
es:
|
es:
|
||||||
devise:
|
devise:
|
||||||
confirmations:
|
confirmations:
|
||||||
confirmed: "Tu cuenta ha sido confirmada."
|
confirmed: "Tu cuenta ha sido confirmada. Por favor autentifícate con tu red social o tu usuario y contraseña"
|
||||||
send_instructions: "Recibirás un correo electrónico en unos minutos con instrucciones sobre cómo restablecer tu contraseña."
|
send_instructions: "Recibirás un correo electrónico en unos minutos con instrucciones sobre cómo restablecer tu contraseña."
|
||||||
send_paranoid_instructions: "Si tu correo electrónico existe en nuestra base de datos recibirás un correo electrónico en unos minutos con instrucciones sobre cómo restablecer tu contraseña."
|
send_paranoid_instructions: "Si tu correo electrónico existe en nuestra base de datos recibirás un correo electrónico en unos minutos con instrucciones sobre cómo restablecer tu contraseña."
|
||||||
failure:
|
failure:
|
||||||
@@ -13,7 +13,7 @@ es:
|
|||||||
not_found_in_database: "%{authentication_keys} o contraseña inválidos."
|
not_found_in_database: "%{authentication_keys} o contraseña inválidos."
|
||||||
timeout: "Tu sesión ha expirado, por favor inicia sesión nuevamente para continuar."
|
timeout: "Tu sesión ha expirado, por favor inicia sesión nuevamente para continuar."
|
||||||
unauthenticated: "Necesitas iniciar sesión o registrarte para continuar."
|
unauthenticated: "Necesitas iniciar sesión o registrarte para continuar."
|
||||||
unconfirmed: "Debes confirmar tu cuenta para continuar."
|
unconfirmed: "Para continuar, por favor pulsa en el enlace de confirmación que hemos enviado a tu cuenta de correo."
|
||||||
mailer:
|
mailer:
|
||||||
confirmation_instructions:
|
confirmation_instructions:
|
||||||
subject: "Instrucciones de confirmación"
|
subject: "Instrucciones de confirmación"
|
||||||
@@ -22,8 +22,8 @@ es:
|
|||||||
unlock_instructions:
|
unlock_instructions:
|
||||||
subject: "Instrucciones de desbloqueo"
|
subject: "Instrucciones de desbloqueo"
|
||||||
omniauth_callbacks:
|
omniauth_callbacks:
|
||||||
failure: "No se te ha podido autorizar de %{kind} debido a \"%{reason}\"."
|
failure: "No se te ha podido identificar via %{kind} por el siguiente motivo: \"%{reason}\"."
|
||||||
success: "Identificado correctamente de %{kind}."
|
success: "Identificado correctamente via %{kind}."
|
||||||
passwords:
|
passwords:
|
||||||
no_token: "No puedes acceder a esta página si no es a través de un enlace para restablecer la contraseña. Si has accedido desde el enlace para restablecer la contraseña, asegúrate de que la URL esté completa."
|
no_token: "No puedes acceder a esta página si no es a través de un enlace para restablecer la contraseña. Si has accedido desde el enlace para restablecer la contraseña, asegúrate de que la URL esté completa."
|
||||||
send_instructions: "Recibirás un correo electrónico con instrucciones sobre cómo restablecer tu contraseña en unos minutos."
|
send_instructions: "Recibirás un correo electrónico con instrucciones sobre cómo restablecer tu contraseña en unos minutos."
|
||||||
|
|||||||
@@ -477,13 +477,12 @@ en:
|
|||||||
facebook:
|
facebook:
|
||||||
sign_in: "Sign in with Facebook"
|
sign_in: "Sign in with Facebook"
|
||||||
sign_up: "Sign up with Facebook"
|
sign_up: "Sign up with Facebook"
|
||||||
#google_oauth2:
|
google_oauth2:
|
||||||
# sign_in: "Sign in with Google"
|
sign_in: "Sign in with Google"
|
||||||
# sign_up: "Sign up with Google"
|
sign_up: "Sign up with Google"
|
||||||
legislation:
|
legislation:
|
||||||
help:
|
help:
|
||||||
title: "How I can comment this document?"
|
title: "How I can comment this document?"
|
||||||
text_logged: "Select the text you want to comment and press the button with the pencil."
|
|
||||||
text: "To comment this document you must %{sign_in} or %{sign_up}. Then select the text you want to comment and press the button with the pencil."
|
text: "To comment this document you must %{sign_in} or %{sign_up}. Then select the text you want to comment and press the button with the pencil."
|
||||||
text_sign_in: "login"
|
text_sign_in: "login"
|
||||||
text_sign_up: "sign up"
|
text_sign_up: "sign up"
|
||||||
|
|||||||
@@ -477,13 +477,12 @@ es:
|
|||||||
facebook:
|
facebook:
|
||||||
sign_in: "Entra con Facebook"
|
sign_in: "Entra con Facebook"
|
||||||
sign_up: "Regístrate con Facebook"
|
sign_up: "Regístrate con Facebook"
|
||||||
#google_oauth2:
|
google_oauth2:
|
||||||
# sign_in: "Entra con Google"
|
sign_in: "Entra con Google"
|
||||||
# sign_up: "Regístrate con Google"
|
sign_up: "Regístrate con Google"
|
||||||
legislation:
|
legislation:
|
||||||
help:
|
help:
|
||||||
title: "¿Cómo puedo comentar este documento?"
|
title: "¿Cómo puedo comentar este documento?"
|
||||||
text_logged: "Selecciona el texto que quieres comentar y pulsa en el botón con el lápiz."
|
|
||||||
text: "Para comentar este documento debes %{sign_in} o %{sign_up}. Después selecciona el texto que quieres comentar y pulsa en el botón con el lápiz."
|
text: "Para comentar este documento debes %{sign_in} o %{sign_up}. Después selecciona el texto que quieres comentar y pulsa en el botón con el lápiz."
|
||||||
text_sign_in: "iniciar sesión"
|
text_sign_in: "iniciar sesión"
|
||||||
text_sign_up: "registrarte"
|
text_sign_up: "registrarte"
|
||||||
|
|||||||
@@ -101,6 +101,8 @@ feature 'Users' do
|
|||||||
fill_in 'user_email', with: 'manueladelascarmenas@example.com'
|
fill_in 'user_email', with: 'manueladelascarmenas@example.com'
|
||||||
click_button 'Register'
|
click_button 'Register'
|
||||||
|
|
||||||
|
expect(page).to have_content "To continue, please click on the confirmation link that we have sent you via email"
|
||||||
|
|
||||||
confirm_email
|
confirm_email
|
||||||
|
|
||||||
expect(page).to have_content "Your email address has been successfully confirmed"
|
expect(page).to have_content "Your email address has been successfully confirmed"
|
||||||
@@ -173,7 +175,7 @@ feature 'Users' do
|
|||||||
fill_in 'user_email', with: 'somethingelse@example.com'
|
fill_in 'user_email', with: 'somethingelse@example.com'
|
||||||
click_button 'Register'
|
click_button 'Register'
|
||||||
|
|
||||||
expect(page).to have_content "You must confirm your account to continue"
|
expect(page).to have_content "To continue, please click on the confirmation link that we have sent you via email"
|
||||||
|
|
||||||
confirm_email
|
confirm_email
|
||||||
expect(page).to have_content "Your account has been confirmed"
|
expect(page).to have_content "Your account has been confirmed"
|
||||||
|
|||||||
Reference in New Issue
Block a user