Merge pull request #308 from bhollis/master

Test showing variables not getting passed to templates during build
This commit is contained in:
Thomas Reynolds 2012-03-12 10:14:00 -07:00
commit bba2584c81
3 changed files with 21 additions and 10 deletions

View file

@ -85,6 +85,21 @@ Feature: Dynamic Pages
Then I should see "I am real: two"
Then I should see "Global: I am four glob"
Then I should see "All: I am all glob"
Scenario: Build proxy with variable one
Given a successfully built app at "dynamic-pages-app"
When I cd to "build"
Then the file "fake/one.html" should contain "I am real: one"
Then the file "fake/one.html" should contain "Global: I am one glob"
Then the file "fake/one.html" should contain "All: I am all glob"
Then the file "fake2/one.html" should contain "I am real: one"
Then the file "fake2/one.html" should contain "Global: I am two glob"
Then the file "fake2/one.html" should contain "All: I am all glob"
Then the file "fake3/one.html" should contain "I am real: one"
Then the file "fake3/one.html" should contain "Global: I am three glob"
Then the file "fake3/one.html" should contain "All: I am all glob"
Scenario: Target ignore
Given the Server is running at "dynamic-pages-app"

View file

@ -14,16 +14,16 @@ 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
page "/fake/#{num}.html", :proxy => "/real/index.html", :ignore => true do
@num = num
end
page "fake2/#{num}.html", :proxy => "/real/index.html" do
page "fake2/#{num}.html", :proxy => "/real/index.html", :ignore => true do
@num = num
end
page "fake3/#{num}.html", :proxy => "real/index.html" do
page "fake3/#{num}.html", :proxy => "real/index.html", :ignore => true do
@num = num
end
page "/fake4/#{num}.html", :proxy => "real/index.html" do
page "/fake4/#{num}.html", :proxy => "real/index.html", :ignore => true do
@num = num
end
end
@ -46,4 +46,4 @@ end
page "fake4/*" do
@glob_var = "I am four glob"
end
end

View file

@ -42,11 +42,7 @@ module Middleman::Sitemap
# Internal path to be requested when rendering this page
# @return [String]
def request_path
if proxy?
store.page(proxied_to).destination_path
else
destination_path
end
destination_path
end
# Set the on-disk source file for this page