From 5b5d0e325d9b031638c0cebb128f2acc3dd764c4 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sun, 1 Feb 2009 01:01:49 -0600 Subject: Use Rack::Head middleware to ensure the body is discarded for HEAD requests --- actionpack/test/controller/integration_test.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'actionpack/test/controller/integration_test.rb') diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb index 4f07cbee47..dc2c6fae49 100644 --- a/actionpack/test/controller/integration_test.rb +++ b/actionpack/test/controller/integration_test.rb @@ -266,6 +266,7 @@ class IntegrationProcessTest < ActionController::IntegrationTest assert_response :success assert_response :ok assert_equal({}, cookies) + assert_equal "OK", body assert_equal "OK", response.body assert_kind_of HTML::Document, html_document assert_equal 1, request_count @@ -281,6 +282,7 @@ class IntegrationProcessTest < ActionController::IntegrationTest assert_response :success assert_response :created assert_equal({}, cookies) + assert_equal "Created", body assert_equal "Created", response.body assert_kind_of HTML::Document, html_document assert_equal 1, request_count @@ -360,6 +362,18 @@ class IntegrationProcessTest < ActionController::IntegrationTest end end + def test_head + with_test_route_set do + head '/get' + assert_equal 200, status + assert_equal "", body + + head '/post' + assert_equal 201, status + assert_equal "", body + end + end + private def with_test_route_set with_routing do |set| -- cgit v1.2.3 From 278186534c0ccf285a20497461f40d2e54aa20a0 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 3 Feb 2009 18:25:37 -0800 Subject: Bump mocha requirement for Ruby 1.9 compat. Remove uses_mocha. --- actionpack/test/controller/integration_test.rb | 4 ---- 1 file changed, 4 deletions(-) (limited to 'actionpack/test/controller/integration_test.rb') diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb index dc2c6fae49..57517e45a7 100644 --- a/actionpack/test/controller/integration_test.rb +++ b/actionpack/test/controller/integration_test.rb @@ -1,7 +1,5 @@ require 'abstract_unit' -uses_mocha 'integration' do - class SessionTest < Test::Unit::TestCase StubApp = lambda { |env| [200, {"Content-Type" => "text/html", "Content-Length" => "13"}, "Hello, World!"] @@ -417,5 +415,3 @@ class MetalTest < ActionController::IntegrationTest assert_equal '', response.body end end - -end -- cgit v1.2.3 From 524d8edf68ab94315a128cbd7570d1cf4faf7d7a Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sat, 7 Feb 2009 16:18:09 -0600 Subject: Update bundled Rack for Ruby 1.9 spec changes --- actionpack/test/controller/integration_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/test/controller/integration_test.rb') diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb index 57517e45a7..b3f40fbe95 100644 --- a/actionpack/test/controller/integration_test.rb +++ b/actionpack/test/controller/integration_test.rb @@ -296,7 +296,7 @@ class IntegrationProcessTest < ActionController::IntegrationTest assert_equal "Gone", status_message assert_response 410 assert_response :gone - assert_equal ["cookie_1=; path=/", "cookie_3=chocolate; path=/"], headers["Set-Cookie"] + assert_equal "cookie_1=; path=/\ncookie_3=chocolate; path=/", headers["Set-Cookie"] assert_equal({"cookie_1"=>"", "cookie_2"=>"oatmeal", "cookie_3"=>"chocolate"}, cookies) assert_equal "Gone", response.body end -- cgit v1.2.3 From d0e5417861fad15e9e493a1843f8b54fb7a993ec Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sun, 15 Mar 2009 23:25:12 -0500 Subject: update rack fixture to be ruby 1.9 compat --- actionpack/test/controller/integration_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/test/controller/integration_test.rb') diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb index b3f40fbe95..43d2307d34 100644 --- a/actionpack/test/controller/integration_test.rb +++ b/actionpack/test/controller/integration_test.rb @@ -2,7 +2,7 @@ require 'abstract_unit' class SessionTest < Test::Unit::TestCase StubApp = lambda { |env| - [200, {"Content-Type" => "text/html", "Content-Length" => "13"}, "Hello, World!"] + [200, {"Content-Type" => "text/html", "Content-Length" => "13"}, ["Hello, World!"]] } def setup -- cgit v1.2.3 From 4185a4a5f5e53b55c9ba3757a837d33fb91f4091 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sun, 15 Mar 2009 23:48:07 -0500 Subject: update rack fixture to be ruby 1.9 compat --- actionpack/test/controller/integration_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack/test/controller/integration_test.rb') diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb index 43d2307d34..e39a934c24 100644 --- a/actionpack/test/controller/integration_test.rb +++ b/actionpack/test/controller/integration_test.rb @@ -389,9 +389,9 @@ class MetalTest < ActionController::IntegrationTest class Poller def self.call(env) if env["PATH_INFO"] =~ /^\/success/ - [200, {"Content-Type" => "text/plain", "Content-Length" => "12"}, "Hello World!"] + [200, {"Content-Type" => "text/plain", "Content-Length" => "12"}, ["Hello World!"]] else - [404, {"Content-Type" => "text/plain", "Content-Length" => "0"}, ''] + [404, {"Content-Type" => "text/plain", "Content-Length" => "0"}, []] end end end -- cgit v1.2.3