diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-10-18 15:20:30 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-10-18 15:20:30 -0700 |
commit | 6ea781c9a7913ddf75ecdb26a273e194df95b2dc (patch) | |
tree | 2995c281a6202bc5975821c20e3c9f31f7a355e5 /actionpack/test/dispatch | |
parent | a3ad0a7b6718eef9462b519189cd67e2ca29bc28 (diff) | |
download | rails-6ea781c9a7913ddf75ecdb26a273e194df95b2dc.tar.gz rails-6ea781c9a7913ddf75ecdb26a273e194df95b2dc.tar.bz2 rails-6ea781c9a7913ddf75ecdb26a273e194df95b2dc.zip |
prefer composition over inheritence
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/header_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/header_test.rb b/actionpack/test/dispatch/header_test.rb index bc7cad8db5..4c06200a88 100644 --- a/actionpack/test/dispatch/header_test.rb +++ b/actionpack/test/dispatch/header_test.rb @@ -7,6 +7,22 @@ class HeaderTest < ActiveSupport::TestCase ) end + def test_each + headers = [] + @headers.each { |pair| headers << pair } + assert_equal [["HTTP_CONTENT_TYPE", "text/plain"]], headers + end + + def test_setter + @headers['foo'] = "bar" + assert_equal "bar", @headers['foo'] + end + + def test_key? + assert @headers.key?('HTTP_CONTENT_TYPE') + assert @headers.include?('HTTP_CONTENT_TYPE') + end + test "content type" do assert_equal "text/plain", @headers["Content-Type"] assert_equal "text/plain", @headers["content-type"] |