Permalink
Browse files

Implement element equality

  • Loading branch information...
1 parent 3bc96bc commit 0efbbe0fbc741783979a28139a2deeb21336d111 @mhoran mhoran committed Nov 18, 2012
Showing with 8 additions and 0 deletions.
  1. +4 −0 lib/capybara/webkit/node.rb
  2. +4 −0 src/capybara.js
@@ -122,5 +122,9 @@ def browser
def multiple_select?
self.tag_name == "select" && self["multiple"]
end
+
+ def ==(other)
+ invoke("equals", other.native) == "true"
+ end
end
end
View
@@ -338,6 +338,10 @@ Capybara = {
};
mouseTrigger('mousemove', options);
mouseTrigger('mouseup', options);
+ },
+
+ equals: function(index, targetIndex) {
+ return this.nodes[index] === this.nodes[targetIndex];
}
};

0 comments on commit 0efbbe0

Please sign in to comment.