Sha256: 6b45aab353a5ba1d26fbb076a0d44ec7851bf1038b23256989175b366857780b

Contents?: true

Size: 519 Bytes

Versions: 5

Compression:

Stored size: 519 Bytes

Contents

require File.expand_path("spec_helper", File.dirname(__FILE__))

describe "redirects" do
  it "should be immediately processed" do
    app do |r|
      r.on "about" do
        r.redirect "/hello", 301
        "Foo"
      end
      r.on do
        r.redirect "/hello"
        "Foo"
      end
    end

    status.should == 302
    header('Location').should == '/hello'
    body.should == ''

    status("/about").should == 301
    header('Location', "/about").should == '/hello'
    body("/about").should == ''
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
roda-cj-0.9.4 spec/redirect_spec.rb
roda-cj-0.9.3 spec/redirect_spec.rb
roda-cj-0.9.2 spec/redirect_spec.rb
roda-cj-0.9.1 spec/redirect_spec.rb
roda-0.9.0 spec/redirect_spec.rb