Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refactor request tests, remove #with_set method

  • Loading branch information...
commit bba8fc4294ca7f7d90c3e64e7fea059b17caef5c 1 parent 14620ea
@carlosantoniodasilva carlosantoniodasilva authored
Showing with 3 additions and 8 deletions.
  1. +3 −8 actionpack/test/dispatch/request_test.rb
View
11 actionpack/test/dispatch/request_test.rb
@@ -355,7 +355,6 @@ def url_for(options = {})
assert_equal "/of/some/uri", request.path_info
end
-
test "host with default port" do
request = stub_request 'HTTP_HOST' => 'rubyonrails.org:80'
assert_equal "rubyonrails.org", request.host_with_port
@@ -577,16 +576,16 @@ def url_for(options = {})
test "formats with accept header" do
request = stub_request 'HTTP_ACCEPT' => 'text/html'
request.expects(:parameters).at_least_once.returns({})
- assert_equal [ Mime::HTML ], request.formats
+ assert_equal [Mime::HTML], request.formats
request = stub_request 'CONTENT_TYPE' => 'application/xml; charset=UTF-8',
'HTTP_X_REQUESTED_WITH' => "XMLHttpRequest"
request.expects(:parameters).at_least_once.returns({})
- assert_equal with_set(Mime::XML), request.formats
+ assert_equal [Mime::XML], request.formats
request = stub_request
request.expects(:parameters).at_least_once.returns({ :format => :txt })
- assert_equal with_set(Mime::TEXT), request.formats
+ assert_equal [Mime::TEXT], request.formats
request = stub_request
request.expects(:parameters).at_least_once.returns({ :format => :unknown })
@@ -811,8 +810,4 @@ def stub_request(env = {})
ActionDispatch::Http::URL.tld_length = tld_length
ActionDispatch::Request.new(env)
end
-
- def with_set(*args)
- args
- end
end

0 comments on commit bba8fc4

Please sign in to comment.
Something went wrong with that request. Please try again.