Sha256: 80c92569d57816430793d8bcef45292709fec592c1f04ea6462e7163456f5470

Contents?: true

Size: 618 Bytes

Versions: 3

Compression:

Stored size: 618 Bytes

Contents

require "test_helper"
require "rack/proxy"

class RackProxyTest < Test::Unit::TestCase
  class TrixProxy < Rack::Proxy
    def rewrite_env(env)
      env["HTTP_HOST"] = "trix.pl"
      
      env
    end
  end
  
  def app
    TrixProxy.new
  end
  
  def test_trix
    get "/"
    assert last_response.ok?
    assert /Jacek Becela/ === last_response.body
  end

  def test_header_reconstruction
    proxy = Rack::Proxy.new

    header = proxy.send(:reconstruct_header_name, "HTTP_ABC")
    assert header == "ABC"

    header = proxy.send(:reconstruct_header_name, "HTTP_ABC_D")
    assert header == "ABC-D"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rack-proxy-0.3.6 test/rack_proxy_test.rb
rack-proxy-0.3.5 test/rack_proxy_test.rb
rack-proxy-0.3.4 test/rack_proxy_test.rb