Permalink
Browse files

Added the test cases for content_for?

Signed-off-by: Ilya Shindyapin <ilya@shindyapin.com>
  • Loading branch information...
1 parent 427e167 commit f541eddc394440f701b5285c1f4870132607f086 @license2e license2e committed Dec 15, 2011
@@ -0,0 +1,3 @@
+<% if content_for? :foo %>
+ <%= yield_content :foo %>
+<% end %>
@@ -0,0 +1,3 @@
+<% if content_for? :foo %>
+ <%= yield_content :foo %>
+<% end %>
@@ -0,0 +1,2 @@
+- if content_for? :foo
+ = yield_content :foo
@@ -0,0 +1,2 @@
+- if content_for? :foo
+ = yield_content :foo
View
@@ -138,6 +138,18 @@ def render(engine, template)
render(inner, :passes_values).should == "<i>1</i>2"
end
end
+
+ describe "with content_for? in Ruby" do
+ it 'renders block if key is set' do
+ content_for(:foo) { "foot" }
+ render(inner, :footer).should == "foot"
+ end
+
+ it 'does not render a block if different key' do
+ content_for(:different_key) { "foot" }
+ render(inner, :footer).should be_empty
+ end
+ end
engines.each do |outer|
describe "with yield_content in #{outer.capitalize}" do

0 comments on commit f541edd

Please sign in to comment.