1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

Fix content_for specs

This commit is contained in:
Jordan Owens 2018-12-08 14:01:48 -05:00
parent 4396f1e6a8
commit 5913bec66e
9 changed files with 11 additions and 10 deletions

View file

@ -1,2 +1 @@
<%= yield if block_given? %>
<%= yield_content :foo %>

View file

@ -1,2 +1 @@
<%= yield if block_given? %>
<%= yield_content :foo %>

View file

@ -1,2 +1 @@
= yield if block_given?
= yield_content :foo

View file

@ -1,2 +1 @@
== yield if block_given?
= yield_content :foo

View file

@ -1 +1 @@
<% yield_content :bar do %>bar<% end %>
<% yield_content :foo do %>bar<% end %>

View file

@ -1 +1 @@
<% yield_content :bar do %>bar<% end %>
<% yield_content :foo do %>bar<% end %>

View file

@ -1,2 +1,2 @@
= yield_content :bar do
= yield_content :foo do
bar

View file

@ -1,2 +1,2 @@
= yield_content :bar do
= yield_content :foo do
| bar

View file

@ -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")