From 41df43092d42d6a15d2f1c218b10107ecf5f1baf Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Sat, 17 Sep 2011 12:43:31 -0700 Subject: [PATCH] tests for data in config.rb, closes #118 --- features/data.feature | 12 +++++++++++- fixtures/data-app/config.rb | 3 +++ fixtures/data-app/data/pages.yml | 6 ++++++ fixtures/data-app/source/index.html.haml | 1 + fixtures/data-app/source/layout.haml | 3 +++ 5 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 fixtures/data-app/config.rb create mode 100644 fixtures/data-app/data/pages.yml create mode 100755 fixtures/data-app/source/index.html.haml create mode 100644 fixtures/data-app/source/layout.haml diff --git a/features/data.feature b/features/data.feature index 0977356f..9c1394c3 100644 --- a/features/data.feature +++ b/features/data.feature @@ -14,4 +14,14 @@ Feature: Local Data API Scenario: Rendering liquid Given the Server is running at "test-app" When I go to "/data2.html" - Then I should see "OneTwo" \ No newline at end of file + Then I should see "OneTwo" + + Scenario: Using data in config.rb + Given the Server is running at "data-app" + When I go to "/test1.html" + Then I should see "Welcome" + + Scenario: Using data2 in config.rb + Given the Server is running at "data-app" + When I go to "/test2.html" + Then I should see "Welcome" \ No newline at end of file diff --git a/fixtures/data-app/config.rb b/fixtures/data-app/config.rb new file mode 100644 index 00000000..3daf269c --- /dev/null +++ b/fixtures/data-app/config.rb @@ -0,0 +1,3 @@ +data.pages.each do |p| + page p.from, :proxy => p.to +end \ No newline at end of file diff --git a/fixtures/data-app/data/pages.yml b/fixtures/data-app/data/pages.yml new file mode 100644 index 00000000..2ad0adbd --- /dev/null +++ b/fixtures/data-app/data/pages.yml @@ -0,0 +1,6 @@ +- + from: "/test1.html" + to: "/index.html" +- + from: "/test2.html" + to: "/index.html" \ No newline at end of file diff --git a/fixtures/data-app/source/index.html.haml b/fixtures/data-app/source/index.html.haml new file mode 100755 index 00000000..0582dd93 --- /dev/null +++ b/fixtures/data-app/source/index.html.haml @@ -0,0 +1 @@ +%h1 Welcome \ No newline at end of file diff --git a/fixtures/data-app/source/layout.haml b/fixtures/data-app/source/layout.haml new file mode 100644 index 00000000..e34689e1 --- /dev/null +++ b/fixtures/data-app/source/layout.haml @@ -0,0 +1,3 @@ +%html + %body + = yield \ No newline at end of file