What we usually do in this case is render the view with the layout and then check the contents of the sidebar div. However, this does lead to having to stub out additional things you don't care about in your example. If anyone has a better plan I'd like to know, too.
<br><br>Moses<br><br><div><span class="gmail_quote">On 6/4/07, <b class="gmail_sendername">Carl-Johan Kihlbom</b> <<a href="mailto:kihlbom@gmail.com">kihlbom@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 5/23/07, Kyle Hargraves <<a href="mailto:philodespotos@gmail.com">philodespotos@gmail.com</a>> wrote:<br>> Any ideas how I would go about writing specs for views which make use<br>> of content_for?<br>><br>
> I'd like, for example, to be able to specify that ABC view places XYZ<br>> in the sidebar, which I do using content_for(:sidebar).<br>><br>> Am I missing something obvious?<br>><br>> Kyle<br><br>I have the same problem, several of my views use content_for to
<br>populate a sidebar. How can I write examples for them?<br><br>/ CJ<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">http://rubyforge.org/mailman/listinfo/rspec-users</a><br></blockquote></div><br>