Vendor Rack 1.1
Also clean up some View stuff.
This commit is contained in:
parent
77014652a3
commit
a705709f9a
74 changed files with 3080 additions and 608 deletions
30
vendor/plugins/rack/test/spec_rack_urlmap.rb
vendored
30
vendor/plugins/rack/test/spec_rack_urlmap.rb
vendored
|
@ -44,6 +44,12 @@ context "Rack::URLMap" do
|
|||
res["X-ScriptName"].should.equal "/foo/bar"
|
||||
res["X-PathInfo"].should.equal "/"
|
||||
|
||||
res = Rack::MockRequest.new(map).get("/foo///bar//quux")
|
||||
res.status.should.equal 200
|
||||
res.should.be.ok
|
||||
res["X-ScriptName"].should.equal "/foo/bar"
|
||||
res["X-PathInfo"].should.equal "//quux"
|
||||
|
||||
res = Rack::MockRequest.new(map).get("/foo/quux", "SCRIPT_NAME" => "/bleh")
|
||||
res.should.be.ok
|
||||
res["X-ScriptName"].should.equal "/bleh/foo"
|
||||
|
@ -182,4 +188,28 @@ context "Rack::URLMap" do
|
|||
res["X-PathInfo"].should.equal "/"
|
||||
res["X-ScriptName"].should.equal ""
|
||||
end
|
||||
|
||||
specify "should not squeeze slashes" do
|
||||
map = Rack::URLMap.new("/" => lambda { |env|
|
||||
[200,
|
||||
{ "Content-Type" => "text/plain",
|
||||
"X-Position" => "root",
|
||||
"X-PathInfo" => env["PATH_INFO"],
|
||||
"X-ScriptName" => env["SCRIPT_NAME"]
|
||||
}, [""]]},
|
||||
"/foo" => lambda { |env|
|
||||
[200,
|
||||
{ "Content-Type" => "text/plain",
|
||||
"X-Position" => "foo",
|
||||
"X-PathInfo" => env["PATH_INFO"],
|
||||
"X-ScriptName" => env["SCRIPT_NAME"]
|
||||
}, [""]]}
|
||||
)
|
||||
|
||||
res = Rack::MockRequest.new(map).get("/http://example.org/bar")
|
||||
res.should.be.ok
|
||||
res["X-Position"].should.equal "root"
|
||||
res["X-PathInfo"].should.equal "/http://example.org/bar"
|
||||
res["X-ScriptName"].should.equal ""
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue