Sha256: b27ba5aa0dff725bda39183b7cb6c27f9cdccea5a829a54e3378c8a3243fb511

Contents?: true

Size: 732 Bytes

Versions: 9

Compression:

Stored size: 732 Bytes

Contents

require File.dirname(__FILE__) + "/helper"

class FollowMetaTest < Test::Unit::TestCase
  def setup
    @agent = WWW::Mechanize.new
  end

  def test_follow_meta
    page = @agent.get('http://localhost/tc_follow_meta.html')
    assert_equal('http://localhost/tc_follow_meta.html', page.uri.to_s)
    assert_equal(1, page.meta.length)

    @agent.follow_meta_refresh = true
    page = @agent.get('http://localhost/tc_follow_meta.html')
    assert_equal('http://localhost/index.html', page.uri.to_s)
    assert_equal(3, @agent.history.length)
  end

  def test_follow_meta_on_302
    @agent.follow_meta_refresh = true
    assert_nothing_raised {
      @agent.get("http://localhost/response_code?code=302&ct=test/xml")
    }
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mechanize-0.7.5 test/tc_follow_meta.rb
mechanize-0.7.0 test/tc_follow_meta.rb
mechanize-0.7.1 test/tc_follow_meta.rb
mechanize-0.7.2 test/tc_follow_meta.rb
mechanize-0.7.3 test/tc_follow_meta.rb
mechanize-0.7.4 test/tc_follow_meta.rb
mechanize-0.7.6 test/tc_follow_meta.rb
mechanize-0.7.7 test/test_follow_meta.rb
mechanize-0.7.8 test/test_follow_meta.rb