Case insensitive Rspec match

后端 未结 6 886
温柔的废话
温柔的废话 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:23

    Here's improving on phoet's solution:

    page.body.should match(%r{#{string}}i)
    

    Unfortunately the syntax highlighting here isn't doing it much justice (it looks perfectly fine in Sublime Text)

提交回复
热议问题