Fix RoutePareser#routes and add spec for it

This commit is contained in:
Graceful Potato
2020-05-24 21:03:40 +03:00
parent 7ceedab4cb
commit 3b85f09acf
2 changed files with 51 additions and 1 deletions

View File

@@ -11,7 +11,7 @@ module Rswag
def routes
::Rails.application.routes.routes.select do |route|
route.defaults[:controller] == controller
end.each_with_object({}) do |tree, route|
end.each_with_object({}) do |route, tree|
path = path_from(route)
verb = verb_from(route)
tree[path] ||= { params: params_from(route), actions: {} }