[rspec-users] getting ActionController::RoutingError when I test namespaced controllers

Justin Ko jko170 at gmail.com
Thu Feb 2 01:55:06 EST 2012

On Feb 1, 2012, at 6:26 PM, Lille wrote:

> Hey folks,
> Using 2.6, I have functional tests arranged in my spec/controllers
> directory according to their namespace in my Rails 3 app/controllers
> directory, e.g.,
> api/some_controller_spec.rb
>   describe Api::SomeController, ...
> Well, when I run rspec at the directory level, e.g., rspec spec/
> controllers/api the test behavior is normal. When I try to run all
> tests from the spec/controllers root, however, I get tons of failures
> due to ActionController::RoutingError.
> What is the fix?
> Thanks,
> Lille
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

We're going to need more info than this.

1.)  What is the exact error (paste the backtrace)?
2.) What are the exact commands you are running, and from what directory?

Here are some things you can try before you reply again:

1.) Does this controller action work in development mode?
2.) Does the test log show that the correct action/controller is being hit? What is it responding with?

That should be a good start.

More information about the rspec-users mailing list