# Problem in application.rb when running unit tests

**URL:** <https://www.ruby-forum.com/t/problem-in-application-rb-when-running-unit-tests/113617>\
**Category:** Rails\
**Created:** [September 2, 2007, 11:43pm UTC](https://www.ruby-forum.com/t/problem-in-application-rb-when-running-unit-tests/113617 "2007-09-02T23:43:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [September 2, 2007, 11:43pm UTC](https://www.ruby-forum.com/t/problem-in-application-rb-when-running-unit-tests/113617/1 "2007-09-02T23:43:57Z")

</div>

I keep getting an error in application.rb when I run my unit tests.  
It’s because I have a query in there that depends on a record in my  
database. I know how to setup fixtures in my unit tests but is there a  
way to have fixtures load before application.rb gets loaded? Or is  
there some better way to handle this? Thanks, Mike
