Sha256: 8c6b32483426422cddf449bb8394f63e73ed42d5cd6fd4f481f471003baecba3
Contents?: true
Size: 796 Bytes
Versions: 2
Compression:
Stored size: 796 Bytes
Contents
require File.expand_path("spec_helper", File.dirname(File.dirname(__FILE__))) describe "status_303 plugin" do it 'uses a 302 for get requests' do app(:status_303) do request.redirect '/foo' fail 'redirect should halt' end status.must_equal 302 body.must_equal '' header('Location').must_equal '/foo' end it 'uses the code given when specified' do app(:status_303) do request.redirect '/foo', 301 end status.must_equal 301 end it 'uses 303 for post requests if request is HTTP 1.1, 302 for 1.0' do app(:status_303) do request.redirect '/foo' end status('HTTP_VERSION' => 'HTTP/1.1', 'REQUEST_METHOD'=>'POST').must_equal 303 status('HTTP_VERSION' => 'HTTP/1.0', 'REQUEST_METHOD'=>'POST').must_equal 302 end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
roda-2.29.0 | spec/plugin/status_303_spec.rb |
roda-2.28.0 | spec/plugin/status_303_spec.rb |