diff --git a/sinatra-contrib/spec/content_for/layout.erb b/sinatra-contrib/spec/content_for/layout.erb index d6317b7e..a385d0cf 100644 --- a/sinatra-contrib/spec/content_for/layout.erb +++ b/sinatra-contrib/spec/content_for/layout.erb @@ -1,2 +1 @@ -<%= yield if block_given? %> <%= yield_content :foo %> diff --git a/sinatra-contrib/spec/content_for/layout.erubis b/sinatra-contrib/spec/content_for/layout.erubis index d6317b7e..a385d0cf 100644 --- a/sinatra-contrib/spec/content_for/layout.erubis +++ b/sinatra-contrib/spec/content_for/layout.erubis @@ -1,2 +1 @@ -<%= yield if block_given? %> <%= yield_content :foo %> diff --git a/sinatra-contrib/spec/content_for/layout.haml b/sinatra-contrib/spec/content_for/layout.haml index fc064a96..aabdfaae 100644 --- a/sinatra-contrib/spec/content_for/layout.haml +++ b/sinatra-contrib/spec/content_for/layout.haml @@ -1,2 +1 @@ -= yield if block_given? = yield_content :foo diff --git a/sinatra-contrib/spec/content_for/layout.slim b/sinatra-contrib/spec/content_for/layout.slim index 807b6326..aabdfaae 100644 --- a/sinatra-contrib/spec/content_for/layout.slim +++ b/sinatra-contrib/spec/content_for/layout.slim @@ -1,2 +1 @@ -== yield if block_given? = yield_content :foo diff --git a/sinatra-contrib/spec/content_for/yield_block.erb b/sinatra-contrib/spec/content_for/yield_block.erb index 38efd67b..a68e7784 100644 --- a/sinatra-contrib/spec/content_for/yield_block.erb +++ b/sinatra-contrib/spec/content_for/yield_block.erb @@ -1 +1 @@ -<% yield_content :bar do %>bar<% end %> +<% yield_content :foo do %>bar<% end %> diff --git a/sinatra-contrib/spec/content_for/yield_block.erubis b/sinatra-contrib/spec/content_for/yield_block.erubis index 38efd67b..a68e7784 100644 --- a/sinatra-contrib/spec/content_for/yield_block.erubis +++ b/sinatra-contrib/spec/content_for/yield_block.erubis @@ -1 +1 @@ -<% yield_content :bar do %>bar<% end %> +<% yield_content :foo do %>bar<% end %> diff --git a/sinatra-contrib/spec/content_for/yield_block.haml b/sinatra-contrib/spec/content_for/yield_block.haml index d573b340..5ec45851 100644 --- a/sinatra-contrib/spec/content_for/yield_block.haml +++ b/sinatra-contrib/spec/content_for/yield_block.haml @@ -1,2 +1,2 @@ -= yield_content :bar do += yield_content :foo do bar diff --git a/sinatra-contrib/spec/content_for/yield_block.slim b/sinatra-contrib/spec/content_for/yield_block.slim index d6482dc4..e4f5b1d2 100644 --- a/sinatra-contrib/spec/content_for/yield_block.slim +++ b/sinatra-contrib/spec/content_for/yield_block.slim @@ -1,2 +1,2 @@ -= yield_content :bar do += yield_content :foo do | bar diff --git a/sinatra-contrib/spec/content_for_spec.rb b/sinatra-contrib/spec/content_for_spec.rb index 3cc28102..0b208437 100644 --- a/sinatra-contrib/spec/content_for_spec.rb +++ b/sinatra-contrib/spec/content_for_spec.rb @@ -205,11 +205,16 @@ describe Sinatra::ContentFor do end end - it 'renders default content' do - expect(get('/yield_block')).to be_ok + it 'renders content' do + expect(get('/yield_block/different_key')).to be_ok expect(body).to eq("bar") end + it 'renders default content' do + expect(get('/yield_block/same_key')).to be_ok + expect(body).to eq("foo") + end + it 'renders content set as parameter' do expect(get('/parameter_value')).to be_ok expect(body).to eq("foo")