Weird error message

0 views
Skip to first unread message

Jonzo

unread,
Mar 24, 2008, 5:37:38 PM3/24/08
to Ruby on Rails: Talk
Hi, as I add more and more tests I sometimes get this error:

Expected response to be a <:success>, but was <0>

I'm a little lost as to what it means... no response? error? But it
seems to come and go as I change code. I never quite figured out why
though.

Thanks for any help :-)
Jonzo.

Jonzo

unread,
Mar 25, 2008, 8:23:24 PM3/25/08
to Ruby on Rails: Talk
Hi I'm still having trouble with this, has anyone ever seen this
message before?

fyi, I'm still using rails 1.2.3 till I can get time to make the move
to 2.0. It might not be in the latest version, but I'd still like to
know if anyone has seen this message before.. ever

Thanks again,
Jonzo.

On Mar 25, 10:37 am, Jonzo <j.fant...@gmail.com> wrote:
> Hi, as I add more and more tests I sometimes get thiserror:
>
> Expected response to be a <:success>, but was <0>
>
> I'm a little lost as to what it means... no response?error? But it

s.ross

unread,
Mar 25, 2008, 9:50:15 PM3/25/08
to rubyonra...@googlegroups.com

When you get a 0 instead of an HTTP response code, the page probably
didn't render correctly. Look at your test.log or, in your test:

puts response.body

That may give you a better idea what's going on.

Jonathan Fantham

unread,
Mar 25, 2008, 9:54:31 PM3/25/08
to rubyonra...@googlegroups.com
Thanks! I'll look into that.

Do you know anything more about this? I ask because usually when I
have an error in a template or action it is output as an exception in
the test summary. Does this error show up when there is a specific
type of error? for instance, if rails locks up? or if it fails in a
before_filter? or something?

--
Jonathan

s.ross

unread,
Mar 25, 2008, 10:01:56 PM3/25/08
to rubyonra...@googlegroups.com
On Mar 25, 2008, at 6:54 PM, Jonathan Fantham wrote:
> Do you know anything more about this? I ask because usually when I
> have an error in a template or action it is output as an exception in
> the test summary. Does this error show up when there is a specific
> type of error? for instance, if rails locks up? or if it fails in a
> before_filter? or something?

I've never characterized the problems that cause this beyond the fact
that it happens when testing controllers. The key thing is you didn't
get an HTTP response code. So you know you didn't get through render,
which makes it likely that your code is flawed. That's really the
first thing you wanted to know from your test anyway, right?

Jonathan Fantham

unread,
Mar 25, 2008, 10:04:45 PM3/25/08
to rubyonra...@googlegroups.com
Ok cool, I'll update this thread when I figure it out :-)

--
Jonathan

Jonathan Fantham

unread,
Mar 25, 2008, 11:48:56 PM3/25/08
to rubyonra...@googlegroups.com
Found the problem! I had monkey patched CGI::Session to allow flash to
provide a session id, but I'd moved the file around in my lib
directory so it wasn't loading properly, and rails was dying before it
even got to my application!

all fixed now,
Thanks for your help s.ross :-)

--
Jonathan

Reply all
Reply to author
Forward
0 new messages