The Capybara and the JavaScript Datepicker

tldr; Turn off JavaScript input components in test mode to not have to enable JS in Capybara integration tests.

Frustrated with the slowness and the pain in setting up JavaScript enabled Capybara tests in Rails/Rspec I decided the best solution to keep my tests fast and my sanity intact was to switch my JavaScript enabled inputs to standard inputs in test mode.

Above you can see the datepicker class on the input-append div tag gets converted to a datepicker via JavaScript. Capybara can't fill in a date for that field without enabling JavaScript so instead I'm just rendering a standard Simple Form input field in test mode.