7

在测试环境rails s -e test(我在开发模式下得到回溯。

它是谁,我该如何禁用它?我需要完整的回溯,而不仅仅是引发的错误!

我正在使用 Rails 3.2.3、Ruby 1.9.3、rspec、capybara、capybara-webkit

4

2 回答 2

4

设置config.action_dispatch.show_exceptions = truetest.rb我做了诀窍。

于 2012-07-22T14:06:39.480 回答
3

env.rb由 Cucumber 创建的读取:

# By default, any exception happening in your Rails application will bubble up
# to Cucumber so that your scenario will fail. This is a different from how 
# your application behaves in the production environment, where an error page will 
# be rendered instead.
...
# 1) Tag your scenario (or feature) with @allow-rescue
# 2) Set the value below to true. Beware that doing this globally is not
# recommended as it will mask a lot of errors for you!

概括:

@allow-rescue
Feature: blah blah blah

会成功的。

于 2013-02-06T21:00:44.207 回答