[rspec-users] RoutingError in spec for helper
David Chelimsky
dchelimsky at gmail.com
Fri Jun 11 11:20:43 EDT 2010
On Jun 11, 2010, at 9:34 AM, Remi Gagnon wrote:
> Hi,
>
> Its maybe not related to rspec but I can't figure out how to fix it. Here is,
>
> In my helper(Rails) I got the piece of code :
>
> sortie += link_to(entete_colonne + " " + image_sens_tri,client_journal_activites_path(:ordre_tri => nom_colonne, :sens_tri => params[:sens_tri],:filtre => params[:filtre]))
>
>
> When I run the spec on this I got the following error. Looks like rspec does not like extra params on the generated route url, I thought it was clean to do that.
>
>
> ActionController::RoutingError: client_journal_activites_url failed to generate from {:controller=>"journal_activites", :action=>"index", :filtre=>"XX", :ordre_tri=>"DATE", :sens_tri=>"DESC"}, expected: {:controller=>"journal_activites", :action=>"index"}, diff: {:filtre=>"XX", :ordre_tri=>"DATE", :sens_tri=>"DESC"}
> (eval):20:in `client_journal_activites_path'
> C:/WorkspacesSVN/Cautionnement/app/helpers/journal_activites_helper.rb:43:in `afficher_entete_colonne_activites'
> C:/WorkspacesSVN/Cautionnement/spec/helpers/journal_activites_helper_spec.rb:34:in `send'
> C:/WorkspacesSVN/Cautionnement/spec/helpers/journal_activites_helper_spec.rb:34
> C:/WorkspacesSVN/Cautionnement/script/spec:10
> C:\ruby\bin/rdebug-ide:19:in `load'
>
> Any suggestions?
What versions of rspec/rails are you talking about?
Does the route definition know what to do with the extra params?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100611/c24cf858/attachment.html>
More information about the rspec-users
mailing list