redirect users back on registration failure
This commit is contained in:
parent
40f5314184
commit
82082005ba
2 changed files with 5 additions and 5 deletions
|
|
@ -21,7 +21,7 @@ class RegistrationsController < Devise::RegistrationsController
|
||||||
|
|
||||||
flash[:error] = @user.errors.full_messages.join(" - ")
|
flash[:error] = @user.errors.full_messages.join(" - ")
|
||||||
Rails.logger.info("event=registration status=failure errors='#{@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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,9 +112,9 @@ describe RegistrationsController do
|
||||||
flash[:error].should_not be_blank
|
flash[:error].should_not be_blank
|
||||||
end
|
end
|
||||||
|
|
||||||
it "re-renders the form" do
|
it "redirects back" do
|
||||||
get :create, @invalid_params
|
get :create, @invalid_params
|
||||||
response.should render_template("registrations/new")
|
response.should be_redirect
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue