jonleighton/poltergeist — pull request #215 by mjtko (2012-12-17 14:47:16+00:00)
Title: Ensure value (file path) is a String when using #set on an input node

This patch ensures that a String is passed over-the-wire to PhantomJS for file input paths rather than an arbitrary object.

I came across this issue when using Capybara's `#attach_file` - I happened to be using a `Pathname` object (I use `Rails.root.join` to generate a path to a fixture file) which caused the client to receive a malformed object for the file upload.

This brings Poltergeist into line with Capybara's Selenium implementation which does this, and restores the principle of least surprise! :wink:

```ruby
elsif tag_name == 'input' and type == 'file'
resynchronize do
native.send_keys(value.to_s)
end
```