Where to test routes in ruby on rails

前端 未结 5 1866
耶瑟儿~
耶瑟儿~ 2021-02-19 00:25

Where to test routes in ruby on rails?

  • unit tests?
  • functional tests?
  • integration tests?

Addition:

To be e

5条回答
  •  攒了一身酷
    2021-02-19 00:42

    Why do you feel the need to test the routes? Purely to make sure that the routes defined in your routes.rb actually work? If so, then don't. That's not the job of your application's tests to make sure that the framework's internals operate properly - that's the job of the Rails framework's own tests.

    If perhaps you have some sort of dynamic/user definable route that you want to test, I'd probably go with integration.

提交回复
热议问题