Minitest and Routing
The primary method that Rails/Minitest uses for route testing is assert_routing. Here are the Minitest versions of the same standard routes:
minitest/01/gatherer/test/controllers/projects_controller_test.rb | |
â | test â"routing"â âdoâ |
â | assert_routing â"/projects"â, controller: â"projects"â, action: â"index"â |
â | assert_routing({path: â"/projects"â, method: â"post"â}, |
â | controller: â"projects"â, action: â"create"â) |
â | assert_routing â"/projects/new"â, controller: â"projects"â, action: â"new"â |
â | assert_routing â"/projects/1"â, controller: â"projects"â, |
â | action: â"show"â, id: â"1"â |
â | assert_routing â"/projects/1/edit"â, controller: â"projects" ... |
Get Rails 4 Test Prescriptions now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.