diff --git a/Changelog.md b/Changelog.md index d03c2b298dd4ccd3f3d37123de82d01a63b09220..dc5d0b4370616176f3d6e471c88c7f393b2ddfbc 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,6 @@ # 0.0.2.0pre +Add password_confirmation field to registration page Fix error with open/close registrations. Fix javascripts error in invitations facebox. Fix css overflow problem in aspect dropdown on welcome page. diff --git a/app/assets/stylesheets/new_styles/_registration.scss b/app/assets/stylesheets/new_styles/_registration.scss index 8f15fbd74071a342b5191cbd5f28e9773426b00a..3be120d60de0bfbce1e0db19def46f062055944d 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/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index da18aeaa7f4dbc419326bbf20990b0ba0533cf9a..2823b4659edd69574ddd4d58d69cdbc415a72fdd 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -18,10 +18,10 @@ class RegistrationsController < Devise::RegistrationsController Rails.logger.info("event=registration status=successful user=#{@user.diaspora_handle}") else @user.errors.delete(:person) - + flash[:error] = @user.errors.full_messages.join(" - ") Rails.logger.info("event=registration status=failure errors='#{@user.errors.full_messages.join(', ')}'") - render :new + redirect_to :back end end @@ -50,6 +50,6 @@ class RegistrationsController < Devise::RegistrationsController @invite ||= InvitationCode.find_by_token(params[:invite][:token]) end end - + helper_method :invite end diff --git a/app/views/registrations/new.html.erb b/app/views/registrations/new.html.erb index e6bcf2cf729d99d7eeab0ed6d9a4c10d63ee8d0c..1d6ec1e70bb76f671f3e0f6b25fe16ef6c6fd7e5 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 => "......+" %> </div> </div> + + <div class="control-group"> + <label class="control-label" for="user_password_confirmation"> + <%= t('.password_confirmation') %> + </label> + + <div class="controls"> + <%= f.password_field :password_confirmation, :placeholder => "••••••••", :title => t('registrations.new.enter_password_again'), :required => true, :pattern => "......+" %> + </div> + </div> <%= invite_hidden_tag(invite) %> </fieldset> diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 618ec4619a17d4160663e35f1fb2cc0be4b58bcb..664646800a70f9e93a0e1d47b84b9f8b9dddea9f 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 aea71bc4cec18a5ee1de985f36b3457cbb1b930b..715447e62929824eea9785e785b1e81649fa1ca2 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 205443e2ebeabf466a43f466843bea71b422bcaa..5c7fb808ba966af0850e7ce6d58fd889cbc01596 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 2eacd960099eaf6a86b8f0f8760c70815864826f..4a34358fc0b220c57a20b6566e7ab336c9a0077c 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 diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb index 524aef41ec7561bb5c5df82e6fdfeda6fc7b080a..69a5f6059bba376db03042e9c4c9e88c5b951754 100644 --- a/spec/controllers/registrations_controller_spec.rb +++ b/spec/controllers/registrations_controller_spec.rb @@ -112,9 +112,9 @@ describe RegistrationsController do flash[:error].should_not be_blank end - it "re-renders the form" do + it "redirects back" do get :create, @invalid_params - response.should render_template("registrations/new") + response.should be_redirect end end end