From 3f78de67b5827ee47d738a1dc96518f24bbb0129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sat, 29 Aug 2009 17:48:11 +0200 Subject: Ensure that blocks are also handled inside the responder. --- actionpack/test/controller/mime_responds_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/mime_responds_test.rb b/actionpack/test/controller/mime_responds_test.rb index 44536ce54e..93a815adae 100644 --- a/actionpack/test/controller/mime_responds_test.rb +++ b/actionpack/test/controller/mime_responds_test.rb @@ -726,6 +726,13 @@ class RespondWithControllerTest < ActionController::TestCase assert_equal "david", @response.body end + def test_block_inside_respond_with_is_rendered + @controller = InheritedRespondWithController.new + @request.accept = "application/json" + get :index + assert_equal "JSON", @response.body + end + def test_no_double_render_is_raised @request.accept = "text/html" assert_raise ActionView::MissingTemplate do -- cgit v1.2.3 From a79790e1a5733694baef3d03d8d79b76948a9d69 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Mon, 31 Aug 2009 23:08:20 -0500 Subject: rack-test 0.4.2 has rack 1.1.pre goodies, we'll use it instead --- actionpack/test/dispatch/test_request_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack/test') diff --git a/actionpack/test/dispatch/test_request_test.rb b/actionpack/test/dispatch/test_request_test.rb index 5da02b2ea6..b8e340e055 100644 --- a/actionpack/test/dispatch/test_request_test.rb +++ b/actionpack/test/dispatch/test_request_test.rb @@ -5,7 +5,7 @@ class TestRequestTest < ActiveSupport::TestCase env = ActionDispatch::TestRequest.new.env assert_equal "GET", env.delete("REQUEST_METHOD") - assert_equal "off", env.delete("HTTPS") + assert_equal nil, env.delete("HTTPS") assert_equal "http", env.delete("rack.url_scheme") assert_equal "example.org", env.delete("SERVER_NAME") assert_equal "80", env.delete("SERVER_PORT") @@ -18,7 +18,7 @@ class TestRequestTest < ActiveSupport::TestCase assert_equal "0.0.0.0", env.delete("REMOTE_ADDR") assert_equal "Rails Testing", env.delete("HTTP_USER_AGENT") - assert_equal [1, 0], env.delete("rack.version") + assert_equal [0, 1], env.delete("rack.version") assert_equal "", env.delete("rack.input").string assert_kind_of StringIO, env.delete("rack.errors") assert_equal true, env.delete("rack.multithread") -- cgit v1.2.3 From a5588ffc08bd2860a39d7cb457aefa88dc08fd1a Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Tue, 1 Sep 2009 01:25:39 -0400 Subject: Activate rack-test gem before it's required. This shouldn't be necessary, but should fix the build for now --- actionpack/test/abstract_unit.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index 07ba37c51c..07dc282105 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -14,6 +14,8 @@ $stderr.puts "Running old tests on new_base" require 'test/unit' require 'active_support' +gem "rack-test" + require 'active_support/test_case' require 'action_controller' require 'fixture_template' -- cgit v1.2.3 From c5f6e038daf2221ddd5a7534e68f4158d84a5975 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Tue, 1 Sep 2009 10:27:19 -0500 Subject: ActionPack test helpers need to activate rack gem --- actionpack/test/abstract_unit.rb | 7 ++++--- actionpack/test/new_base/test_helper.rb | 4 ++++ actionpack/test/old_base/abstract_unit.rb | 3 +++ 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'actionpack/test') diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index 07dc282105..a5222fc96d 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -11,11 +11,12 @@ ENV['TMPDIR'] = File.join(File.dirname(__FILE__), 'tmp') ENV['new_base'] = "true" $stderr.puts "Running old tests on new_base" +require 'rubygems' +gem "rack", "~> 1.0.0" +gem "rack-test", "~> 0.4.2" + require 'test/unit' require 'active_support' - -gem "rack-test" - require 'active_support/test_case' require 'action_controller' require 'fixture_template' diff --git a/actionpack/test/new_base/test_helper.rb b/actionpack/test/new_base/test_helper.rb index b7ccd3db8d..0833e1a11d 100644 --- a/actionpack/test/new_base/test_helper.rb +++ b/actionpack/test/new_base/test_helper.rb @@ -2,6 +2,10 @@ $:.unshift(File.dirname(__FILE__) + '/../../lib') $:.unshift(File.dirname(__FILE__) + '/../../../activesupport/lib') $:.unshift(File.dirname(__FILE__) + '/../lib') +require 'rubygems' +gem "rack", "~> 1.0.0" +gem "rack-test", "~> 0.4.2" + require 'test/unit' require 'active_support' require 'active_support/test_case' diff --git a/actionpack/test/old_base/abstract_unit.rb b/actionpack/test/old_base/abstract_unit.rb index 3301041a41..b80050bd48 100644 --- a/actionpack/test/old_base/abstract_unit.rb +++ b/actionpack/test/old_base/abstract_unit.rb @@ -8,6 +8,9 @@ $:.unshift(File.dirname(__FILE__) + '/fixtures/helpers') $:.unshift(File.dirname(__FILE__) + '/fixtures/alternate_helpers') require 'rubygems' +gem "rack", "~> 1.0.0" +gem "rack-test", "~> 0.4.2" + require 'yaml' require 'stringio' require 'test/unit' -- cgit v1.2.3