diff --git a/middleman-core/features/capture_html.feature b/middleman-core/features/capture_html.feature new file mode 100644 index 00000000..4cc88fb4 --- /dev/null +++ b/middleman-core/features/capture_html.feature @@ -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:

I am the yielded content erb

" + + 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:

I am the yielded content haml

" + + 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:

I am the yielded content slim

" \ No newline at end of file diff --git a/middleman-core/fixtures/capture-html-app/config.rb b/middleman-core/fixtures/capture-html-app/config.rb new file mode 100644 index 00000000..c0621cbe --- /dev/null +++ b/middleman-core/fixtures/capture-html-app/config.rb @@ -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 diff --git a/middleman-core/fixtures/capture-html-app/source/capture_html_erb.html.erb b/middleman-core/fixtures/capture-html-app/source/capture_html_erb.html.erb new file mode 100644 index 00000000..089564bf --- /dev/null +++ b/middleman-core/fixtures/capture-html-app/source/capture_html_erb.html.erb @@ -0,0 +1,5 @@ +<% capture_html :from_template do %> +

I am the yielded content erb

+<% end %> + +I am in the template \ No newline at end of file diff --git a/middleman-core/fixtures/capture-html-app/source/capture_html_haml.html.haml b/middleman-core/fixtures/capture-html-app/source/capture_html_haml.html.haml new file mode 100644 index 00000000..bbff7ff5 --- /dev/null +++ b/middleman-core/fixtures/capture-html-app/source/capture_html_haml.html.haml @@ -0,0 +1,4 @@ +- capture_html :from_template do + %h1= "I am the yielded content haml" + +%p I am in the template \ No newline at end of file diff --git a/middleman-core/fixtures/capture-html-app/source/capture_html_slim.html.slim b/middleman-core/fixtures/capture-html-app/source/capture_html_slim.html.slim new file mode 100644 index 00000000..b205dba9 --- /dev/null +++ b/middleman-core/fixtures/capture-html-app/source/capture_html_slim.html.slim @@ -0,0 +1,4 @@ +- capture_html :from_template do + h1 I am the yielded content slim + +| I am in the template \ No newline at end of file diff --git a/middleman-core/fixtures/capture-html-app/source/layouts/capture_html.erb b/middleman-core/fixtures/capture-html-app/source/layouts/capture_html.erb new file mode 100644 index 00000000..9977d42e --- /dev/null +++ b/middleman-core/fixtures/capture-html-app/source/layouts/capture_html.erb @@ -0,0 +1,4 @@ +In Layout: <%= yield_content(:from_template) %> + +In Template: +<%= yield %> \ No newline at end of file