diff options
author | Adam Butler <adam@lab.io> | 2016-03-16 13:18:10 +0000 |
---|---|---|
committer | Adam Butler <adam@lab.io> | 2016-03-16 13:18:10 +0000 |
commit | e6bdee4c16310e078093c0282f2f5449fdd130cd (patch) | |
tree | cb3484fa63e074e3f447e3035128d1ddf51c442a /test/spec_utils.rb | |
parent | 95172a60fe5c2a3850163fc75e0981fe440c064e (diff) | |
download | rack-e6bdee4c16310e078093c0282f2f5449fdd130cd.tar.gz |
When a symbol is passed as a status code it must match a valid http status code.
Diffstat (limited to 'test/spec_utils.rb')
-rw-r--r-- | test/spec_utils.rb | 6 |
1 files changed, 6 insertions, 0 deletions
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 |