Capybara -- how to check for content containing a line return
Say that my HTML outputs...
<p>foo<p>...
...and it's important to check that 'foo' is the last text in the line.
What's the quickest way to check for the line return using Capybara?
Then I should see "foo\n"
is not working for me.
The error is:
expected #has_content?("Cached Slug: foo\\n") to return true, got false (RSpec::Expectations::Expe开发者_Go百科ctationNotMetError)
The following works, but of course doesn't check for the line return:
Then I should see "foo"
Have you tried
Then I should see "foo
"
精彩评论