黄瓜失败与Nokogiri [英] Cucumber Failing with Nokogiri
问题描述
我刚开始使用Cucumber,在最简单的情况下,我抛出以下错误:
I just started using Cucumber and in the simplest of scenarios I throw the following error:
未定义的方法 has_key?'for#< Nokogiri :: XML :: Element:0x10677a400> (NoMethodError)
/^(?:|I)填写([^] ) ([^] )$ /'
./features/step_definitions/web_steps.rb:36:in
features / authentication.feature:9:in当我用Joe User填写user_name时
undefined method has_key?' for #<Nokogiri::XML::Element:0x10677a400> (NoMethodError)
./features/step_definitions/web_steps.rb:36:in
/^(?:|I )fill in "([^"])" with "([^"])"$/'
features/authentication.feature:9:in `When I fill in "user_name" with "Joe User"'
场景如下...
场景:注册
假设我去注册页面
inuser_namewithJoe User
Scenario: Signup Given I go to the signup page When I fill in "user_name" with "Joe User"
这是场景,黄瓜或Nokogiri中的问题吗?任何解决方案?
Is this a problem in the Scenario, Cucumber, or Nokogiri? Any Solutions?
推荐答案
确定,这里是勺子。显然,当使用以下gems时,有一些与webrat相关的问题:黄瓜0.8.0,黄瓜条0.3.2,nokogiri 1.4.2,webrat 0.7.1
OK, here's the scoop. Apparently there is some problem related to webrat when using the following gems: cucumber 0.8.0, cucumber-rails 0.3.2, nokogiri 1.4.2, webrat 0.7.1
我重新配置了以下...
I reconfigured with the following...
脚本/ generate cucumber --rspec --capybara
script/generate cucumber --rspec --capybara
很高兴。
这篇关于黄瓜失败与Nokogiri的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!