diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-11-19 21:20:17 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-11-19 21:20:17 -0200 |
commit | bba8fc4294ca7f7d90c3e64e7fea059b17caef5c (patch) | |
tree | 2121fdd5422f8757b1e2bee5ac722ff5a4de4a8f /actionpack | |
parent | 14620eae3451a76d4c15490f3dfe0397c9dc1efb (diff) | |
download | rails-bba8fc4294ca7f7d90c3e64e7fea059b17caef5c.tar.gz rails-bba8fc4294ca7f7d90c3e64e7fea059b17caef5c.tar.bz2 rails-bba8fc4294ca7f7d90c3e64e7fea059b17caef5c.zip |
Refactor request tests, remove #with_set method
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/test/dispatch/request_test.rb | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/actionpack/test/dispatch/request_test.rb b/actionpack/test/dispatch/request_test.rb index e2964f9071..2bc145c1cc 100644 --- a/actionpack/test/dispatch/request_test.rb +++ b/actionpack/test/dispatch/request_test.rb @@ -355,7 +355,6 @@ class RequestTest < ActiveSupport::TestCase 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 @@ class RequestTest < ActiveSupport::TestCase 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 @@ protected ActionDispatch::Http::URL.tld_length = tld_length ActionDispatch::Request.new(env) end - - def with_set(*args) - args - end end |