# Sporadic NonInferrableControllerError on nested controller tests with Rails 2.1

**URL:** <https://www.ruby-forum.com/t/sporadic-noninferrablecontrollererror-on-nested-controller-tests-with-rails-2-1/146955>\
**Category:** Rails\
**Created:** [August 27, 2008, 2:05am UTC](https://www.ruby-forum.com/t/sporadic-noninferrablecontrollererror-on-nested-controller-tests-with-rails-2-1/146955 "2008-08-27T02:05:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yuval](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/977dab/32.png) [@Yuval](https://www.ruby-forum.com/u/Yuval)\
**Post date:** [August 27, 2008, 2:05am UTC](https://www.ruby-forum.com/t/sporadic-noninferrablecontrollererror-on-nested-controller-tests-with-rails-2-1/146955/1 "2008-08-27T02:05:35Z")

</div>

Hey folks. I’ve been getting this aggravating error sporadically on  
some of my nested controller tests since upgrading to Rails 2.1. The  
last bout seems to be here to stay and it’s driving me mad.

I have the following in my controllers dir (names changed for  
simplicity):

tools\_controller.rb  
tools folder  
tools/screwdriers\_controller.rb  
tools/wrenches\_controller.rb  
tools/hammers\_controller.rb

When I run rake, I am getting NonInferrableControllerError errors on  
two out of the three nested controllers and for the life of me, I have  
no idea why. If I run the test files individually, I get no errors.

Insight appreciated.

---

<div class="post-metadata">

**Author:** ![Yuval](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/977dab/32.png) [@Yuval](https://www.ruby-forum.com/u/Yuval)\
**Post date:** [August 27, 2008, 4:39pm UTC](https://www.ruby-forum.com/t/sporadic-noninferrablecontrollererror-on-nested-controller-tests-with-rails-2-1/146955/2 "2008-08-27T16:39:36Z")

</div>

Here’s the trace I get from rake.

`ActionController::NonInferrableControllerError: Unable to
determine the controller to test from WrenchesControllerTest. You'll
need to specify it using 'tests YourController' in your test case
definition. This could mean that WrenchesControllerTest does not exist
or it contains syntax errors
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/test_case.rb:64:in
`determine_default_controller_class'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/test_case.rb:57:in `controller_class'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/test_case.rb:73:in
`setup_controller_request_and_response'
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/
active_support/callbacks.rb:173:in `send'
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/
active_support/callbacks.rb:173:in `evaluate_method'
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/
active_support/callbacks.rb:161:in `call'
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/
active_support/callbacks.rb:90:in `run'
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/
active_support/callbacks.rb:90:in `each'
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/
active_support/callbacks.rb:90:in `send'
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/
active_support/callbacks.rb:90:in `run'
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/
active_support/callbacks.rb:272:in `run_callbacks'
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/
active_support/testing/setup_and_teardown.rb:31:in `run'`  
Again, if I run the rb file on its own via ruby/test/functional/  
whateer\_test.rb it runs just fine. The namespacing is correct, yes.

One of the files that’s failing has a full suite of tests, while the  
other file is still in the default state with only a test\_truth test.  
The third file that’s not failing is also in a default state.

Anyone?

---

<div class="post-metadata">

**Author:** ![Yuval](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/977dab/32.png) [@Yuval](https://www.ruby-forum.com/u/Yuval)\
**Post date:** [August 27, 2008, 5:36pm UTC](https://www.ruby-forum.com/t/sporadic-noninferrablecontrollererror-on-nested-controller-tests-with-rails-2-1/146955/3 "2008-08-27T17:36:29Z")

</div>

Resolved. It was an SVN/TextMate issue with residual test files  
sticking around and conflicting namespaces.
