Sha256: 7c89f501178cffa5934e9a5840df7fd1ca13c36172c5c3832e063d3f7bd2b913
Contents?: true
Size: 872 Bytes
Versions: 30
Compression:
Stored size: 872 Bytes
Contents
require_relative "spec_helper" describe "redirects" do it "should be immediately processed" do app do |r| r.root do r.redirect "/hello" "Foo" end r.is "about" do r.redirect "/hello", 301 "Foo" end r.is 'foo' do r.get do r.redirect end r.post do r.redirect end end end status.must_equal 302 header('Location').must_equal '/hello' body.must_equal '' status("/about").must_equal 301 header('Location', "/about").must_equal '/hello' body("/about").must_equal '' status("/foo", 'REQUEST_METHOD'=>'POST').must_equal 302 header('Location', "/foo", 'REQUEST_METHOD'=>'POST').must_equal '/foo' body("/foo", 'REQUEST_METHOD'=>'POST').must_equal '' proc{req('/foo')}.must_raise(Roda::RodaError) end end
Version data entries
30 entries across 30 versions & 1 rubygems