Hello fellow testers,
I'm adding tests to an app that needs to redirect a lot of legacy URLs, and was surprised that routing specs do not natively allow testing redirection.
Since Rails `routes.rb` allows both routing _and_ redirecting, I presumed that routing specs would also handle both. I know controller and request specs handle redirection, but it feels weird to split tests like this, as it would lead to split my tests into request and routing specs though the path are very similar, and it's a functional unit.
I was able to test redirection by including `RSpec::Rails::RequestExampleGroup` in my routing specs but that feels weird too, and the syntax is a little different: `get '/path'` versus `get: '/path'`.
I'd feel more comfortable if I could natively write in the same file:
```
expect(get: '/blog/2018/01/slug').to route_to('posts#show')
expect(get: '/cms/2018/01/slug').to redirect_to('/blog/2018/01/slug')
```
Is there a cleaner workaround, or is it something which could be added to rspec-rails?
- Ruby version: 2.5.8
- Rails version: 6.1.3.1
- RSpec version: 3.10.1
- RSpec-Rails version:5.0.1