rspec / rspec-rails

RSpec for Rails 6+
https://rspec.info
MIT License
5.18k stars 1.04k forks source link

No route matches when I run controller rspec ? #2776

Closed namdv-1375 closed 4 months ago

namdv-1375 commented 4 months ago

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

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 4 months ago

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.