Add the options method to action_controller testcase.

Signed-off-by: François de Metz <francois@stormz.me>
This commit is contained in:
François de Metz 2012-07-04 14:57:31 +02:00
parent b5a2f24b6b
commit 0303c2325f
2 changed files with 12 additions and 2 deletions

@ -430,8 +430,13 @@ def delete(action, *args)
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 @@ def test_head_params_as_sting
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']