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:
parent
4396f1e6a8
commit
5913bec66e
9 changed files with 11 additions and 10 deletions
|
@ -1,2 +1 @@
|
|||
<%= yield if block_given? %>
|
||||
<%= yield_content :foo %>
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
<%= yield if block_given? %>
|
||||
<%= yield_content :foo %>
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
= yield if block_given?
|
||||
= yield_content :foo
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
== yield if block_given?
|
||||
= yield_content :foo
|
||||
|
|
|
@ -1 +1 @@
|
|||
<% yield_content :bar do %>bar<% end %>
|
||||
<% yield_content :foo do %>bar<% end %>
|
||||
|
|
|
@ -1 +1 @@
|
|||
<% yield_content :bar do %>bar<% end %>
|
||||
<% yield_content :foo do %>bar<% end %>
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
= yield_content :bar do
|
||||
= yield_content :foo do
|
||||
bar
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
= yield_content :bar do
|
||||
= yield_content :foo do
|
||||
| bar
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue