-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rack-test driver adds additional carriage return to CR+LF in textareas #2547
Rack-test driver adds additional carriage return to CR+LF in textareas #2547
Conversation
Unfortunately this test fails with a real browser (Chrome). You can run the chrome tests via |
The test runs successful for me. Does it fail with a specific chrome version? I have added diff --git a/lib/capybara/spec/session/fill_in_spec.rb b/lib/capybara/spec/session/fill_in_spec.rb
index d56074b6..eb01eb99 100644
--- a/lib/capybara/spec/session/fill_in_spec.rb
+++ b/lib/capybara/spec/session/fill_in_spec.rb
@@ -98,7 +98,7 @@ Capybara::SpecHelper.spec '#fill_in' do
expect(extract_results(@session)['description']).to eq("\r\nSome text\r\n")
end
- it 'should handle carriage returns with line feeds in a textarea correct' do
+ it 'should handle carriage returns with line feeds in a textarea correct', :focus_ do
@session.fill_in('form_description', with: "\r\nSome text\r\n")
@session.click_button('awesome')
expect(extract_results(@session)['description']).to eq("\r\nSome text\r\n") And ran the chrome test:
And also with Chrome Beta:
When i run the whole test suite (without the focus metadata) it also finishes successfully. |
3265b3c
to
9122dd1
Compare
@hoffi Interesting -- it was failing for me, but is no longer - possible there was an issue with an earlier version of chromedriver/chrome .... thanks for testing it again |
According to the HTML spec line breaks in forms should be represented as CR+LF (
\r\n
). The rack-test driver correctly converts this when a textarea contains\n
. However if the textarea already had\r\n
the driver adds another\r
after the form is submitted resulting in an additional carriage return:\r\r\n
.This change does not add an additional carriage return when there already is one.