redirect users back on registration failure

This commit is contained in:
Fabián Rodríguez 2012-10-11 19:47:04 -02:00
parent 40f5314184
commit 82082005ba
2 changed files with 5 additions and 5 deletions

View file

@ -21,7 +21,7 @@ class RegistrationsController < Devise::RegistrationsController
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

View file

@ -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