Ruby on rails 没有错误消息
Cucumber给了我无法使用的错误消息,或者可能是Rails中的一个设置,我可以修改?这是我的错误消息的样子:Ruby on rails 没有错误消息,ruby-on-rails,ruby-on-rails-3.2,cucumber,Ruby On Rails,Ruby On Rails 3.2,Cucumber,Cucumber给了我无法使用的错误消息,或者可能是Rails中的一个设置,我可以修改?这是我的错误消息的样子: expected to find text "edit" in "Internal Server Error undefined method `empty?' for nil:NilClass WEBrick/1.3.1 (Ruby/2.0.0/2013-05-14) at lvh.me:58126" (RSpec::Expectations::ExpectationNotMet
expected to find text "edit" in "Internal Server Error undefined method `empty?' for nil:NilClass WEBrick/1.3.1 (Ruby/2.0.0/2013-05-14) at lvh.me:58126" (RSpec::Expectations::ExpectationNotMetError)
./features/step_definitions/products.rb:83:in `/^I visit that product$/'
features/product_edit.feature:6:in `And I visit that product'
没有文件+行给出我可以找到错误的地方。有人知道我怎样才能带回有意义的错误消息吗?这是堆栈:
cucumber (1.3.3)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.12.0)
multi_json (~> 1.7.5)
multi_test (~> 0.0.1)
cucumber-rails (1.3.1)
capybara (>= 1.1.2)
cucumber (>= 1.2.0)
nokogiri (>= 1.5.0)
rails (~> 3.0)
poltergeist (1.3.0)
*更新:*我刚刚意识到只有在使用“恶鬼”时才会发生这种情况。实际上它给了你两个有用的提示:
./features/step_definitions/products.rb:83
及
这个信息非常好。Cucumber告诉您,product\u edit.feature
中定义的功能未通过验证,因为服务器在复制时返回错误500,我访问了产品步骤
Cucumber与服务器无关,不会与底层Rails世界“对话”
您应该做的是查看steps\u definitions/products.rb
文件第83行,看看您在那里做什么。然后在浏览器中重现这些步骤,看看出了什么问题。可能它与特定的产品展示页面有关。你必须确保复制给定的和描述中的条件。我刚刚意识到只有在使用Poltergeist时才会发生这种情况。
./features/product_edit.feature:6