Sha256: 5366a952256adfe19b010799be42a39611fa7599cb976b3c85bfde97e8fabbc8

Contents?: true

Size: 1.19 KB

Versions: 9

Compression:

Stored size: 1.19 KB

Contents

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

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

  def test_no_referer
    page = @agent.get("http://localhost/referer")
    assert_equal('', page.body)
  end

  def test_send_referer
    page = @agent.get("http://localhost/tc_referer.html")
    page = @agent.click page.links.first
    assert_equal("http://localhost/tc_referer.html", page.body)
  end

  def test_fetch_two
    page1 = @agent.get("http://localhost/tc_referer.html")
    page2 = @agent.get("http://localhost/tc_pretty_print.html")
    page = @agent.click page1.links.first
    assert_equal("http://localhost/tc_referer.html", page.body)
  end

  def test_fetch_two_first
    page1 = @agent.get("http://localhost/tc_referer.html")
    page2 = @agent.get("http://localhost/tc_pretty_print.html")
    page = @agent.click page1.links
    assert_equal("http://localhost/tc_referer.html", page.body)
  end

  def test_post_form
    page1 = @agent.get("http://localhost/tc_referer.html")
    page2 = @agent.get("http://localhost/tc_pretty_print.html")
    page = @agent.submit page1.forms.first
    assert_equal("http://localhost/tc_referer.html", page.body)
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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