[rspec-users] spec'ing namespaced routes

David Chelimsky dchelimsky at gmail.com
Mon Jul 5 08:02:50 EDT 2010


On Jul 4, 2010, at 7:15 PM, Frank Mattia wrote:

> What's the appropriate way to test namespaced routes with rspec-2 &
> rails 3?
> 
> I imagined that the following would work but it does not.
> 
> describe Admin::UsersController do
>  describe "routing" do
>    it "recognizes and generates #index" do
>      { :get => "/admin/users" }.should route_to(:controller =>
> "admin_users", :action => "index")
>    end
>  end
> end
> 
> In fact,
> 
> { :get => "/admin/users" }.should be_routable
> 
> fails as well. Yet rake routes disagrees.
> 
> Any suggestions?

This is a deficiency in the API recognized and discussed in http://groups.google.com/group/rspec/browse_thread/thread/50b46ca3e4bd3a78 (which came after your post). Please feel free to follow and/or contribute to that conversation.

Cheers,
David


More information about the rspec-users mailing list