Permalink
Browse files

Pass assert_dom_equal message arg to underlying assertion

#assert_dom_equal and #assert_dom_not_equal both take a "failure"
message argument, but this argument was not utilized.
  • Loading branch information...
1 parent 7229385 commit 51520a75d5df51e865f00c9d6061d7b16a3cda4b @rmm5t rmm5t committed Aug 4, 2013
Showing with 11 additions and 4 deletions.
  1. +7 −0 actionpack/CHANGELOG.md
  2. +4 −4 actionpack/lib/action_dispatch/testing/assertions/dom.rb
@@ -1,3 +1,10 @@
+* Fix an issue where `assert_dom_equal` and `assert_dom_not_equal` were
+ ignoring the passed failure message argument.
+
+ Fixes #11751
+
+ *Ryan McGeary*
+
* Allow REMOTE_ADDR, HTTP_HOST and HTTP_USER_AGENT to be overridden from
the environment passed into `ActionDispatch::TestRequest.new`.
@@ -7,20 +7,20 @@ module DomAssertions
#
# # assert that the referenced method generates the appropriate HTML string
# assert_dom_equal '<a href="http://www.example.com">Apples</a>', link_to("Apples", "http://www.example.com")
- def assert_dom_equal(expected, actual, message = "")
+ def assert_dom_equal(expected, actual, message = nil)
expected_dom = HTML::Document.new(expected).root
actual_dom = HTML::Document.new(actual).root
- assert_equal expected_dom, actual_dom
+ assert_equal expected_dom, actual_dom, message
end
# The negated form of +assert_dom_equivalent+.
#
# # assert that the referenced method does not generate the specified HTML string
# assert_dom_not_equal '<a href="http://www.example.com">Apples</a>', link_to("Oranges", "http://www.example.com")
- def assert_dom_not_equal(expected, actual, message = "")
+ def assert_dom_not_equal(expected, actual, message = nil)
expected_dom = HTML::Document.new(expected).root
actual_dom = HTML::Document.new(actual).root
- assert_not_equal expected_dom, actual_dom
+ assert_not_equal expected_dom, actual_dom, message
end
end
end

0 comments on commit 51520a7

Please sign in to comment.