From b9c5c89e401af96116542d16d856b3871e0f4269 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Mon, 26 Dec 2011 11:11:31 -0800 Subject: [PATCH] test page and ignore helpers with various leading slash combinations. closes #211 --- features/dynamic_pages.feature | 62 ++++++++++++++++++- fixtures/test-app/config.rb | 19 ++++++ .../test-app/source/should_be_ignored4.html | 1 + .../test-app/source/should_be_ignored5.html | 1 + .../test-app/source/should_be_ignored6.html | 1 + .../test-app/source/should_be_ignored7.html | 1 + .../test-app/source/should_be_ignored8.html | 1 + 7 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 fixtures/test-app/source/should_be_ignored4.html create mode 100644 fixtures/test-app/source/should_be_ignored5.html create mode 100644 fixtures/test-app/source/should_be_ignored6.html create mode 100644 fixtures/test-app/source/should_be_ignored7.html create mode 100644 fixtures/test-app/source/should_be_ignored8.html diff --git a/features/dynamic_pages.feature b/features/dynamic_pages.feature index c55e963a..d20c9a26 100644 --- a/features/dynamic_pages.feature +++ b/features/dynamic_pages.feature @@ -6,30 +6,90 @@ Feature: Dynamic Pages When I cd to "build" Then the following files should exist: | fake.html | + | fake2.html | + | fake3.html | + | fake4.html | | fake/one.html | | fake/two.html | + | fake2/one.html | + | fake2/two.html | + | fake3/one.html | + | fake3/two.html | + | fake4/one.html | + | fake4/two.html | | target_ignore.html | + | target_ignore2.html | + | target_ignore3.html | + | target_ignore4.html | Then the following files should not exist: | should_be_ignored.html | | should_be_ignored2.html | | should_be_ignored3.html | + | should_be_ignored4.html | + | should_be_ignored5.html | + | should_be_ignored6.html | + | should_be_ignored7.html | + | should_be_ignored8.html | Scenario: Preview basic proxy Given the Server is running at "test-app" When I go to "/fake.html" Then I should see "I am real" + When I go to "/fake2.html" + Then I should see "I am real" + When I go to "/fake3.html" + Then I should see "I am real" + When I go to "/fake4.html" + Then I should see "I am real" Scenario: Preview proxy with variable one Given the Server is running at "test-app" When I go to "/fake/one.html" Then I should see "I am real: one" + When I go to "/fake2/one.html" + Then I should see "I am real: one" + When I go to "/fake3/one.html" + Then I should see "I am real: one" + When I go to "/fake4/one.html" + Then I should see "I am real: one" Scenario: Preview proxy with variable two Given the Server is running at "test-app" When I go to "/fake/two.html" Then I should see "I am real: two" + When I go to "/fake2/two.html" + Then I should see "I am real: two" + When I go to "/fake3/two.html" + Then I should see "I am real: two" + When I go to "/fake4/two.html" + Then I should see "I am real: two" + + Scenario: Target ignore + Given the Server is running at "test-app" + When I go to "/target_ignore.html" + Then I should see "Ignore me! 3" + When I go to "/target_ignore2.html" + Then I should see "Ignore me! 6" + When I go to "/target_ignore3.html" + Then I should see "Ignore me! 7" + When I go to "/target_ignore4.html" + Then I should see "Ignore me! 8" Scenario: Preview ignored paths - Given the Server is running at "test-app" + Given the Server is running at "test-app" When I go to "/should_be_ignored.html" + Then I should see "File Not Found" + When I go to "/should_be_ignored2.html" + Then I should see "File Not Found" + When I go to "/should_be_ignored3.html" + Then I should see "File Not Found" + When I go to "/should_be_ignored4.html" + Then I should see "File Not Found" + When I go to "/should_be_ignored5.html" + Then I should see "File Not Found" + When I go to "/should_be_ignored6.html" + Then I should see "File Not Found" + When I go to "/should_be_ignored7.html" + Then I should see "File Not Found" + When I go to "/should_be_ignored8.html" Then I should see "File Not Found" \ No newline at end of file diff --git a/fixtures/test-app/config.rb b/fixtures/test-app/config.rb index 72043ec3..2e360eb3 100644 --- a/fixtures/test-app/config.rb +++ b/fixtures/test-app/config.rb @@ -3,15 +3,34 @@ require "liquid" require "coffee-filter" page "/fake.html", :proxy => "/real.html", :layout => false +page "fake2.html", :proxy => "/real.html", :layout => false +page "fake3.html", :proxy => "real.html", :layout => false +page "/fake4.html", :proxy => "real.html", :layout => false ignore "/should_be_ignored.html" page "/should_be_ignored2.html", :ignore => true page "/target_ignore.html", :proxy => "/should_be_ignored3.html", :ignore => true + +ignore "should_be_ignored4.html" +page "should_be_ignored5.html", :ignore => true +page "target_ignore2.html", :proxy => "/should_be_ignored6.html", :ignore => true +page "target_ignore3.html", :proxy => "should_be_ignored7.html", :ignore => true +page "/target_ignore4.html", :proxy => "should_be_ignored8.html", :ignore => true + %w(one two).each do |num| page "/fake/#{num}.html", :proxy => "/real/index.html" do @num = num end + page "fake2/#{num}.html", :proxy => "/real/index.html" do + @num = num + end + page "fake3/#{num}.html", :proxy => "real/index.html" do + @num = num + end + page "/fake4/#{num}.html", :proxy => "real/index.html" do + @num = num + end end with_layout :content_for do diff --git a/fixtures/test-app/source/should_be_ignored4.html b/fixtures/test-app/source/should_be_ignored4.html new file mode 100644 index 00000000..b11a0596 --- /dev/null +++ b/fixtures/test-app/source/should_be_ignored4.html @@ -0,0 +1 @@ +

Ignore me! 4

\ No newline at end of file diff --git a/fixtures/test-app/source/should_be_ignored5.html b/fixtures/test-app/source/should_be_ignored5.html new file mode 100644 index 00000000..f348b0ad --- /dev/null +++ b/fixtures/test-app/source/should_be_ignored5.html @@ -0,0 +1 @@ +

Ignore me! 5

\ No newline at end of file diff --git a/fixtures/test-app/source/should_be_ignored6.html b/fixtures/test-app/source/should_be_ignored6.html new file mode 100644 index 00000000..234e60b7 --- /dev/null +++ b/fixtures/test-app/source/should_be_ignored6.html @@ -0,0 +1 @@ +

Ignore me! 6

\ No newline at end of file diff --git a/fixtures/test-app/source/should_be_ignored7.html b/fixtures/test-app/source/should_be_ignored7.html new file mode 100644 index 00000000..4179fb19 --- /dev/null +++ b/fixtures/test-app/source/should_be_ignored7.html @@ -0,0 +1 @@ +

Ignore me! 7

\ No newline at end of file diff --git a/fixtures/test-app/source/should_be_ignored8.html b/fixtures/test-app/source/should_be_ignored8.html new file mode 100644 index 00000000..2c2c24ab --- /dev/null +++ b/fixtures/test-app/source/should_be_ignored8.html @@ -0,0 +1 @@ +

Ignore me! 8

\ No newline at end of file