Feature request - generate routes specs from current routes

6 views
Skip to first unread message

Jakub Godawa

unread,
Apr 15, 2019, 4:07:47 AM4/15/19
to rspec
Hi Rspecians,

while working on a legacy rails app, I rewrote the custom routes to conventional ones using resources and so on.
Unfortunately, one route was not rewritten properly and issues surfaced later.

I wonder if this could be of rspec-rails gem interest, to include something like

rails generate rspec:exisiting_routes

to have something to work against when refactoring the routes config file.
This ideally would be covered beforehand, either in request specs or in routes specs. But such a feature could help in more legacy projects.

Let me know if this would suitable for rspec-rails and I can build it.

I found one gem that tried to do such a job but it didn't get much recognition:

and also it doesn't play with rails 5 or 6

Thanks for the feedback,
Jakub

Jon Rowe

unread,
Apr 16, 2019, 7:19:42 AM4/16/19
to rs...@googlegroups.com
Hi Jakub

I would suggest that if you'd like to work on something to do this that it should be an extension gem initially, as I’m not sure how much extra maintenance burden this would add, as to add it to rspec-rails it’d have to support all the versions we support but I'm sure myself and Sam would be happy to provide support and feedback on any gem you created!

Cheers
Jon

--
You received this message because you are subscribed to the Google Groups "rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rspec+un...@googlegroups.com.
To post to this group, send email to rs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/ed9eb6ad-9156-41b3-955d-e07e2c89a7c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages