Skip to content

Commit

Permalink
Fix content_for specs
Browse files Browse the repository at this point in the history
  • Loading branch information
jkowens committed Dec 8, 2018
1 parent 4396f1e commit 5913bec
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 10 deletions.
1 change: 0 additions & 1 deletion sinatra-contrib/spec/content_for/layout.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
<%= yield if block_given? %>
<%= yield_content :foo %>
1 change: 0 additions & 1 deletion sinatra-contrib/spec/content_for/layout.erubis
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
<%= yield if block_given? %>
<%= yield_content :foo %>
1 change: 0 additions & 1 deletion sinatra-contrib/spec/content_for/layout.haml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
= yield if block_given?
= yield_content :foo
1 change: 0 additions & 1 deletion sinatra-contrib/spec/content_for/layout.slim
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
== yield if block_given?
= yield_content :foo
2 changes: 1 addition & 1 deletion sinatra-contrib/spec/content_for/yield_block.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<% yield_content :bar do %>bar<% end %>
<% yield_content :foo do %>bar<% end %>
2 changes: 1 addition & 1 deletion sinatra-contrib/spec/content_for/yield_block.erubis
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<% yield_content :bar do %>bar<% end %>
<% yield_content :foo do %>bar<% end %>
2 changes: 1 addition & 1 deletion sinatra-contrib/spec/content_for/yield_block.haml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
= yield_content :bar do
= yield_content :foo do
bar
2 changes: 1 addition & 1 deletion sinatra-contrib/spec/content_for/yield_block.slim
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
= yield_content :bar do
= yield_content :foo do
| bar
9 changes: 7 additions & 2 deletions sinatra-contrib/spec/content_for_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,16 @@ def body
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")
Expand Down

0 comments on commit 5913bec

Please sign in to comment.