mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add the options method to action_controller testcase.
Signed-off-by: François de Metz <francois@stormz.me>
This commit is contained in:
parent
b5a2f24b6b
commit
0303c2325f
2 changed files with 12 additions and 2 deletions
|
@ -430,8 +430,13 @@ module ActionController
|
|||
end
|
||||
|
||||
# Executes a request simulating HEAD HTTP method and set/volley the response
|
||||
def head(action, parameters = nil, session = nil, flash = nil)
|
||||
process(action, "HEAD", parameters, session, flash)
|
||||
def head(action, *args)
|
||||
process(action, "HEAD", *args)
|
||||
end
|
||||
|
||||
# Executes a request simulating OPTIONS HTTP method and set/volley the response
|
||||
def options(action, *args)
|
||||
process(action, "OPTIONS", *args)
|
||||
end
|
||||
|
||||
def xml_http_request(request_method, action, parameters = nil, session = nil, flash = nil)
|
||||
|
|
|
@ -197,6 +197,11 @@ XML
|
|||
assert_raise(NoMethodError) { head :test_params, "document body", :id => 10 }
|
||||
end
|
||||
|
||||
def test_options
|
||||
options :test_params
|
||||
assert_equal 200, @response.status
|
||||
end
|
||||
|
||||
def test_process_without_flash
|
||||
process :set_flash
|
||||
assert_equal '><', flash['test']
|
||||
|
|
Loading…
Reference in a new issue