[rspec-users] Rails Rendering diagnostics.rhtml in Controller Spec

David Chelimsky dchelimsky at gmail.com
Wed May 23 17:36:28 EDT 2007


On 5/23/07, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:
> On 5/23/07, Ryan Bates <bates.ryan at gmail.com> wrote:
> > Forgive me if this isn't the proper list. It's specific to the rSpec
> > Rails plugin.
> >
> > The problem is, some controller actions are rendering the
> > "diagnostics.rhtml" template when I'm expecting it to render something
> > else in a controller spec. I'm assuming this is the template that
> > displays the error message and a stack trace when an error is raised
> > in the development environment.
> >
>
> class ActionController::Base
>   def rescue_action(e) raise; end
> end
>
> > Is there anyway to see the error through rspec instead of the
> > controller just rendering the diagnostics.rhtml template? I'm
> > surprised this would even be rendered in the test environment.
> >
>
> Would it be a good idea to make this the default behaviour when running specs?

No. We used to, but changed it in response to a bug report
(http://rubyforge.org/tracker/?func=detail&group_id=797&aid=9767&atid=3149)

>
> Does vanilla Rails do that?

Not exactly. It puts it explicitly in generated controller specs. So
by default, yes, but implicitly, no.

>
> Aslak
>
> > Thanks,
> >
> > Ryan
> > _______________________________________________
> > rspec-users mailing list
> > rspec-users at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/rspec-users
> >
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list