diff options
author | Timm <kaspth@gmail.com> | 2013-08-17 11:40:40 +0200 |
---|---|---|
committer | Timm <kaspth@gmail.com> | 2014-06-16 21:04:10 +0200 |
commit | 73c690d4fd8a15b1572e5e88a094064734f541ac (patch) | |
tree | db2b70d137e0d57be0c71f1a83eaa0c072338a35 /actionview | |
parent | bab54e4e529ae4d727fae8209ac60f9b25802680 (diff) | |
download | rails-73c690d4fd8a15b1572e5e88a094064734f541ac.tar.gz rails-73c690d4fd8a15b1572e5e88a094064734f541ac.tar.bz2 rails-73c690d4fd8a15b1572e5e88a094064734f541ac.zip |
Removed html_strings variable, no splat operator needed.
Diffstat (limited to 'actionview')
-rw-r--r-- | actionview/lib/action_view/testing/assertions/dom.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/actionview/lib/action_view/testing/assertions/dom.rb b/actionview/lib/action_view/testing/assertions/dom.rb index 85a01f9b87..8df03445a8 100644 --- a/actionview/lib/action_view/testing/assertions/dom.rb +++ b/actionview/lib/action_view/testing/assertions/dom.rb @@ -6,7 +6,7 @@ module ActionView # # 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 = nil) - assert dom_assertion(message, expected, actual) + assert dom_assertion(expected, actual, message) end # The negated form of +assert_dom_equal+. @@ -14,12 +14,12 @@ module ActionView # # 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 = nil) - assert_not dom_assertion(message, expected, actual) + assert_not dom_assertion(expected, actual, message) end protected - def dom_assertion(message = nil, *html_strings) - expected, actual = html_strings.map { |str| Loofah.fragment(str) } + def dom_assertion(expected_string, actual_string, message = nil) + expected, actual = Loofah.fragment(expected_string), Loofah.fragment(actual_string) message ||= "Expected: #{expected}\nActual: #{actual}" return compare_doms(expected, actual), message end |