Sha256: f1b35761fafe9e7ad027d2e273dc5b46e686f805e19a0acbf672c07d2e731b23

Contents?: true

Size: 469 Bytes

Versions: 7

Compression:

Stored size: 469 Bytes

Contents

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

test "redirect" do
  Cuba.define do
    on "hello" do
      res.write "hello, world"
    end

    on "" do
      res.redirect "/hello"
    end
  end

  env = { "SCRIPT_NAME" => "/", "PATH_INFO" => "/" }

  status, headers, body = Cuba.call(env)

  assert_equal status, 302
  assert_equal headers, {
    "Content-Type" => "text/html; charset=utf-8",
    "Location" => "/hello" }
  assert_response body, []
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cuba-3.2.0 test/redirect.rb
cuba-3.1.1 test/redirect.rb
cuba-3.1.0 test/redirect.rb
cuba-3.1.0.rc2 test/redirect.rb
cuba-3.1.0.rc1 test/redirect.rb
cuba-3.0.1.rc2 test/redirect.rb
cuba-3.0.1.rc1 test/redirect.rb