[LRUG] redirect_to with additional parameters

Will Tomlins will.tomlins at unboxedconsulting.com
Thu Apr 29 01:54:01 PDT 2010


No problem.  Re prev question, I was using cucumber to test that a link 
was redirecting through to a page with a query string:

When I follow "a link"
Then I should be on the search page with search terms "london"

And I was getting:

expected "/search?terms=london"
got "/search"

After a bit of hair pulling, I found out that the 'Then I should be on' 
step was removing the query string before testing the path.  This might 
have been changed in later versions of cucumber but I haven't tried.

I was just wondering if you were having the same issue... guess not.


Will



On 28/04/2010 17:18, Riccardo Tacconi wrote:
> Ok, Thanks Will, I will check that. I am not sure I understood your 
> prev. question:
>
> "This might be a complete red herring, but I've had issues with the 
> query string being dropped from a path with automated tests. Did you 
> you try it in a browser?"
>
> Do you mean trying the redirect in my broswser? Yes, I am testing it 
> with the browser.
>
> On Wed, Apr 28, 2010 at 5:11 PM, Will Tomlins 
> <will.tomlins at unboxedconsulting.com 
> <mailto:will.tomlins at unboxedconsulting.com>> wrote:
>
>     :status is a reserved keyword, it's used to set the status code
>     (404 etc.)  That's probably why it's not working.
>
>
>
>
>     On 28/04/2010 17:08, Riccardo Tacconi wrote:
>>     yes there are nil I did not check that but now I get:
>>
>>      You are being redirected
>>     <http://localhost:3000/management/questions/120?participant_id=95>.
>>
>>     On Wed, Apr 28, 2010 at 4:53 PM, Matthew Rudy Jacobs
>>     <matthewrudyjacobs at gmail.com
>>     <mailto:matthewrudyjacobs at gmail.com>> wrote:
>>
>>         that should work
>>         are params[:status] and params[:participant] nil in your
>>         use-case?
>>
>>         On 28 April 2010 23:51, Riccardo Tacconi <rtacconi at gmail.com
>>         <mailto:rtacconi at gmail.com>> wrote:
>>
>>             With this code:
>>
>>                     redirect_to(
>>                       :controller => "management",
>>                       :action => "questions",
>>                       :id => @question.configuration_id,
>>                       :participant_id => params[:participant_id],
>>                       :status => params[:status]
>>                     )
>>
>>             I am trying to redirect to a url similar to this one:
>>             http://localhost:3000/management/questions/120?participant_id=95&status=HOST_INBOX
>>             <http://localhost:3000/management/questions/120?participant_id=95&status=HOST_INBOX>
>>
>>             But I get redirected to:
>>             http://localhost:3000/management/questions/120
>>
>>             >From Rails's API seems that it is possible to have that
>>             redirect only using:
>>
>>                     redirect_to(
>>                      
>>             "/management/answers/8742?participant_id=95&status=HOST_INBOX_READ"
>>                     )
>>
>>             Is that correct?
>>
>>             Thanks,
>>
>>             -- 
>>             Riccardo Tacconi
>>             Web developer at Wolseley UK
>>             VIRTUELOGIC LIMITED (Director)
>>
>>             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 <mailto:Chat at lists.lrug.org>
>>             http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>>
>>
>>
>>         _______________________________________________
>>         Chat mailing list
>>         Chat at lists.lrug.org <mailto:Chat at lists.lrug.org>
>>         http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>>
>>
>>
>>
>>     -- 
>>     Riccardo Tacconi
>>     Web developer at Wolseley UK
>>     VIRTUELOGIC LIMITED (Director)
>>
>>     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  <mailto:Chat at lists.lrug.org>
>>     http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>>        
>
>
>     _______________________________________________
>     Chat mailing list
>     Chat at lists.lrug.org <mailto:Chat at lists.lrug.org>
>     http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
>
>
>
> -- 
> Riccardo Tacconi
> Web developer at Wolseley UK
> VIRTUELOGIC LIMITED (Director)
>
> 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/20100429/485e42b1/attachment-0003.html>


More information about the Chat mailing list