Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged my latest code with github's 0.3.6, bumped to 0.3.7
- Loading branch information
Showing
10 changed files
with
77 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
coverage | ||
pkg | ||
pkg | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,6 +111,7 @@ def _erb_buffer( the_binding ) # :nodoc: | |
end | ||
|
||
class View | ||
|
||
def self.path | ||
@path ||= [] | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
require "helper" | ||
|
||
class RequestTest < Test::Unit::TestCase | ||
def test_no_method_override_for_get | ||
assert_equal("GET", get("/").request_method) | ||
assert_equal("GET", get("/?_method=DELETE").request_method) | ||
end | ||
|
||
def test_method_override_for_post | ||
assert_equal("POST", post("/").request_method) | ||
assert_equal("POST", post("/?_request=delete").request_method) | ||
assert_equal("PUT", post("/", :input => "_method=put").request_method) | ||
assert_equal("DELETE", post("/", :input => "_method=delete").request_method) | ||
end | ||
|
||
def get(path, options = {}) | ||
request(path, "GET", options) | ||
end | ||
|
||
def post(path, options = {}) | ||
request(path, "POST", options) | ||
end | ||
|
||
def request(path, method, options) | ||
Wheels::Request.new(Class.new, Rack::MockRequest.env_for(path, options.merge(:method => method))) | ||
end | ||
|
||
end |