redirect users back on registration failure
This commit is contained in:
parent
40f5314184
commit
82082005ba
2 changed files with 5 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue