thoughtbot/capybara-webkit

Incompatibility with rack-test 0.7.1+

joemsak opened this issue · 2 comments

Hey there thoughtbot, I just wanted to let you know that I have been struggling with an issue in my feature specs where submitting a form with an empty file field leads to this cryptic error:

# on a form that happens to have a file field, that you happen to be leaving empty

click_button 'Save'

#... raises exception

undefined method `size` for Nil::NilClass
# and just one line of backtrace at the click_button call in the test itself
#
# I discovered that the bug happens maybe 20 lines of backtrace away
# if you try to do the call in a debugger

And I did some digging and realized it was happening with Rack::Test::UploadedFile.

I found other people having the issue here rack/rack-test#211 and through some more study, I finally landed on the issue being that the current release of capybara-webkit requires capybara <= 2.14.0, and they have actually released a compatibility fix with rack-test 0.7.1+ in their latest release, 2.16.1

If you go to the issue linked in rack-test, you can find my comments at the bottom which detail how I reached my conclusions.

Do you have any plans to update to the newest version of capybara and therefore rack-test soon, or should I keep using my patched fork of rack-test, or otherwise lock my rack-test gem down to an earlier version?

Thank you for your time!

You can lock your rack-test (or move to 0.8 I believe) or try the capybara-webkit master branch and upgrade Capybara.

Thank you @twalpole I confirm that the master branch is working for me <3