Added the test cases for content_for?
Signed-off-by: Ilya Shindyapin <ilya@shindyapin.com>
This commit is contained in:
parent
51d91acdcd
commit
4422a1ad7c
|
@ -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
|
|
@ -138,6 +138,18 @@ describe Sinatra::ContentFor do
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue