From 40f53141843827678a584d015079281a04180b47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A1n=20Rodr=C3=ADguez?= Date: Thu, 11 Oct 2012 19:45:52 -0200 Subject: [PATCH] adds password_confirmation field to registration page --- .../stylesheets/new_styles/_registration.scss | 14 +++++++++++++- app/views/registrations/new.html.erb | 10 ++++++++++ config/locales/diaspora/en.yml | 1 + features/accepts_invitation.feature | 2 ++ features/signs_up.feature | 7 ++++--- features/step_definitions/user_steps.rb | 1 + 6 files changed, 31 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/new_styles/_registration.scss b/app/assets/stylesheets/new_styles/_registration.scss index 8f15fbd74..3be120d60 100644 --- a/app/assets/stylesheets/new_styles/_registration.scss +++ b/app/assets/stylesheets/new_styles/_registration.scss @@ -39,4 +39,16 @@ max-width : 95%; } -} \ No newline at end of file + + form { + .control-label, + .controls { + margin-left : auto; + width : auto; + } + + .controls { + float : right; + } + } +} diff --git a/app/views/registrations/new.html.erb b/app/views/registrations/new.html.erb index e6bcf2cf7..1d6ec1e70 100644 --- a/app/views/registrations/new.html.erb +++ b/app/views/registrations/new.html.erb @@ -50,6 +50,16 @@ <%= f.password_field :password, :placeholder => "••••••••", :title => t('registrations.new.enter_password'), :required => true, :pattern => "......+" %> + +
+ + +
+ <%= f.password_field :password_confirmation, :placeholder => "••••••••", :title => t('registrations.new.enter_password_again'), :required => true, :pattern => "......+" %> +
+
<%= invite_hidden_tag(invite) %> diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 618ec4619..664646800 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -687,6 +687,7 @@ en: email: "EMAIL" username: "USERNAME" password: "PASSWORD" + password_confirmation: "PASSWORD CONFIRMATION" continue: "Continue" create: success: "You've joined Diaspora!" diff --git a/features/accepts_invitation.feature b/features/accepts_invitation.feature index aea71bc4c..715447e62 100644 --- a/features/accepts_invitation.feature +++ b/features/accepts_invitation.feature @@ -7,6 +7,7 @@ Feature: invitation acceptance | user_username | ohai | | user_email | woot@sweet.com | | user_password | secret | + | user_password_confirmation | secret | And I press "Continue" Then I should be on the getting started page And I should see "Well, hello there!" @@ -24,6 +25,7 @@ Feature: invitation acceptance | user_username | ohai | | user_email | woot@sweet.com | | user_password | secret | + | user_password_confirmation | secret | And I press "Continue" Then I should be on the getting started page And I should see "Well, hello there!" diff --git a/features/signs_up.feature b/features/signs_up.feature index 205443e2e..5c7fb808b 100644 --- a/features/signs_up.feature +++ b/features/signs_up.feature @@ -4,9 +4,10 @@ Feature: new user registration Background: When I go to the new user registration page And I fill in the following: - | user_username | ohai | - | user_email | ohai@example.com | - | user_password | secret | + | user_username | ohai | + | user_email | ohai@example.com | + | user_password | secret | + | user_password_confirmation | secret | And I press "Continue" Then I should be on the getting started page And I should see "Well, hello there!" and "Who are you?" and "What are you into?" diff --git a/features/step_definitions/user_steps.rb b/features/step_definitions/user_steps.rb index 2eacd9600..4a34358fc 100644 --- a/features/step_definitions/user_steps.rb +++ b/features/step_definitions/user_steps.rb @@ -209,6 +209,7 @@ When /^I fill in the new user form$/ do step 'I fill in "user_username" with "ohai"' step 'I fill in "user_email" with "ohai@example.com"' step 'I fill in "user_password" with "secret"' + step 'I fill in "user_password_confirmation" with "secret"' end And /^I should be able to friend Alice$/ do