Sha256: 2764d5b4fc216adbd9390704d1bead4c82e3a2cbe151c0df8f07e03b6d38bdbf

Contents?: true

Size: 670 Bytes

Versions: 1

Compression:

Stored size: 670 Bytes

Contents

require "helper"

class TestRedirectOk < MiniTest::Unit::TestCase
  def setup
    @agent = Mechanize.new
  end

  def test_false
    @agent.redirect_ok = false
    page = @agent.get('http://localhost/redirect_ok')
    assert_equal(URI('http://localhost/redirect_ok'), @agent.page.uri)
  end

  def test_true
    @agent.redirect_ok = true
    page = @agent.get('http://localhost/redirect_ok')
    assert_equal(URI('http://localhost/redirect_ok?q=5'), @agent.page.uri)
  end

  def test_permanent
    @agent.redirect_ok = :permanent
    page = @agent.get('http://localhost/redirect_ok')
    assert_equal(URI('http://localhost/redirect_ok?q=3'), @agent.page.uri)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
aai10-mechanize-2.0.1.0 test/test_redirect_ok.rb