# RSpec, RESTful nested routes and :path\_prefix

**URL:** <https://www.ruby-forum.com/t/rspec-restful-nested-routes-and-path-prefix/119520>\
**Category:** RSpec\
**Created:** [November 7, 2007, 5:58pm UTC](https://www.ruby-forum.com/t/rspec-restful-nested-routes-and-path-prefix/119520 "2007-11-07T17:58:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harm\_Aarts](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a5b964/32.png) [@Harm\_Aarts](https://www.ruby-forum.com/u/Harm_Aarts)\
**Post date:** [November 7, 2007, 5:58pm UTC](https://www.ruby-forum.com/t/rspec-restful-nested-routes-and-path-prefix/119520/1 "2007-11-07T17:58:09Z")

</div>

I think I did not express myself clear enough. The problem is that in  
my spec I can not get the ‘post’ and ‘get’ methods to correctly  
contact(by lack of a better word) the corresponding actions. I  
believe this has to do with the fact that I use a :path\_prefix.  
So I would like this:

> it “GET ‘index’ should be successful” do  
> get ‘index’, :project\_id =\> 1  
> response.should be\_success  
> end

To become something like:

> it “GET ‘index’ should be successful” do  
> get ‘index’, :project\_id =\> , :path\_prefix =\> ‘/wiki’  
> response.should be\_success  
> end  
> But that obviously does not work.  
> More importantly I do not believe I should be repeating myself with  
> these path\_prefixes. I suspect that RSpec is ignoring  
> the :path\_prefix in my routes.rb file.

With kind regards,

Harm
