# Unit tests executed for every page load?

**URL:** <https://www.ruby-forum.com/t/unit-tests-executed-for-every-page-load/54716>\
**Category:** Rails\
**Created:** [March 13, 2006, 5:45pm UTC](https://www.ruby-forum.com/t/unit-tests-executed-for-every-page-load/54716 "2006-03-13T17:45:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gkogler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ba9def/32.png) [@gkogler](https://www.ruby-forum.com/u/gkogler)\
**Post date:** [March 13, 2006, 5:45pm UTC](https://www.ruby-forum.com/t/unit-tests-executed-for-every-page-load/54716/1 "2006-03-13T17:45:03Z")

</div>

After I installed the very sweet file\_column plugin I get strange output  
on my html pages. At the very end I always get something like this:

"Loaded suite dispatch.cgi Started Finished in 0.000218 seconds. 0  
tests, 0 assertions, 0 failures, 0 errors "

Seems like there is executed a non existent test suite for every page  
load. Can anybody help me find the lines that force this behaviour ?

Thanks

Gernot K.

---

<div class="post-metadata">

**Author:** ![gkogler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ba9def/32.png) [@gkogler](https://www.ruby-forum.com/u/gkogler)\
**Post date:** [March 13, 2006, 11:07pm UTC](https://www.ruby-forum.com/t/unit-tests-executed-for-every-page-load/54716/2 "2006-03-13T23:07:51Z")

</div>

You only have to require ‘test/unit’ for that to happen, not actually  
define  
any test suites. If you can’t figure out where/why it is being required,  
set  
Test::Unit.run = true and it won’t run automatically like you are  
seeing.

-Jonathan.

---

<div class="post-metadata">

**Author:** ![gkogler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ba9def/32.png) [@gkogler](https://www.ruby-forum.com/u/gkogler)\
**Post date:** [March 20, 2006, 7:48pm UTC](https://www.ruby-forum.com/t/unit-tests-executed-for-every-page-load/54716/3 "2006-03-20T19:48:22Z")

</div>

Thanks Jonathan!

To be more specific, I included this line in config/environment.rb  
(after the "Include your application configuration below comment):  
Test::Unit.run = true

- Nithin

---

<div class="post-metadata">

**Author:** ![gkogler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ba9def/32.png) [@gkogler](https://www.ruby-forum.com/u/gkogler)\
**Post date:** [April 10, 2006, 4:35pm UTC](https://www.ruby-forum.com/t/unit-tests-executed-for-every-page-load/54716/4 "2006-04-10T16:35:10Z")

</div>

I had the same issue.

If you modify the init.rb that came with the plugin (file\_column) to  
comment out the line "require ‘test\_case’, it fixes the problem.

The init.rb would then look like this:

# plugin init file for rails

# this file will be picked up by rails automatically and

# add the file\_column extensions to rails

require ‘file\_column’  
require ‘file\_compat’  
require ‘file\_column\_helper’  
require ‘validations’  
#require ‘test\_case’

ActiveRecord::Base.send(:include, FileColumn)  
ActionView::Base.send(:include, FileColumnHelper)  
ActiveRecord::Base.send(:include, FileColumn::Validations)

Mayank

Nithin R. wrote:

> Thanks Jonathan!
> 
> To be more specific, I included this line in config/environment.rb  
> (after the "Include your application configuration below comment):  
> Test::Unit.run = true
> 
> - Nithin
