1
0
Fork 0
mirror of https://github.com/teampoltergeist/poltergeist.git synced 2022-11-09 12:05:00 -05:00

Revert "Don't strip newlines in Node#text"

This reverts commit 8abc10a9cc.

See comments at
8abc10a9cc

Capybara master has a spec to ensure that #text strips whitespace:
060fc3a72d

That test isn't in the Capybara 1.1 branch hence we weren't failing.
However we should honour the correct behaviour.
This commit is contained in:
Jon Leighton 2012-10-02 23:36:48 +01:00
parent 1ca23145f6
commit 943398fdd2
3 changed files with 3 additions and 5 deletions

View file

@ -216,9 +216,7 @@ makes debugging easier). Running `rake autocompile` will watch the
[Issue #127]
* Use `el.innerText` for `Node#text`. This ensures that e.g. `<br>` is
returned as a newline. It also simplifies the method. [Issue #139]
* Don't strip newlines in `Node#text`. [Issue #128]
returned as a space. It also simplifies the method. [Issue #139]
* Fix status code support when a response redirects to another URL.
This was previously tested to ensure it would return the status code

View file

@ -31,7 +31,7 @@ module Capybara::Poltergeist
end
def text
command :text
command(:text).strip.gsub(/\s+/, ' ')
end
def [](name)

View file

@ -313,7 +313,7 @@ describe Capybara::Session do
it 'returns BR as a space in #text' do
@session.visit '/poltergeist/simple'
@session.find(:css, '#break').text.should == "Foo\nBar"
@session.find(:css, '#break').text.should == "Foo Bar"
end
end
end