summaryrefslogtreecommitdiff
path: root/test/spec_response.rb
diff options
context:
space:
mode:
authordeepj <deepjungle.maca@gmail.com>2015-08-29 21:58:02 +0200
committerdeepj <deepjungle.maca@gmail.com>2015-08-29 21:58:02 +0200
commit09b82715c2e4733ba900575f983824c283e029ab (patch)
treee5cbe37613f089a100fefc8500624b04d00326cd /test/spec_response.rb
parent9792bf590add0f09f301f00cdb296b333ec01f24 (diff)
downloadrack-09b82715c2e4733ba900575f983824c283e029ab.tar.gz
Rack::Response::Helpers#redirect? would accept 308 status code
308 status code is ‘Permanent Redirect’ (see http://greenbytes.de/tech/webdav/draft-reschke-http-status-308-07.html) and `Rack::Response::Helpers#redirect?` would accept it as a redirection when 308 status is supported by Rack.
Diffstat (limited to 'test/spec_response.rb')
-rw-r--r--test/spec_response.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/spec_response.rb b/test/spec_response.rb
index 27736fd6..73634b9e 100644
--- a/test/spec_response.rb
+++ b/test/spec_response.rb
@@ -241,6 +241,18 @@ describe Rack::Response do
res.must_be :redirect?
res.must_be :moved_permanently?
+ res.status = 302
+ res.must_be :redirect?
+
+ res.status = 303
+ res.must_be :redirect?
+
+ res.status = 307
+ res.must_be :redirect?
+
+ res.status = 308
+ res.must_be :redirect?
+
res.status = 400
res.wont_be :successful?
res.must_be :client_error?
@@ -274,9 +286,6 @@ describe Rack::Response do
res.status = 501
res.wont_be :successful?
res.must_be :server_error?
-
- res.status = 307
- res.must_be :redirect?
end
it "provide access to the HTTP headers" do