为什么RSpec/Capybara没有显示错误发生的位置

Con*_*ing 6 rspec ruby-on-rails capybara capybara-webkit

我正在使用带有webkit的Capybara进行测试,但出于某种原因,当测试失败时,它会显示错误,但不会显示代码中实际发生的错误.

Failures:

  1) online shopping -  sign up
     Failure/Error: page.should have_content 'Payment added successfully'
       expected there to be content "Payment added successfully" in "Internal Server Error undefined method `client_id' for #<InvoicePayment:0x007fbd5b834008> WEBrick/1.3.1 (Ruby/1.9.3/2012-04-20) at 127.0.0.1:60324"
     # ./spec/requests/online_shopping_spec.rb:140:in `block (2 levels) in <top (required)>'
Run Code Online (Sandbox Code Playgroud)

当使用save_and_open_page它时,只显示错误,没有关于它发生位置的信息:

内部服务器错误

#NETrick/1.3.1的未定义方法`client_id'(Ruby/1.9.3/2012-04-20),版本127.0.0.1:60324

我期待看到的是错误发生的行号和功能:

app/controllers/invoices_controller.rb:30:在'show'中

我似乎无法在Google上找到与此相关的任何内容.我可能使用了错误的命名法.有谁知道如何解决这个问题?

lua*_*sus 8

基本上水豚没有关于应用程序的知识,因为它在不同的过程中运行.你可以使用这里描述的技巧解决这个问题https://gist.github.com/1443408