Sha256: 772e535a85f606b66b39163bea0784c32ad0c8b983460f6cb91cccdb516f0821

Contents?: true

Size: 672 Bytes

Versions: 10

Compression:

Stored size: 672 Bytes

Contents

Shindo.tests('Excon redirector support') do
  env_init

  connection = Excon.new(
    'http://127.0.0.1:9292',
    :middlewares  => Excon.defaults[:middlewares] + [Excon::Middleware::RedirectFollower],
    :mock         => true
  )

  Excon.stub(
    { :path => '/old' },
    {
      :headers  => { 'Location' => 'http://127.0.0.1:9292/new' },
      :body     => 'old',
      :status   => 301
    }
  )

  Excon.stub(
    { :path => '/new' },
    {
      :body     => 'new',
      :status   => 200
    }
  )

  tests("request(:method => :get, :path => '/old').body").returns('new') do
    connection.request(:method => :get, :path => '/old').body
  end

  env_restore
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
excon-0.29.0 tests/middlewares/redirect_follower_tests.rb
excon-0.28.0 tests/middlewares/redirect_follower_tests.rb
excon-0.27.6 tests/middlewares/redirect_follower.rb
excon-0.27.5 tests/middlewares/redirect_follower.rb
excon-0.27.4 tests/middlewares/redirect_follower.rb
excon-0.27.3 tests/middlewares/redirect_follower.rb
excon-0.27.2 tests/middlewares/redirect_follower.rb
excon-0.27.1 tests/middlewares/redirect_follower.rb
excon-0.27.0 tests/middlewares/redirect_follower.rb
excon-0.26.0 tests/middlewares/redirect_follower.rb