Add missing text for whitespace in has_text?, closes #824

This commit is contained in:
Jonas Nicklas 2012-09-28 16:09:34 +02:00
parent 76b8823340
commit ba0f3d9534
1 changed files with 5 additions and 0 deletions

View File

@ -32,6 +32,11 @@ Capybara::SpecHelper.spec '#has_text?' do
@session.should have_text('text with whitespace')
end
it "should ignore whitespace and newlines in the search string" do
@session.visit('/with_html')
@session.should have_text("text with \n\n whitespace")
end
it "should be false if the given text is not on the page" do
@session.visit('/with_html')
@session.should_not have_text('xxxxyzzz')