Open triskweline opened 3 years ago
I've just found the same same thing, which is impeding some tests.
Using either ignore_attrs_by_name: ["media"],
or ignore_attrs: ['[media]'],
a fragment with a media
attribute is considered different from one without a media atttribute.
Would it be possible to have yet_another_option such as :ignore_nil_attributes
?
Note: a change in Rails 7: ActionView config.apply_stylesheet_media_default is causing the changes in the markup being compared.
thanks
Thank you for this gem! I found it to be super helpful in tests.
One thing that was really unexpected for me is that options to ignore attributes require the attribute to be present in both elements.
For example, with
ignore_attrs_by_name: ['class']
I expected the following two elements to be equivalent:However, they are considered to be different.
For them to be equivalent the second element must have a
[class]
attribute, with any value:Maybe this is something that could be changed or documented.
Thanks again for the gem!