[rspec-users] namespaced controllers
philodespotos at gmail.com
Sun Nov 25 11:48:38 EST 2007
On Nov 25, 2007 9:23 AM, Kyle Hargraves <philodespotos at gmail.com> wrote:
> On Nov 23, 2007 11:53 PM, Scott Taylor <mailing_lists at railsnewbie.com> wrote:
> > I got an "unknown action foo" error message (wasn't getting it before
> > today - running on trunk).
> > Scott
> Can you reproduce it reliably?
> I had an Admin::SomeController controller, and the specs were passing
> fine. I went to add ::SomeController, and the new specs for it passed,
> but Admin::SomeController started raising UnknownAction (for all the
> actions that weren't defined in the non-admin controller).
> But once I restarted autotest, they're passing cleanly, and now I
> can't seem to reproduce it at all.
Figured out how to reproduce it. It depends on load order, I guess.
Given the files:
The specs do nothing but hit the FooController#show and
Admin::FooController#index actions and expect the right render.
If I touch admin/foo_controller_spec.rb, the specs pass.
If I touch foo_controller_spec.rb, the specs for Admin::FooController
fail with UnknownAction exceptions, since ::FooController has no index
Problem occurs with autotest and rake spec, but not with ./script/spec spec.
This is happening with the current latest trunk versions, rails r8200
and rspec r2980.
More information about the rspec-users