0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-12 03:37:13 +08:00
discourse/spec/support/matchers/dom_matcher.rb
Jarek Radosz 960f34da9d
DEV: Finish extracting rails spec helpers (#40552)
Also move matchers to a subdirectory
2026-06-04 14:11:14 +02:00

12 lines
336 B
Ruby
Vendored

# frozen_string_literal: true
include Rails::Dom::Testing::Assertions::DomAssertions
RSpec::Matchers.define :be_same_dom do |expected|
match do |actual|
assert_dom_equal(expected, actual)
rescue Minitest::Assertion
false
end
failure_message { |actual| "Expected DOM:\n#{expected}\nto be the same as:\n#{actual}" }
end