The Prologue
There is an ActionView configuration apply_stylesheet_media_default.
At Rails 7 the default value has changed from 'true' to (3 gueses: Yes false). See Configuring Rails Applications.
The Action
Minipack's tests assume that stylesheet_link_tag will always return a media value, but the change in default means this is not happening in Rails 7.
I have added a custom matcher which should compare the html, while ignoring the media attribute, but it's not working.
It will ignore attributes by name or by css selector, but not if the attribute is completely missing from one of the fragments.
The Epilogue
Other options?
P.S. As soon as i submitted this comment I turned around and did my testing on Rails 6 and all was well. However, Rails 7 awaits...
The Prologue There is an ActionView configuration
apply_stylesheet_media_default
. At Rails 7 the default value has changed from 'true' to (3 gueses: Yesfalse
). See Configuring Rails Applications.The Action Minipack's tests assume that
stylesheet_link_tag
will always return a media value, but the change in default means this is not happening in Rails 7.I have added a custom matcher which should compare the html, while ignoring the
media
attribute, but it's not working. It will ignore attributes by name or by css selector, but not if the attribute is completely missing from one of the fragments.The Epilogue Other options?
P.S. As soon as i submitted this comment I turned around and did my testing on Rails 6 and all was well. However, Rails 7 awaits...