Forum: Ruby on Rails Rspec not able to detect existing route

Posted by Sumit Srivastava (Guest)
on 2013-02-13 13:32
(Received via mailing list)
Hi,

I have added a route to my routes.rb as following,

get "/order/:player_id/:order", :to => 'share#order_renderer', :as =>
:order_feed

It works for me in the app but when I am running the spec file for, it
says, not route matches for this controller, action, parameters.

Regards,
Sumit
Posted by Colin Law (Guest)
on 2013-02-13 14:04
(Received via mailing list)
On 13 February 2013 12:31, Sumit Srivastava
<sumit.theinvincible@gmail.com> wrote:
> Hi,
>
> I have added a route to my routes.rb as following,
>
> get "/order/:player_id/:order", :to => 'share#order_renderer', :as =>
> :order_feed
>
> It works for me in the app but when I am running the spec file for, it says,
> not route matches for this controller, action, parameters.

Since for problems of this type the information required to solve it
is in the detail, please show the exact error (copy/paste it), the
line of code in your test that causes it and also the url you are
using that works (again, copy/paste from browser).

Colin
Posted by sumit srivastava (Guest)
on 2013-02-13 14:10
(Received via mailing list)
On 13 February 2013 18:32, Colin Law <clanlaw@googlemail.com> wrote:

> says,
> > not route matches for this controller, action, parameters.
>
> Since for problems of this type the information required to solve it
> is in the detail, please show the exact error (copy/paste it), the
> line of code in your test that causes it and also the url you are
> using that works (again, copy/paste from browser).
>

Resolved it. One of the parameters being passed was nil and hence it was
not able to determine the route.
Thanks for the help.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.