# RSpec, nested routes and :path\_prefix

**URL:** <https://www.ruby-forum.com/t/rspec-nested-routes-and-path-prefix/118952>\
**Category:** Rails\
**Created:** [November 1, 2007, 5:38pm UTC](https://www.ruby-forum.com/t/rspec-nested-routes-and-path-prefix/118952 "2007-11-01T17:38:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![harm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@harm](https://www.ruby-forum.com/u/harm)\
**Post date:** [November 1, 2007, 5:38pm UTC](https://www.ruby-forum.com/t/rspec-nested-routes-and-path-prefix/118952/1 "2007-11-01T17:38:48Z")

</div>

Dear list,

In the app we are making we have a rout something like this:  
map.resources :projects do |projects|  
projects.resources :pages, :controller =\>  
“Wiki::Pages”, :path\_prefix =\> “/projects/:project\_id/  
wiki”, :name\_prefix =\> “project\_wiki\_”  
end

But I can’t get RSpec(I’m very new to it) to accept this. It keeps  
throwing errors:  
ActionController::RoutingError in ‘Wiki::PagesController GET ‘create’  
should be successful’  
No route matches {:action=\>“create”, :controller=\>“wiki/  
pages”, :project\_id=\>1}

I get why it throws these errors but not how to fix it. The relavant  
RSpec:  
it “GET ‘create’ should be successful” do  
get ‘create’, :project\_id =\> 1  
response.should be\_success  
end

How do I modify the get request properly?  
Thanks in advance!
