test backwards compatible request.params template values. closes #294
This commit is contained in:
parent
576463f361
commit
445b66bed7
4 changed files with 13 additions and 1 deletions
6
middleman-core/features/request_params.feature
Normal file
6
middleman-core/features/request_params.feature
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
Feature: Support request parameters
|
||||||
|
Scenario: Use request params in a template
|
||||||
|
Given the Server is running at "request-app"
|
||||||
|
When I go to "/index.html?say=Hello+World"
|
||||||
|
Then I should see "Quote Hello World"
|
||||||
|
Then I should see "Symbol Hello World"
|
0
middleman-core/fixtures/request-app/config.rb
Normal file
0
middleman-core/fixtures/request-app/config.rb
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Dot <%= request.params.say %>
|
||||||
|
Quote <%= request.params["say"] %>
|
||||||
|
Symbol <%= request.params[:say] %>
|
|
@ -265,7 +265,10 @@ class Middleman::Base
|
||||||
# @return [void]
|
# @return [void]
|
||||||
def current_path=(path)
|
def current_path=(path)
|
||||||
@_current_path = path
|
@_current_path = path
|
||||||
@request = ::Thor::CoreExt::HashWithIndifferentAccess.new({ :path => path })
|
@request = ::Thor::CoreExt::HashWithIndifferentAccess.new({
|
||||||
|
:path => path,
|
||||||
|
:params => req ? ::Thor::CoreExt::HashWithIndifferentAccess.new(req.params) : {}
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
# Initialize the Middleman project
|
# Initialize the Middleman project
|
||||||
|
|
Loading…
Add table
Reference in a new issue