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

David Chelimsky dchelimsky at gmail.com
Thu Feb 2 08:50:46 EST 2012

On Feb 2, 2012, at 6:22 AM, Lille wrote:

> OK,
> Given spec/controllers and given this is typical of the structure in
> my functional testing subdirectories...
>>> api/some_controller_spec.rb
>>>   describe Api::SomeController, ...
> ...when I attempt to test everything in the subdirectories from the
> root using this command -- rspec spec/controllers, I get the following
> error for every test in the subdirectories:
>     ActionController::RoutingError:
>       No route matches {:controller=>..., :action=>...}
> Meanwhile, running rspec at each subdirectory yields expected results
> and the controllers function in development.
> So, it feels like an rspec configuration thing that I need to adjust
> to account for the subdirectories, but what?


This is no more clear than your original post. Justin asked you for the error and you didn't post it. He asked for the commands and the directories you were running them from and you described them again instead of just pasting them into the email. When you say "running rspec at each subdirectory", I don't know if you mean:

  rspec spec/controllers/sub1

or if you mean

  cd spec/constrollers/sub1

So please copy the precise commands as they appear in your terminal window along with the backtrace you're getting when they fail. Otherwise we're just guessing here, and it's a waste of everybody's time.


More information about the rspec-users mailing list