Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "Integration tests support the OPTIONS http method"

This reverts commit ad46884.

Conflicts:
	actionpack/CHANGELOG.md
	actionpack/lib/action_dispatch/testing/integration.rb
	actionpack/test/controller/integration_test.rb

Reason: It will conflict with a lot of test cases. Better to call
`process` directly since this is a very uncommon HTTP method.

Fixes #10638.
  • Loading branch information...
commit 14f9086807db785fd676f923042c0d197f2e317f 1 parent 807bcfa
@rafaelfranca rafaelfranca authored
View
2  actionpack/CHANGELOG.md
@@ -1121,8 +1121,6 @@
*dlee*
-* Integration tests support the `OPTIONS` method. *Jeremy Kemper*
-
* `expires_in` accepts a `must_revalidate` flag. If true, "must-revalidate"
is added to the Cache-Control header. *fxn*
View
8 actionpack/lib/action_dispatch/testing/integration.rb
@@ -62,12 +62,6 @@ def head(path, parameters = nil, headers_or_env = nil)
process :head, path, parameters, headers_or_env
end
- # Performs a OPTIONS request with the given parameters. See +#get+ for
- # more details.
- def options(path, parameters = nil, headers_or_env = nil)
- process :options, path, parameters, headers_or_env
- end
-
# Performs an XMLHttpRequest request with the given parameters, mirroring
# a request from the Prototype library.
#
@@ -342,7 +336,7 @@ def reset!
@integration_session = Integration::Session.new(app)
end
- %w(get post patch put head delete options cookies assigns
+ %w(get post patch put head delete cookies assigns
xml_http_request xhr get_via_redirect post_via_redirect).each do |method|
define_method(method) do |*args|
reset! unless integration_session
View
18 actionpack/test/controller/integration_test.rb
@@ -117,12 +117,6 @@ def test_head
@session.head(path,params,headers)
end
- def test_options
- path = "/index"; params = "blah"; headers = {:location => 'blah'}
- @session.expects(:process).with(:options,path,params,headers)
- @session.options(path,params,headers)
- end
-
def test_xml_http_request_get
path = "/index"; params = "blah"; headers = {:location => 'blah'}
headers_after_xhr = headers.merge(
@@ -183,16 +177,6 @@ def test_xml_http_request_head
@session.xml_http_request(:head,path,params,headers)
end
- def test_xml_http_request_options
- path = "/index"; params = "blah"; headers = {:location => 'blah'}
- headers_after_xhr = headers.merge(
- "HTTP_X_REQUESTED_WITH" => "XMLHttpRequest",
- "HTTP_ACCEPT" => "text/javascript, text/html, application/xml, text/xml, */*"
- )
- @session.expects(:process).with(:options,path,params,headers_after_xhr)
- @session.xml_http_request(:options,path,params,headers)
- end
-
def test_xml_http_request_override_accept
path = "/index"; params = "blah"; headers = {:location => 'blah', "HTTP_ACCEPT" => "application/xml"}
headers_after_xhr = headers.merge(
@@ -250,7 +234,7 @@ def test_integration_methods_called
@integration_session.stubs(:generic_url_rewriter)
@integration_session.stubs(:process)
- %w( get post head patch put delete options ).each do |verb|
+ %w( get post head patch put delete ).each do |verb|
assert_nothing_raised("'#{verb}' should use integration test methods") { __send__(verb, '/') }
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.