From 104f31af1dc412160b624da1b09c5456fa862f53 Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Fri, 11 Jan 2008 06:39:56 +0000 Subject: Provide a nicer way to access headers. request.headers["Content-Type"] instead of request.headers["HTTP_CONTENT_TYPE"] [Koz] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8625 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/header_test.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 actionpack/test/controller/header_test.rb (limited to 'actionpack/test/controller') diff --git a/actionpack/test/controller/header_test.rb b/actionpack/test/controller/header_test.rb new file mode 100644 index 0000000000..33c14a187c --- /dev/null +++ b/actionpack/test/controller/header_test.rb @@ -0,0 +1,14 @@ +require 'abstract_unit' + +class HeaderTest < Test::Unit::TestCase + def setup + @headers = ActionController::Http::Headers.new("HTTP_CONTENT_TYPE"=>"text/plain") + end + + def test_content_type_works + assert_equal "text/plain", @headers["Content-Type"] + assert_equal "text/plain", @headers["content-type"] + assert_equal "text/plain", @headers["CONTENT_TYPE"] + assert_equal "text/plain", @headers["HTTP_CONTENT_TYPE"] + end +end -- cgit v1.2.3