rspec/rspec-rails

No route matches when I run controller rspec ?

namdv-1375 opened this issue · 1 comments

I'm having trouble running rspec.. I have folder

  • app
    • controllers
      • api
        • v1
          • timeline_posts_controller.rb
            ....

folder rpsec:

  • spec
    • controller
      • api
        • v1
          • timeline_posts_controller_spec.rb

rails routes:

image

but a run call when run rspec raise error

get :show, params: { use_route: 'api/v1/timeline_posts/', id: 1 }
ActionController::UrlGenerationError: No route matches {:action=>"show", :controller=>"api/v1/timeline_posts", :id=>1}
from /usr/local/bundle/gems/actionpack-7.1.3.3/lib/action_dispatch/journey/formatter.rb:44:in `path'
...
and other basic ways:
get :show, id: id
get :show, params: {id: id}
-> No route matches

Please help me, thanks

pirj commented

There is insufficient information to reproduce or help.

We reserve our GitHub issue tracker for feature requests and bugs.
For help, please use https://rspec.info/help or SO. Thanks for understanding.