aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorDarragh Curran <darragh@peelmeagrape.net>2009-06-21 17:05:43 +0100
committerPratik Naik <pratiknaik@gmail.com>2009-06-21 17:07:22 +0100
commit9cb8c812f2a23ab5653a7888740a014a02c97c18 (patch)
treeed207d0ec3e013b1921a1c8951ba46d51fa86967 /actionpack/test
parent66eb05821b1cb522f497c874e7708fe705fb8356 (diff)
downloadrails-9cb8c812f2a23ab5653a7888740a014a02c97c18.tar.gz
rails-9cb8c812f2a23ab5653a7888740a014a02c97c18.tar.bz2
rails-9cb8c812f2a23ab5653a7888740a014a02c97c18.zip
Add content_for?(:name) helper to check if content_for(:name) is present [#1311 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/capture_helper_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/actionpack/test/template/capture_helper_test.rb b/actionpack/test/template/capture_helper_test.rb
new file mode 100644
index 0000000000..2017a18806
--- /dev/null
+++ b/actionpack/test/template/capture_helper_test.rb
@@ -0,0 +1,15 @@
+require 'abstract_unit'
+
+class CaptureHelperTest < ActionView::TestCase
+ def setup
+ super
+ @_content_for = Hash.new {|h,k| h[k] = "" }
+ end
+
+ def test_content_for
+ assert ! content_for?(:title)
+ content_for :title, 'title'
+ assert content_for?(:title)
+ assert ! content_for?(:something_else)
+ end
+end