mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 09:26:54 -06:00
15 lines
360 B
Ruby
15 lines
360 B
Ruby
# frozen_string_literal: true
|
|
include Rails::Dom::Testing::Assertions::DomAssertions
|
|
|
|
RSpec::Matchers.define :be_same_dom do |expected|
|
|
match do |actual|
|
|
begin
|
|
assert_dom_equal(expected, actual)
|
|
rescue Minitest::Assertion
|
|
false
|
|
end
|
|
end
|
|
|
|
failure_message { |actual| "Expected DOM:\n#{expected}\nto be the same as:\n#{actual}" }
|
|
end
|