[rspec-users] content_for

Moses Hohman moses.hohman at gmail.com
Mon Jun 4 10:50:27 EDT 2007

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.


On 6/4/07, Carl-Johan Kihlbom <kihlbom at gmail.com> wrote:
> On 5/23/07, Kyle Hargraves <philodespotos at gmail.com> wrote:
> > Any ideas how I would go about writing specs for views which make use
> > of content_for?
> >
> > I'd like, for example, to be able to specify that ABC view places XYZ
> > in the sidebar, which I do using content_for(:sidebar).
> >
> > Am I missing something obvious?
> >
> > Kyle
> I have the same problem, several of my views use content_for to
> populate a sidebar. How can I write examples for them?
> / CJ
> _______________________________________________
> 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/20070604/4a88e440/attachment-0001.html 

More information about the rspec-users mailing list