Forum: Ruby on Rails How to test "content_for" chunks with functional tests?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Db8eac67e450a9a943ed249bfbc1cbbe?d=identicon&s=25 Null Null Dev (Guest)
on 2007-06-18 12:43
(Received via mailing list)
Basically, we have an application layout that demands some content
for, e.g. the sidebar... during functional testing, we want to assert
that our views properly provide this content.


  - application.rhtml has stuff like "yield :title", "yield :sidebar",
  - views contain "content_for :title", "content_for :sidebar", etc.


  - When writing functional tests, is there a way to test that the views
    properly call "content_for :sidebar", i.e. that "yield :sidebar" in
    the layout does not result in an empty string?

I'm rather new to Rails, just started using functional tests a few
days ago... despite much searching, I couldn't find a solution to the
issues above.

Any hints are greatly appreciated. -- Thanks!
This topic is locked and can not be replied to.