diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2018-09-27 17:43:16 -0400 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2018-09-27 17:43:16 -0400 |
commit | b40583b4abfd6d16381308ed421a4751562fa91d (patch) | |
tree | 26b116d162664555f1606050900c34a1bc109f2d /test/spec_utils.rb | |
parent | 2a74e813336af73449615d4af1d765eec530b2a2 (diff) | |
parent | e6bdee4c16310e078093c0282f2f5449fdd130cd (diff) | |
download | rack-b40583b4abfd6d16381308ed421a4751562fa91d.tar.gz |
Merge pull request #1034 from adambutler/bugfix/response-status-default=to-raise-exception
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 0a495c95..31ba8268 100644 --- a/test/spec_utils.rb +++ b/test/spec_utils.rb @@ -462,6 +462,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 |