<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><html>On Apr 11, 2008, at 3:53 PM, Olivier Dupuis wrote:</html><br class="Apple-interchange-newline"><blockquote type="cite">Sorry about that. Here goes...<br><br>Spec:<br><br><i>describe "/search/index" do <br> it "should have option to login" do<br> render "/search/index"<br> response.should have_text(/Login/)<br> end<br>end</i><br><br>Code for index.rhtml<br><br><i><body> <br> <div id="container"> <br> <div id="main_footer" align="center"><br> <%= render_component :controller => "components", :action => "footer", :params => { :lang => @language } %> <br> </div><br> </div><br></body></i><br><br>Code for footer.rhtml<br><br><i><% listOfParameters = "" %><br><% request.params.each do |param| %><br> <% if param[0].to_s != "lang" %><br> <% listOfParameters = listOfParameters + "&" + param[0].to_s + "=" + param[1].to_s %><br> <% end %><br><% end %><br><br>...</i><br><br>Now the error message:<br><br><i>ActionView::TemplateError in '/search/index should have option to login'<br> undefined method 'params' for #<ActionController::TestRequest:0x46a044c><br>On line #7 of app/views/components/footer.rhtml<br><br></i><i>6: <% listOfParameters = "" %><br>7: <% request.params.each do |param| %></i></blockquote><div><br></div><div>Try just params (not request.params) - does that work?</div><br><blockquote type="cite"><i><br> 8: <% if param[0].to_s != "lang" %><br>9: <% listOfParameters = listOfParameters + "&" + param[0].to_s + "=" + param[1].to_s %><br>10: <% end %><br>11: <% end %><br> <br><br></i>Thanks again<br><br>Olivier Dupuis<br><br><br><div class="gmail_quote">On Fri, Apr 11, 2008 at 3:26 PM, David Chelimsky <<a href="mailto:dchelimsky@gmail.com">dchelimsky@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Please post spec, code and error message.<br> <div><div></div><div class="Wj3C7c"><br> On Apr 11, 2008, at 3:21 PM, Olivier Dupuis wrote:<br> <br> > Hello,<br> ><br> > I have a rhtml file that goes through the request.params. One of my<br> > test generates that file, but rspec pops an error saying :<br> ><br> > undefined method 'params' for ...<br> ><br> > I'm not sure what to do with this, since request.params actually<br> > works with rails.<br> ><br> > Any idea?<br> ><br> > Thank you<br> ><br> > Olivier Dupuis<br> </div></div>> _______________________________________________<br> > rspec-users mailing list<br> > <a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br> > <a href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank">http://rubyforge.org/mailman/listinfo/rspec-users</a><br> <br> _______________________________________________<br> rspec-users mailing list<br> <a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br> <a href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank">http://rubyforge.org/mailman/listinfo/rspec-users</a><br> </blockquote></div><br> _______________________________________________<br>rspec-users mailing list<br><a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br>http://rubyforge.org/mailman/listinfo/rspec-users</blockquote></div><br></body></html>