# Testing path problems

**URL:** <https://www.ruby-forum.com/t/testing-path-problems/106143>\
**Category:** Engines Development\
**Created:** [June 6, 2007, 9:04pm UTC](https://www.ruby-forum.com/t/testing-path-problems/106143 "2007-06-06T21:04:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ben\_wiseley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/45deac/32.png) [@ben\_wiseley](https://www.ruby-forum.com/u/ben_wiseley)\
**Post date:** [June 6, 2007, 9:04pm UTC](https://www.ruby-forum.com/t/testing-path-problems/106143/1 "2007-06-06T21:04:33Z")

</div>

## I was converting an existing rails app to an engine… that worked fine

just put everything in an engine (controllers, models, etc.). All tests  
passed if they were in the engine but, for functional tests, outside of  
the  
engine, the paths to the engine don’t seem to be being found.

If I put this in my environment things work again:  
%W( app/controllers app/helpers app/models app/views lib ).each do |p|  
config.load\_paths += %W( #{RAILS\_ROOT}/vendor/plugins/nzwe/#{p} )  
end

Any idea what I’m missing here? Seems like having that in your  
environment  
isn’t a great idea because it seems like the engine plugin does that for  
you, except, apparently, when running functional test.

The exact error is:  
/opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active\_support/dependencies.rb:266:in  
`load\_missing\_constant’: uninitialized constant ApplicationController  
(NameError)

Which I think means it’s failing to load some require/includes in  
application.rb

I’m using Engines::Testing.set\_fixture\_path in the test\_helper.rb if  
that  
matters.

-ben

---

<div class="post-metadata">

**Author:** ![ben\_wiseley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/45deac/32.png) [@ben\_wiseley](https://www.ruby-forum.com/u/ben_wiseley)\
**Post date:** [June 6, 2007, 11:16pm UTC](https://www.ruby-forum.com/t/testing-path-problems/106143/2 "2007-06-06T23:16:51Z")

</div>

On 6/6/07, ben wiseley [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> The exact error is:  
> /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active\_support/dependencies.rb:266:in  
> `load\_missing\_constant’: uninitialized constant ApplicationController  
> (NameError)

It sounds like you’re trying to load one of your controllers before  
Rails is ready.

Are you doing anything with your controllers in your init.rb files?
