As @splattael suggested, `assert_equal 46, response['Content-Length']` is better. Remember that `assert_equal` parameter order is important, first what you expect, second what you got. See http://ruby-doc.org/stdlib-2.0.0/libdoc/test/unit/rdoc/Test/Unit/Assertions.html#method-i-assert_equal