I'm transitioning from Capybara backed by the default Rack driver to Capybara backed by Poltergeist.
For frustrating reasons, I need to manipulate session data before loading a page. But I couldn't figure out how to manipulate the session directly with the Rack driver, so I
Capybara.current_session.driver.submit :post, "/current_search", {:session => :data }
Unfortunately, the Poltergeist driver
object has no submit
method, as the Rack driver had.
There are three possibilities:
- How do I submit a POST request with poltergeist/phantomjs? (Implementing this seems the easiest)
- How can I manipulate session data directly with poltergeist/phantomjs?
- I can restructure the code so that manipulating session data directly is no longer necessary. This would be time-consuming and is low-priority.
PS: due to being on Ruby 1.8, we are stuck on Poltergeist v1.0.2