I have this string inside my html code:
1\n \n word
I want to make an assert_select that ignores those new lines and spaces, so I have tried this:
assert_select ".myclass", /1.+word/
But it does not work:
1) Failure:
test_new_line(NewLineControllerTest) [test/functional/new_line_controller_test.rb:23]:
</1.+word/> expected but was
<"1\n \n word">.
How can I fix it?
You need to specify the multiline flag since there are multiple lines in that string.
assert_select ".myclass", /1.+word/m
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With