Skip to content
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 should ignore the first leading newline inside textarea tag #55

Closed
khustochka opened this issue Mar 30, 2012 · 3 comments
Closed

Comments

@khustochka
Copy link

Rails recently introduced a newline after opening <textarea> tag (rails/rails#4000). All browsers ignore this newline.

But rack-test does not. So if the test opens edit page with textarea, and clicks 'Save', then an additional trailing newline is added to the value, sent to the controller and saved to the DB.

The proof app is here: https://github.com/khustochka/newline_test

It has two integration tests, one driven with Selenium, another with rack-test. The first passes, the second fails.

@khustochka
Copy link
Author

Sorry, I believe I posted it to the wrong place, it is rather a capybara bug...

@brynary
Copy link
Collaborator

brynary commented Mar 30, 2012

This doesn't seem like an issue for Rack-Test, but an issue for Capybara.

Rack-Test is deliberately unaware of browser behavior. It just speaks
HTTP. Capybara would be responsible for simulating the browser in
Rack-Test mode and handing off the correct HTTP-level information to
Rack-Test.

Hope that helps.

-Bryan

On Fri, Mar 30, 2012 at 11:12 AM, khustochka
reply@reply.github.com
wrote:

Rails recently introduced a newline after opening <textarea> tag (rails/rails#4000). All browsers ignore this newline.

But rack test does not. So if the test opens edit page with textarea, then clicks save an additional trailing newline is added to the value and saved to the DB.

The proof app is here: https://github.com/khustochka/newline_test

It has two integration tests, one driven with Selenium, another with rack-test. The first passes, the second fails.


Reply to this email directly or view it on GitHub:
#55

@khustochka
Copy link
Author

Thanks for the explanation. I must have investigated more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants