Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #11751 from rmm5t/assert_dom_equal-message

Pass assert_dom_equal message arg to underlying assertion
Conflicts:
	actionpack/CHANGELOG.md
  • Loading branch information...
commit 323150632f2d848df88e320779ed08f2c546de18 1 parent 5deedc6
@rafaelfranca rafaelfranca authored
View
7 actionpack/CHANGELOG.md
@@ -1,5 +1,12 @@
## unreleased ##
+* Fix an issue where `assert_dom_equal` and `assert_dom_not_equal` were
+ ignoring the passed failure message argument.
+
+ Fixes #11751
+
+ *Ryan McGeary*
+
* Fix `current_page?` when the URL contains escaped characters and the
original URL is using the hexadecimal lowercased.
View
8 actionpack/lib/action_dispatch/testing/assertions/dom.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.