aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/header_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/dispatch/header_test.rb')
-rw-r--r--actionpack/test/dispatch/header_test.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/header_test.rb b/actionpack/test/dispatch/header_test.rb
index bc7cad8db5..42432510c3 100644
--- a/actionpack/test/dispatch/header_test.rb
+++ b/actionpack/test/dispatch/header_test.rb
@@ -7,6 +7,26 @@ 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
+
+ def test_fetch_with_block
+ assert_equal 'omg', @headers.fetch('notthere') { 'omg' }
+ end
+
test "content type" do
assert_equal "text/plain", @headers["Content-Type"]
assert_equal "text/plain", @headers["content-type"]