Sha256: 71eba0dd79b889e943efe6a54dad522235568a1355e6494f3e017f7024d2130d

Contents?: true

Size: 415 Bytes

Versions: 13

Compression:

Stored size: 415 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, { "Location" => "/hello" }
  assert_response body, []
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
cuba-4.0.1 test/redirect.rb
cuba-4.0.0 test/redirect.rb
cuba-3.9.3 test/redirect.rb
cuba-3.9.2 test/redirect.rb
cuba-3.9.1 test/redirect.rb
cuba-3.9.0 test/redirect.rb
cuba-3.8.1 test/redirect.rb
cuba-3.8.0 test/redirect.rb
cuba-3.7.0 test/redirect.rb
cuba-3.6.0 test/redirect.rb
cuba-3.5.0 test/redirect.rb
cuba-3.4.0 test/redirect.rb
cuba-3.3.0 test/redirect.rb