开发者

Capybara -- how to check for content containing a line return

开发者 https://www.devze.com 2023-02-25 00:00 出处:网络
Say that my HTML outputs... <p>foo<p>... ...and it\'s important to check that \'foo\' is the last text in the line.

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

精彩评论

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