title: Rails3, Cucumber, Capybara, File upload => bad content body (EOFError)?
body: <p>I'm having a hard time getting a simple file upload test working.  I'm using Rails 3.0.0 on ruby 1.9.2 with Cucumber and Capybara.</p>
  
  <p>View:</p>
  
  <pre><code>&lt;%= form_tag "/upload/create", :multipart =&gt; true do %&gt;
    &lt;label for="file"&gt;File to Upload:&lt;/label&gt;
    &lt;%= file_field_tag "file" %&gt;
    &lt;%= submit_tag "Upload" %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>Cucumber Step:</p>
  
  <pre><code>When /^I upload the basic file$/ do  
    visit path_to("upload")
    path = File.join(::Rails.root, "somefile") 
    attach_file("file", path)
    click_button("Upload")
  end
  </code></pre>
  
  <p>In my controller, i have commented out everything except for:</p>
  
  <pre><code>def create
    file = params[:file]
  end
  </code></pre>
  
  <p>Gemfile snippet:</p>
  
  <pre><code>group :development, :test do
    # testing with specs
    gem "ZenTest", "&gt;= 4.3.3"
    gem "autotest"
    gem "rspec-rails", "&gt;= 2.0.0.beta.19", :git =&gt; "git://github.com/rspec/rspec-rails.git"
    gem "rspec", :git =&gt; "git://github.com/rspec/rspec.git"
    gem "rspec-core", :git =&gt; "git://github.com/rspec/rspec-core.git"
    gem "rspec-expectations", :git =&gt; "git://github.com/rspec/rspec-expectations.git"
    gem "rspec-mocks", :git =&gt; "git://github.com/rspec/rspec-mocks.git"
    # cucumber stuff
    gem 'capybara'
    gem 'database_cleaner'
    gem 'cucumber-rails'
    gem 'cucumber'
    gem 'spork'
    gem 'launchy'    # So you can do Then show me the page
    gem 'escape_utils' # needed to fix Cucumber - http://crimpycode.brennonbortz.com/?p=42
  end
  </code></pre>
  
  <p>When I try to run the test, I receive:</p>
  
  <blockquote>
  <pre><code>(::) failed steps (::)
  bad content body (EOFError)
  &lt;internal:prelude&gt;:10:in `synchronize'
  </code></pre>
  </blockquote>
  
  <p>I appreciate any help or insight.  Thanks.</p>