diff --git a/README.md b/README.md index f507b11..0f42908 100644 --- a/README.md +++ b/README.md @@ -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. `
` 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 diff --git a/lib/capybara/poltergeist/node.rb b/lib/capybara/poltergeist/node.rb index 9116f1e..0c31e1d 100644 --- a/lib/capybara/poltergeist/node.rb +++ b/lib/capybara/poltergeist/node.rb @@ -31,7 +31,7 @@ module Capybara::Poltergeist end def text - command :text + command(:text).strip.gsub(/\s+/, ' ') end def [](name) diff --git a/spec/integration/session_spec.rb b/spec/integration/session_spec.rb index e5bca02..b244ca9 100644 --- a/spec/integration/session_spec.rb +++ b/spec/integration/session_spec.rb @@ -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