From 7ffd2f511683d1f78fa3f0d62ffe0d58da6eb77a Mon Sep 17 00:00:00 2001 From: Thomas Walpole Date: Fri, 12 Apr 2019 14:17:45 -0700 Subject: [PATCH] Test for handler functions not interfering with CSS id queries --- test/files/tlm.html | 1 + test/html/test_document.rb | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/test/files/tlm.html b/test/files/tlm.html index 3b2b52c9824..ea2c73b459e 100644 --- a/test/files/tlm.html +++ b/test/files/tlm.html @@ -827,6 +827,7 @@

Step 3: Upload the video file

Special character div
+
Partial collision id
diff --git a/test/html/test_document.rb b/test/html/test_document.rb index 73da47044b5..0e85311343f 100644 --- a/test/html/test_document.rb +++ b/test/html/test_document.rb @@ -496,6 +496,15 @@ def awesome divs }.new) end + def test_find_with_partial_id_collision_function + found_by_id = @html.css("#partial_collision_id", Class.new { + def collision nodes + [nodes.first] + end + }.new) + assert_equal 1, found_by_id.length + end + def test_dup_shallow found = @html.search('//div/a').first dup = found.dup(0)