Commit 7ac6496f authored by Douwe Maan's avatar Douwe Maan

Skip deprecated redirects in PathRegex spec

parent 6a82632b
...@@ -119,7 +119,6 @@ module Gitlab ...@@ -119,7 +119,6 @@ module Gitlab
analytics analytics
audit_events audit_events
avatar avatar
boards
edit edit
group_members group_members
hooks hooks
......
...@@ -72,7 +72,14 @@ describe Gitlab::PathRegex do ...@@ -72,7 +72,14 @@ describe Gitlab::PathRegex do
route_set = Rails.application.routes route_set = Rails.application.routes
routes_collection = route_set.routes routes_collection = route_set.routes
routes_array = routes_collection.routes routes_array = routes_collection.routes
routes_array.map { |route| route.path.spec.to_s } non_deprecated_redirect_routes = routes_array.reject do |route|
app = route.app
# `app.app` is either another app, or `self`. We want to find the final app.
app = app.app while app.try(:app) && app.app != app
app.is_a?(ActionDispatch::Routing::PathRedirect) && app.block.include?('/-/')
end
non_deprecated_redirect_routes.map { |route| route.path.spec.to_s }
end end
let(:routes_without_format) { all_routes.map { |path| without_format(path) } } let(:routes_without_format) { all_routes.map { |path| without_format(path) } }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment