Merge pull request #928 from middleman/capture_html-tests
capture_html helper tests
This commit is contained in:
commit
c051b72322
6 changed files with 40 additions and 0 deletions
16
middleman-core/features/capture_html.feature
Normal file
16
middleman-core/features/capture_html.feature
Normal file
|
@ -0,0 +1,16 @@
|
|||
Feature: Support capture_html and yield_content helpers
|
||||
|
||||
Scenario: content_for works as expected in erb
|
||||
Given the Server is running at "capture-html-app"
|
||||
When I go to "/capture_html_erb.html"
|
||||
Then I should see "In Layout: <h1>I am the yielded content erb</h1>"
|
||||
|
||||
Scenario: content_for works as expected in haml
|
||||
Given the Server is running at "capture-html-app"
|
||||
When I go to "/capture_html_haml.html"
|
||||
Then I should see "In Layout: <h1>I am the yielded content haml</h1>"
|
||||
|
||||
Scenario: content_for works as expected in slim
|
||||
Given the Server is running at "capture-html-app"
|
||||
When I go to "/capture_html_slim.html"
|
||||
Then I should see "In Layout: <h1>I am the yielded content slim</h1>"
|
7
middleman-core/fixtures/capture-html-app/config.rb
Normal file
7
middleman-core/fixtures/capture-html-app/config.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
require "slim"
|
||||
|
||||
with_layout :capture_html do
|
||||
page "/capture_html_erb.html"
|
||||
page "/capture_html_haml.html"
|
||||
page "/capture_html_slim.html"
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
<% capture_html :from_template do %>
|
||||
<h1>I am the yielded content erb</h1>
|
||||
<% end %>
|
||||
|
||||
I am in the template
|
|
@ -0,0 +1,4 @@
|
|||
- capture_html :from_template do
|
||||
%h1= "I am the yielded content haml"
|
||||
|
||||
%p I am in the template
|
|
@ -0,0 +1,4 @@
|
|||
- capture_html :from_template do
|
||||
h1 I am the yielded content slim
|
||||
|
||||
| I am in the template
|
|
@ -0,0 +1,4 @@
|
|||
In Layout: <%= yield_content(:from_template) %>
|
||||
|
||||
In Template:
|
||||
<%= yield %>
|
Loading…
Reference in a new issue