Sha256: a212d12e3ec56474e0a5d72ca03ca5679398fe4e6eff1d9fa266b5fdd31e4629

Contents?: true

Size: 812 Bytes

Versions: 9

Compression:

Stored size: 812 Bytes

Contents

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

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

  def test_frames
    page = @agent.get("http://localhost/frame_test.html")
    assert_equal(3, page.frames.size)
    assert_equal("frame1", page.frames[0].name)
    assert_equal("frame2", page.frames[1].name)
    assert_equal("frame3", page.frames[2].name)
    assert_equal("/google.html", page.frames[0].src)
    assert_equal("/form_test.html", page.frames[1].src)
    assert_equal("/file_upload.html", page.frames[2].src)
  end

  def test_iframes
    page = @agent.get("http://localhost/iframe_test.html")
    assert_equal(1, page.iframes.size)
    assert_equal("frame4", page.iframes.first.name)
    assert_equal("/file_upload.html", page.iframes.first.src)
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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