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

@ -86,6 +86,21 @@ Feature: Dynamic Pages
Then I should see "Global: I am four glob" Then I should see "Global: I am four glob"
Then I should see "All: I am all 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 Scenario: Target ignore
Given the Server is running at "dynamic-pages-app" Given the Server is running at "dynamic-pages-app"
When I go to "/target_ignore.html" When I go to "/target_ignore.html"

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 page "/target_ignore4.html", :proxy => "should_be_ignored8.html", :ignore => true
%w(one two).each do |num| %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 @num = num
end end
page "fake2/#{num}.html", :proxy => "/real/index.html" do page "fake2/#{num}.html", :proxy => "/real/index.html", :ignore => true do
@num = num @num = num
end end
page "fake3/#{num}.html", :proxy => "real/index.html" do page "fake3/#{num}.html", :proxy => "real/index.html", :ignore => true do
@num = num @num = num
end end
page "/fake4/#{num}.html", :proxy => "real/index.html" do page "/fake4/#{num}.html", :proxy => "real/index.html", :ignore => true do
@num = num @num = num
end end
end end

View file

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