[LRUG] Expected response to be a <:redirect>, but was <200> when using should_redirect_to

Matthew Rudy Jacobs matthewrudyjacobs at gmail.com
Mon Jul 26 10:21:27 PDT 2010


have you used debugger?
I suggest you see what the content actually looks like

in particular response.body

perhaps its actually some error page that is being displayed
and erroneously returning a 200

ie.
check what your output is exactly
before saying the assertion is broken.

most likely its the code thats broken.

On 26 July 2010 18:17, Riccardo Tacconi <rtacconi at gmail.com> wrote:

> I do not know if the test sends Accept text/html but I removed respond_to
> .html and left only the redirect, so it should redirect for every type of
> content, but I get the same message.
>
> Thanks,
>
> Riccardo
>
>
> On 26 July 2010 18:08, Tim Cowlishaw <tim at timcowlishaw.co.uk> wrote:
>
>>
>> On 26 Jul 2010, at 18:05, Riccardo Tacconi wrote:
>>
>> >
>> > Expected response to be a <:redirect>, but was <200>
>> >
>> > But why? That method really return a 302 (redirrect) method. Do I miss
>> something?
>>
>> does the request that your test sends have an Accepts header of text/html?
>> Since the redirect is within the respond_to html block, I think it would
>> return 200 for any other content types.
>>
>> Cheers,
>>
>> Tim
>> _______________________________________________
>> Chat mailing list
>> Chat at lists.lrug.org
>> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>>
>
>
>
> --
> Riccardo Tacconi
> Web developer at Wolseley UK
>
> http://www.linkedin.com/in/riccardotacconi
> http://riccardotacconi.blogspot.com/
> http://twitter.com/rtacconi
> Linux user: #400461
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20100726/dc56dccb/attachment-0003.html>


More information about the Chat mailing list