[rspec-users] Odd response.body behavior

David Chelimsky dchelimsky at gmail.com
Tue Sep 25 08:24:08 EDT 2007


On 9/25/07, Luke Galea <galeal_lists at ideaforge.org> wrote:
> Sorry to bump myself here: But this behavior is really messing my
> tests up. If anyone has any insight I'd really appreciate it.
>
> Even in a debugger, the value of response.body is the name of the
> template rather than the content, but only in the test and only in a
> few cases. Works fine in dev.
>
> Perhaps it's a rails issue rather than an rspec issue?

I'm fairly certain this is a rails issue. When you see a response
object, it is the one provided by the Rails testing framework. In
fairness, there is some extension of response in rspec, but nothing
that changes the nature of response.body.

So I'd check w/ the rails list.

>
> -- Luke
>
> On 22-Sep-07, at 11:17 AM, Luke Galea wrote:
>
> > Hi all,
> >
> > I'm having very odd behavior, but only with a few of my specs.
> >
> > I'm checking the value of response.body and in most cases finding it
> > to be the content of the body... but in some cases it's the name of
> > the template rendered!! There's no rhyme or reason I can see, but
> > obviously my tests fail for no reason when I expect the body to
> > contain the content.
> >
> > Any idea what is happening?
> >
> > Thanks in advance!
> >
> > Luke
> > _______________________________________________
> > 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