Sha256: bacad6818c90a00e4a153a87005e3ca544fcb4ce70423c0a5cad841dceef026d
Contents?: true
Size: 1.21 KB
Versions: 1
Compression:
Stored size: 1.21 KB
Contents
require File.expand_path(File.join(File.dirname(__FILE__), "helper")) class TestPage < Test::Unit::TestCase def setup @agent = WWW::Mechanize.new end def test_set_encoding page = @agent.get("http://localhost/file_upload.html") page.encoding = 'UTF-8' assert_equal 'UTF-8', page.parser.encoding end def test_page_gets_yielded pages = nil @agent.get("http://localhost/file_upload.html") { |page| pages = page } assert pages assert_equal('File Upload Form', pages.title) end def test_title page = @agent.get("http://localhost/file_upload.html") assert_equal('File Upload Form', page.title) end def test_no_title page = @agent.get("http://localhost/no_title_test.html") assert_equal(nil, page.title) end def test_find_form_with_hash page = @agent.get("http://localhost/tc_form_action.html") form = page.form(:name => 'post_form1') assert form yielded = false form = page.form(:name => 'post_form1') { |f| yielded = true assert f assert_equal(form, f) } assert yielded form_by_action = page.form(:action => '/form_post?a=b&b=c') assert form_by_action assert_equal(form, form_by_action) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mechanize-0.9.1 | test/test_page.rb |