title: test rails controllers that are not in spec/controllers with rspec 2
body: <p>rspec expects your controller specs to be in /spec/controllers.  I have some modules that are included in my controllers.  The only way to test them, near as I can tell, is to create a dummy controller, include the module in it, and test from there.  The problem is that the module specs are in /spec/lib/module, and so ControllerExampleGroup is not included, which means I can't call the helper methods get "action" etc.</p>
  
  <p>I can manually import these, which gets me most of the way there, but I then get this error:</p>
  
  <pre><code> Failure/Error: Unable to find matching
   line from backtrace undefined method
   `path_set' for nil:NilClass
    activesupport-3.0.3/lib/active_support/whiny_nil.rb:48:in
   `method_missing'
    rspec-rails-2.2.1/lib/rspec/rails/view_rendering.rb:68
    rspec-core-2.2.1/lib/rspec/core/example_group.rb:291:in
   `instance_eval'
    rspec-core-2.2.1/lib/rspec/core/example_group.rb:291:in
   `instance_eval_with_rescue'
    rspec-core-2.2.1/lib/rspec/core/hooks.rb:39:in
   `run_in'
    rspec-core-2.2.1/lib/rspec/core/hooks.rb:70:in
   `run_all'
    rspec-core-2.2.1/lib/rspec/core/hooks.rb:70:in
   `each'
    rspec-core-2.2.1/lib/rspec/core/hooks.rb:70:in
   `run_all'
    rspec-core-2.2.1/lib/rspec/core/hooks.rb:106:in
   `run_hook'
    rspec-core-2.2.1/lib/rspec/core/example_group.rb:194:in
   `eval_after_eachs'
    rspec-core-2.2.1/lib/rspec/core/example_group.rb:194:in
   `each'
    rspec-core-2.2.1/lib/rspec/core/example_group.rb:194:in
   `eval_after_eachs'
    rspec-core-2.2.1/lib/rspec/core/example.rb:130:in `run_after_each'
    rspec-core-2.2.1/lib/rspec/core/example.rb:44:in `run'
    rspec-core-2.2.1/lib/rspec/core/example.rb:88:in `with_around_hooks'
    rspec-core-2.2.1/lib/rspec/core/example.rb:37:in `run'
    rspec-core-2.2.1/lib/rspec/core/example.rb:81:in `with_pending_capture'
    rspec-core-2.2.1/lib/rspec/core/example.rb:80:in `catch'
    rspec-core-2.2.1/lib/rspec/core/example.rb:80:in `with_pending_capture'
    rspec-core-2.2.1/lib/rspec/core/example.rb:36:in `run'
    rspec-core-2.2.1/lib/rspec/core/example_group.rb:261:in
   `run_examples'
    rspec-core-2.2.1/lib/rspec/core/example_group.rb:257:in
   `map'
    rspec-core-2.2.1/lib/rspec/core/example_group.rb:257:in
   `run_examples'
    rspec-core-2.2.1/lib/rspec/core/example_group.rb:231:in
   `run'
    rspec-core-2.2.1/lib/rspec/core/example_group.rb:232:in
   `run'
    rspec-core-2.2.1/lib/rspec/core/example_group.rb:232:in
   `map'
    rspec-core-2.2.1/lib/rspec/core/example_group.rb:232:in
   `run'
    rspec-core-2.2.1/lib/rspec/core/command_line.rb:27:in
   `run'
    rspec-core-2.2.1/lib/rspec/core/command_line.rb:27:in
   `map'
    rspec-core-2.2.1/lib/rspec/core/command_line.rb:27:in
   `run'
    rspec-core-2.2.1/lib/rspec/core/reporter.rb:12:in `report'
    rspec-core-2.2.1/lib/rspec/core/command_line.rb:24:in
   `run'
    rspec-core-2.2.1/lib/rspec/core/runner.rb:55:in
   `run_in_process'
    rspec-core-2.2.1/lib/rspec/core/runner.rb:46:in
   `run'
    rspec-core-2.2.1/lib/rspec/core/runner.rb:10:in
   `autorun'
    /Users/jeffdeville/.rvm/gems/ree-1.8.7-2010.02/bin/rspec:19
  </code></pre>
  
  <p>Suggestions?</p>