黄瓜不能按照简单的链接,在Rack Request中找不到路径方法?

时间:2011-12-16 02:14:33

标签: ruby-on-rails rubygems cucumber

我花了几个小时,我有以下简单的功能:

Feature: New User Registration

  Scenario: A user should be able to create a new account
    Given I am on the homepage
    When I follow "My Account"

当我使用

运行它时
cucumber features/authentication.feature

网络步骤的第33-36行看起来像:

When /^(?:|I )follow "([^"]*)"(?: within "([^"]*)")?$/ do |link, selector|
  with_scope(selector) do
    click_link(link)
  end
end

我收到以下错误:

/Users/jason/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack.rb:17: warning: already initialized constant VERSION

  

.F

     

(::)失败的步骤(::)

     

未定义的方法path' for #<Rack::Request:0x10577bf40> (NoMethodError) (eval):2:in发送'(eval):2:在click_link' ./features/step_definitions/web_steps.rb:35 ./features/step_definitions/web_steps.rb:14:in with_scope'中   ./features/step_definitions/web_steps.rb:34:in /^(?:|I )follow "([^"]*)"(?: within "([^"]*)")?$/' features/authentication.feature:5:in当我关注“我的帐户”时

我使用的是Ruby 1.8.7,Rails 2.3.2,Capybara 1.1.1和cucumber-rails 0.3.2

非常感谢任何帮助,把我的头发拉出来! :)

更新

我通过将capybara降级到1.0.1来解决这个问题,卸载黄瓜和放大器重新安装,它的工作原理。希望这可以帮助别人。

1 个答案:

答案 0 :(得分:0)

我通过将capybara降级到1.0.1来解决这个问题,卸载黄瓜和放大器重新安装,它的工作原理。希望这可以帮助别人。