File upload Rails3、Cucumber、Capybara、文件上传=>;不良内容体(EOFError)?

File upload Rails3、Cucumber、Capybara、文件上传=>;不良内容体(EOFError)?,file-upload,ruby-on-rails-3,cucumber,capybara,File Upload,Ruby On Rails 3,Cucumber,Capybara,我很难让一个简单的文件上传测试正常工作。我正在使用ruby 1.9.2上的Rails 3.0.0和Cucumber和Capybara 视图: 在我的控制器中,我已注释掉除以下内容以外的所有内容: def create file = params[:file] end 文件片段: group :development, :test do # testing with specs gem "ZenTest", ">= 4.3.3" gem "autotest" gem "

我很难让一个简单的文件上传测试正常工作。我正在使用ruby 1.9.2上的Rails 3.0.0和Cucumber和Capybara

视图:

在我的控制器中,我已注释掉除以下内容以外的所有内容:

def create
  file = params[:file]
end
文件片段:

group :development, :test do
  # testing with specs
  gem "ZenTest", ">= 4.3.3"
  gem "autotest"
  gem "rspec-rails", ">= 2.0.0.beta.19", :git => "git://github.com/rspec/rspec-rails.git"
  gem "rspec", :git => "git://github.com/rspec/rspec.git"
  gem "rspec-core", :git => "git://github.com/rspec/rspec-core.git"
  gem "rspec-expectations", :git => "git://github.com/rspec/rspec-expectations.git"
  gem "rspec-mocks", :git => "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
当我尝试运行测试时,我收到:

(:)失败的步骤(:)
不良内容正文(EOFError)
:10:在“同步”中

我感谢任何帮助或见解。谢谢。

我没有答案,但在同一个环境中处理同一个问题-cukes、capybara、rails 3、1.9.2。。。。如果我知道了,我会告诉你的。你有没有想过在cucumber google组或Rails google组上发帖?如果你不知道,一旦我把我的行为集中起来,不知道我会发布到其中一个


另外,webrat似乎有attach_file()的方法,因此当我生成cucumber而不使用capybara时,它在web_steps.rb中有一个推论方法,但在我添加capybara并重新生成cucumber之后,它就消失了

这是机架测试的一个问题,在更多的人采用Rails3和Ruby 1.9.x之前,对大多数人来说可能不会是问题

将机架测试升级到已修复此问题。 我不确定什么时候机架测试会在gem中包含这些更改

另见:

谢谢你帮助我,大卫。我还没有时间尝试回到webrat上,所以我不确定问题出在哪里。到目前为止,我已经在git上发布了水豚的主页,但还没有收到回复。
def create
  file = params[:file]
end
group :development, :test do
  # testing with specs
  gem "ZenTest", ">= 4.3.3"
  gem "autotest"
  gem "rspec-rails", ">= 2.0.0.beta.19", :git => "git://github.com/rspec/rspec-rails.git"
  gem "rspec", :git => "git://github.com/rspec/rspec.git"
  gem "rspec-core", :git => "git://github.com/rspec/rspec-core.git"
  gem "rspec-expectations", :git => "git://github.com/rspec/rspec-expectations.git"
  gem "rspec-mocks", :git => "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
(::) failed steps (::)
bad content body (EOFError)
<internal:prelude>:10:in `synchronize'