From 745ce14624f85ff8616b3b907ed79e79203eb478 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Wed, 7 Dec 2011 11:26:49 -0800 Subject: [PATCH] test wildcard pages --- features/wildcard_page_helper.feature | 19 +++++++++++++++++++ fixtures/wildcard-app/config.rb | 1 + .../wildcard-app/source/admin/index.html.erb | 1 + .../wildcard-app/source/admin/page.html.erb | 1 + fixtures/wildcard-app/source/index.html.erb | 1 + .../wildcard-app/source/layouts/admin.erb | 2 ++ .../wildcard-app/source/layouts/layout.erb | 2 ++ .../wildcard-directory-index-app/config.rb | 2 ++ .../source/admin/index.html.erb | 1 + .../source/admin/page.html.erb | 1 + .../source/index.html.erb | 1 + .../source/layouts/admin.erb | 2 ++ .../source/layouts/layout.erb | 2 ++ 13 files changed, 36 insertions(+) create mode 100644 features/wildcard_page_helper.feature create mode 100644 fixtures/wildcard-app/config.rb create mode 100644 fixtures/wildcard-app/source/admin/index.html.erb create mode 100644 fixtures/wildcard-app/source/admin/page.html.erb create mode 100644 fixtures/wildcard-app/source/index.html.erb create mode 100644 fixtures/wildcard-app/source/layouts/admin.erb create mode 100644 fixtures/wildcard-app/source/layouts/layout.erb create mode 100644 fixtures/wildcard-directory-index-app/config.rb create mode 100644 fixtures/wildcard-directory-index-app/source/admin/index.html.erb create mode 100644 fixtures/wildcard-directory-index-app/source/admin/page.html.erb create mode 100644 fixtures/wildcard-directory-index-app/source/index.html.erb create mode 100644 fixtures/wildcard-directory-index-app/source/layouts/admin.erb create mode 100644 fixtures/wildcard-directory-index-app/source/layouts/layout.erb diff --git a/features/wildcard_page_helper.feature b/features/wildcard_page_helper.feature new file mode 100644 index 00000000..baa75556 --- /dev/null +++ b/features/wildcard_page_helper.feature @@ -0,0 +1,19 @@ +Feature: Wildcards in Page helper + + Scenario: Setting the layout for a folder + Given the Server is running at "wildcard-app" + When I go to "/index.html" + Then I should see "Normal Layout" + When I go to "/admin/index.html" + Then I should see "Admin Layout" + When I go to "/admin/page.html" + Then I should see "Admin Layout" + + Scenario: Setting the layout for a folder + Given the Server is running at "wildcard-directory-index-app" + When I go to "/" + Then I should see "Normal Layout" + When I go to "/admin/" + Then I should see "Admin Layout" + When I go to "/admin/page.html" + Then I should see "Admin Layout" \ No newline at end of file diff --git a/fixtures/wildcard-app/config.rb b/fixtures/wildcard-app/config.rb new file mode 100644 index 00000000..e5a9b739 --- /dev/null +++ b/fixtures/wildcard-app/config.rb @@ -0,0 +1 @@ +page "/admin/*", :layout => :admin \ No newline at end of file diff --git a/fixtures/wildcard-app/source/admin/index.html.erb b/fixtures/wildcard-app/source/admin/index.html.erb new file mode 100644 index 00000000..9f7cda8e --- /dev/null +++ b/fixtures/wildcard-app/source/admin/index.html.erb @@ -0,0 +1 @@ +Index \ No newline at end of file diff --git a/fixtures/wildcard-app/source/admin/page.html.erb b/fixtures/wildcard-app/source/admin/page.html.erb new file mode 100644 index 00000000..560c7d73 --- /dev/null +++ b/fixtures/wildcard-app/source/admin/page.html.erb @@ -0,0 +1 @@ +Page \ No newline at end of file diff --git a/fixtures/wildcard-app/source/index.html.erb b/fixtures/wildcard-app/source/index.html.erb new file mode 100644 index 00000000..9f7cda8e --- /dev/null +++ b/fixtures/wildcard-app/source/index.html.erb @@ -0,0 +1 @@ +Index \ No newline at end of file diff --git a/fixtures/wildcard-app/source/layouts/admin.erb b/fixtures/wildcard-app/source/layouts/admin.erb new file mode 100644 index 00000000..c1bef016 --- /dev/null +++ b/fixtures/wildcard-app/source/layouts/admin.erb @@ -0,0 +1,2 @@ +Admin Layout +<%= yield %> \ No newline at end of file diff --git a/fixtures/wildcard-app/source/layouts/layout.erb b/fixtures/wildcard-app/source/layouts/layout.erb new file mode 100644 index 00000000..f8684ee5 --- /dev/null +++ b/fixtures/wildcard-app/source/layouts/layout.erb @@ -0,0 +1,2 @@ +Normal Layout +<%= yield %> \ No newline at end of file diff --git a/fixtures/wildcard-directory-index-app/config.rb b/fixtures/wildcard-directory-index-app/config.rb new file mode 100644 index 00000000..e6c34318 --- /dev/null +++ b/fixtures/wildcard-directory-index-app/config.rb @@ -0,0 +1,2 @@ +activate :directory_indexes +page "/admin/*", :layout => :admin \ No newline at end of file diff --git a/fixtures/wildcard-directory-index-app/source/admin/index.html.erb b/fixtures/wildcard-directory-index-app/source/admin/index.html.erb new file mode 100644 index 00000000..9f7cda8e --- /dev/null +++ b/fixtures/wildcard-directory-index-app/source/admin/index.html.erb @@ -0,0 +1 @@ +Index \ No newline at end of file diff --git a/fixtures/wildcard-directory-index-app/source/admin/page.html.erb b/fixtures/wildcard-directory-index-app/source/admin/page.html.erb new file mode 100644 index 00000000..560c7d73 --- /dev/null +++ b/fixtures/wildcard-directory-index-app/source/admin/page.html.erb @@ -0,0 +1 @@ +Page \ No newline at end of file diff --git a/fixtures/wildcard-directory-index-app/source/index.html.erb b/fixtures/wildcard-directory-index-app/source/index.html.erb new file mode 100644 index 00000000..9f7cda8e --- /dev/null +++ b/fixtures/wildcard-directory-index-app/source/index.html.erb @@ -0,0 +1 @@ +Index \ No newline at end of file diff --git a/fixtures/wildcard-directory-index-app/source/layouts/admin.erb b/fixtures/wildcard-directory-index-app/source/layouts/admin.erb new file mode 100644 index 00000000..c1bef016 --- /dev/null +++ b/fixtures/wildcard-directory-index-app/source/layouts/admin.erb @@ -0,0 +1,2 @@ +Admin Layout +<%= yield %> \ No newline at end of file diff --git a/fixtures/wildcard-directory-index-app/source/layouts/layout.erb b/fixtures/wildcard-directory-index-app/source/layouts/layout.erb new file mode 100644 index 00000000..f8684ee5 --- /dev/null +++ b/fixtures/wildcard-directory-index-app/source/layouts/layout.erb @@ -0,0 +1,2 @@ +Normal Layout +<%= yield %> \ No newline at end of file