开发者

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
"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜