# \[Rails3\] Displaying the full stack trace for test errors?

**URL:** <https://www.ruby-forum.com/t/rails3-displaying-the-full-stack-trace-for-test-errors/190595>\
**Category:** Rails\
**Created:** [June 23, 2010, 3:24pm UTC](https://www.ruby-forum.com/t/rails3-displaying-the-full-stack-trace-for-test-errors/190595 "2010-06-23T15:24:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Isak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ac91a4/32.png) [@Isak](https://www.ruby-forum.com/u/Isak)\
**Post date:** [June 23, 2010, 3:24pm UTC](https://www.ruby-forum.com/t/rails3-displaying-the-full-stack-trace-for-test-errors/190595/1 "2010-06-23T15:24:06Z")

</div>

I’m porting an app from 2.3 to 3.0, have errors in my test suite, and  
don’t get enough info to figure out where these occur. See the example  
below; that’s all the feedback I get for an exception raised in a  
view.

Suggestions on how I revert to the 2.x behaviour?

* * *

1. Error:  
test\_should\_show\_pet(PetsControllerTest):  
ActionView::Template::Error: undefined method `name’ for nil:NilClass

Isak

---

<div class="post-metadata">

**Author:** ![Isak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ac91a4/32.png) [@Isak](https://www.ruby-forum.com/u/Isak)\
**Post date:** [July 6, 2010, 12:26pm UTC](https://www.ruby-forum.com/t/rails3-displaying-the-full-stack-trace-for-test-errors/190595/2 "2010-07-06T12:26:49Z")

</div>

One way to do this is to export the BACKTRACE environment variable in  
the shell executing your Rails 3.0 unit or functional tests: e.g.

```
BACKTRACE=blegga ruby test/unit/my_unit_test.rb

```

(setting the BACKTRACE environment variable suppresses the Rails  
backtrace filter – see also test\_help.rb in railties)

Peter
