jnicklas/capybara — pull request #687 by khustochka (2012-04-09 08:27:54+00:00)
Title: Rack-test driver should ignore the first leading newline in textarea (fixes #677)

Rails recently (since v3.2.3.rc1) introduced a newline after opening tag (https://github.com/rails/rails/pull/4000). They say the XHTML spec says to ignore this newline and all modern browsers do.

This change makes capybara rack-test driver to do the same (fixes #677)

However I have two considerations/questions:

1) `with_html.erb` file looks a bit uglier now. The reason is `textarea` tag is pretty much like `pre` where every whitespace is significant, so if you add additional newlines and indentation they are all included in the text.

2) Probably I should have patched not `Capybara::Node::Simple#value` but `Capybara::RackTest::Node#value`?