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? R?mi -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100611/055a86c7/attachment.html>
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>
I''m on rails 2.3.5 with rspec 1.3.0, rspec 1.3.2 No, the route def is not aware of these extra params, but it works. But I''m not sure it is clean though. If not, I searched to specify these params in the route, with no sucess. Regards On Fri, Jun 11, 2010 at 11:20 AM, David Chelimsky <dchelimsky at gmail.com>wrote:> 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? > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100611/203d8f60/attachment-0001.html>
Sorry I mean rails 2.3.5 with rspec 1.3.0, rspec-rails 1.3.2 On Fri, Jun 11, 2010 at 11:37 AM, Remi Gagnon <rem.gagnon at gmail.com> wrote:> I''m on rails 2.3.5 with rspec 1.3.0, rspec 1.3.2 > > No, the route def is not aware of these extra params, but it works. But > I''m not sure it is clean though. If not, I searched to specify these params > in the route, with no sucess. > > Regards > > On Fri, Jun 11, 2010 at 11:20 AM, David Chelimsky <dchelimsky at gmail.com>wrote: > >> 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? >> >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100611/b55d5b9f/attachment.html>