[rspec-users] controller.should_receive(:render) problem
dchelimsky at gmail.com
Tue Jul 20 07:41:55 EDT 2010
On Jul 12, 2010, at 4:18 AM, Ruprict wrote:
> My issue is similar to the one in this post:
> (which, btw, I could not reply to...only option was "Reply to Author")
> where I have a RESTful controller. I want create to redirect/render
> the new action if the model fails to save with the supplied form
> values. Pretty basic and typical stuff.
> In Rails, if I use
> then the entered values along with the error_messages on the object
> are lost and I can't re-fill the form or list the errors. If I use
> render :action => "new"
> then I keep all the request data and can use it to fill in form, etc.
> In my spec, if I use
> I get an expectation error that render is never called. This is true
> if I remove the .with() as well.
> If y'all could let me know either 1) Why my redirect_to vs render
> argument is flawed and/or 2) What I am doing wrong in the spec, I'd
> appreciate it.
Please post the code in the failing spec and the new action, along with the backtrace of the error you're getting.
More information about the rspec-users