From e6bdee4c16310e078093c0282f2f5449fdd130cd Mon Sep 17 00:00:00 2001 From: Adam Butler Date: Wed, 16 Mar 2016 13:18:10 +0000 Subject: When a symbol is passed as a status code it must match a valid http status code. --- test/spec_utils.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/spec_utils.rb') diff --git a/test/spec_utils.rb b/test/spec_utils.rb index b24762c9..6f529170 100644 --- a/test/spec_utils.rb +++ b/test/spec_utils.rb @@ -449,6 +449,12 @@ describe Rack::Utils do Rack::Utils.status_code(:ok).must_equal 200 end + it "raise an error for an invalid symbol" do + assert_raises(ArgumentError, "Unrecognized status_code symbol") do + Rack::Utils.status_code(:foobar) + end + end + it "return rfc2822 format from rfc2822 helper" do Rack::Utils.rfc2822(Time.at(0).gmtime).must_equal "Thu, 01 Jan 1970 00:00:00 -0000" end -- cgit v1.2.1