Case insensitive Rspec match

后端 未结 6 670
温柔的废话
温柔的废话 2021-02-12 10:00

I\'m writing a Capybara test and using Rspec for the assertions. My test is failing because there is a CSS style being applied that is causing the text to be in all caps. How ca

6条回答
  •  悲哀的现实
    2021-02-12 10:16

    how about using a regex to do this?

    "ALL CAPS".should match(/#{Regexp.escape('All Caps')}/i)
    

提交回复
热议问题