From 24664e4bbab4d1805b8c23509798e4305032ebe5 Mon Sep 17 00:00:00 2001 From: Eric Skogen Date: Thu, 22 Dec 2011 16:38:34 -0600 Subject: [PATCH] demonstrate bug with nested_layouts and YAML front matter --- features/nested_layouts.feature | 12 +++++++++++- fixtures/nested-layout-app/source/data-one.html.erb | 5 +++++ fixtures/nested-layout-app/source/data-two.html.erb | 5 +++++ fixtures/nested-layout-app/source/layouts/master.erb | 1 + 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 fixtures/nested-layout-app/source/data-one.html.erb create mode 100644 fixtures/nested-layout-app/source/data-two.html.erb diff --git a/features/nested_layouts.feature b/features/nested_layouts.feature index 146443c5..a591f240 100644 --- a/features/nested_layouts.feature +++ b/features/nested_layouts.feature @@ -6,4 +6,14 @@ Feature: Allow nesting of layouts Then I should see "Template" And I should see "Inner" And I should see "Outer" - And I should see "Master" \ No newline at end of file + And I should see "Master" + + Scenario: YAML Front Matter isn't clobbered with nested layouts + Given the Server is running at "nested-layout-app" + When I go to "/data-one.html" + Then I should see "Page Number One" + When I go to "/data-two.html" + Then I should see "Page Number Two" + When I go to "/data-one.html" + Then I should see "Page Number One" + When I go to "/data-two.html" diff --git a/fixtures/nested-layout-app/source/data-one.html.erb b/fixtures/nested-layout-app/source/data-one.html.erb new file mode 100644 index 00000000..7dfb5840 --- /dev/null +++ b/fixtures/nested-layout-app/source/data-one.html.erb @@ -0,0 +1,5 @@ +--- +title: Page Number One +layout: outer +--- +Page #1 \ No newline at end of file diff --git a/fixtures/nested-layout-app/source/data-two.html.erb b/fixtures/nested-layout-app/source/data-two.html.erb new file mode 100644 index 00000000..387c9da1 --- /dev/null +++ b/fixtures/nested-layout-app/source/data-two.html.erb @@ -0,0 +1,5 @@ +--- +title: Page Number Two +layout: outer +--- +Page #2 \ No newline at end of file diff --git a/fixtures/nested-layout-app/source/layouts/master.erb b/fixtures/nested-layout-app/source/layouts/master.erb index 18dcdbb7..fbda1cc2 100644 --- a/fixtures/nested-layout-app/source/layouts/master.erb +++ b/fixtures/nested-layout-app/source/layouts/master.erb @@ -1,2 +1,3 @@ Master +<%= data.page.title %> <%= yield %> \ No newline at end of file