Permalink
Browse files

added a test for searching bad selectors in element matching methods #…

  • Loading branch information...
1 parent e0ac874 commit aa63bc63fefd48f164e62c04e75f682e119fa4a7 @leejarvis leejarvis committed Feb 9, 2013
Showing with 10 additions and 0 deletions.
  1. +10 −0 test/test_mechanize_page.rb
@@ -191,5 +191,15 @@ def test_search_images
assert_equal "c.png", images[1].src
end
+ def test_search_bad_selectors
+ page = html_page <<-BODY
+<a href="foo.html">foo</a>
+<img src="foo.jpg" />
+ BODY
+
+ assert_empty page.images_with(:search => '//a')
+ assert_empty page.links_with(:search => '//img')
+ end
+
end

0 comments on commit aa63bc6

Please sign in to comment.