It unfortunately access the wrong parameters.&nbsp; Instead of accessing the parameters from my url request, it access the parameters from my render_component.<br><br>For example, my request is<br><i><a href="http://localhost:4000/search/results?author=&amp;keyword=&amp;page=1&amp;publisher=&amp;title=agile">http://localhost:4000/search/results?author=&amp;keyword=&amp;page=1&amp;publisher=&amp;title=agile</a></i><br>
<br>In that results view, I render this component<br><i>&lt;%= render_component :controller =&gt; &quot;components&quot;, :action =&gt; &quot;footer&quot;, :params =&gt; { :lang =&gt; @language } %&gt;</i><br><br>So in the footer component, when I execute<br>
<i>&lt;% request.params.each do |param| %&gt;</i><br>it goes through the params from <i><a href="http://localhost:4000/search/results?author=&amp;keyword=&amp;page=1&amp;publisher=&amp;title=agile">http://localhost:4000/search/results?author=&amp;keyword=&amp;page=1&amp;publisher=&amp;title=agile</a><br>
<br></i>But if I execute<br><i>&lt;% params.each do |param| %&gt;<br></i>it goes through the params from <i>&lt;%= render_component :controller =&gt; &quot;components&quot;, :action =&gt; &quot;footer&quot;, :params =&gt; { :lang =&gt; @language } %&gt;<br>
<br></i>My test passes when I use only <i>params.each</i> but not when I use <i>request.params.each<br><br></i>Thanks again<br><br>Olivier Dupuis<br><br><div class="gmail_quote">On Fri, Apr 11, 2008 at 4:05 PM, David Chelimsky &lt;<a href="mailto:dchelimsky@gmail.com">dchelimsky@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style=""><div><div><div></div><div class="Wj3C7c">On Apr 11, 2008, at 3:53 PM, Olivier Dupuis wrote:<br>
<blockquote type="cite">Sorry about that.&nbsp; Here goes...<br><br>Spec:<br><br><i>describe &quot;/search/index&quot; do  <br>&nbsp; it &quot;should have option to login&quot; do<br>&nbsp;&nbsp;&nbsp; render &quot;/search/index&quot;<br>&nbsp;&nbsp;&nbsp; response.should have_text(/Login/)<br>
 &nbsp; end<br>end</i><br><br>Code for index.rhtml<br><br><i>&lt;body&gt;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;div id=&quot;container&quot;&gt;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;div id=&quot;main_footer&quot; align=&quot;center&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;%= render_component :controller =&gt; &quot;components&quot;, :action =&gt; &quot;footer&quot;, :params =&gt; { :lang =&gt; @language } %&gt;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/div&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/div&gt;<br>&lt;/body&gt;</i><br><br>Code for footer.rhtml<br><br><i>&lt;% listOfParameters = &quot;&quot; %&gt;<br>&lt;% request.params.each do |param| %&gt;<br>&nbsp;&nbsp;&nbsp; &lt;% if param[0].to_s != &quot;lang&quot; %&gt;<br>
 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;% listOfParameters = listOfParameters + &quot;&amp;&quot; + param[0].to_s + &quot;=&quot; + param[1].to_s %&gt;<br>&nbsp;&nbsp;&nbsp; &lt;% end %&gt;<br>&lt;% end %&gt;<br><br>...</i><br><br>Now the error message:<br><br><i>ActionView::TemplateError in &#39;/search/index should have option to login&#39;<br>
 undefined method &#39;params&#39; for #&lt;ActionController::TestRequest:0x46a044c&gt;<br>On line #7 of app/views/components/footer.rhtml<br><br></i><i>6: &lt;% listOfParameters = &quot;&quot; %&gt;<br>7: &lt;% request.params.each do |param| %&gt;</i></blockquote>
<div><br></div></div></div><div>Try just params (not request.params) - does that work?</div><div><div></div><div class="Wj3C7c"><br><blockquote type="cite"><i><br> 8:&nbsp; &nbsp;&nbsp; &lt;% if param[0].to_s != &quot;lang&quot; %&gt;<br>
9: &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &lt;% listOfParameters = listOfParameters + &quot;&amp;&quot; + param[0].to_s + &quot;=&quot; + param[1].to_s %&gt;<br>10:&nbsp; &nbsp;&nbsp; &lt;% end %&gt;<br>11: &lt;% end %&gt;<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 &lt;<a href="mailto:dchelimsky@gmail.com" target="_blank">dchelimsky@gmail.com</a>&gt; 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><br> On Apr 11, 2008, at 3:21 PM, Olivier Dupuis wrote:<br> <br> &gt; Hello,<br> &gt;<br> &gt; I have a rhtml file that goes through the request.params. &nbsp;One of my<br>
 &gt; test generates that file, but rspec pops an error saying :<br> &gt;<br> &gt; undefined method &#39;params&#39; for ...<br> &gt;<br> &gt; I&#39;m not sure what to do with this, since request.params actually<br> &gt; works with rails.<br>
 &gt;<br> &gt; Any idea?<br> &gt;<br> &gt; Thank you<br> &gt;<br> &gt; Olivier Dupuis<br> </div></div>&gt; _______________________________________________<br> &gt; rspec-users mailing list<br> &gt; <a href="mailto:rspec-users@rubyforge.org" target="_blank">rspec-users@rubyforge.org</a><br>
 &gt; <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" target="_blank">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" target="_blank">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></blockquote>
</div></div></div><br></div><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>