Skip to content

Fix routing for paths starting with help and projects

Thong Kuah requested to merge groups_routing_priority into master

What does this MR do?

Fix routing for group paths like below,

Failures:

  1) Groups routing group path starting with help also display group#show on the short path
     Failure/Error: expect(get("/#{group_path}")).to route_to('groups#show', id: group_path)
     
       The recognized options <{"controller"=>"help", "action"=>"index", "format"=>"abc123"}> did not match <{"id"=>"help.abc123", "controller"=>"groups", "action"=>"show"}>, difference:.
       --- expected
       +++ actual
       @@ -1 +1 @@
       -{"id"=>"help.abc123", "controller"=>"groups", "action"=>"show"}
       +{"controller"=>"help", "action"=>"index", "format"=>"abc123"}
     Shared Example Group: "groups routing" called from ./spec/routing/group_routing_spec.rb:68
     # ./spec/routing/group_routing_spec.rb:19:in `block (2 levels) in <main>'
     # ./spec/spec_helper.rb:310:in `block (3 levels) in <main>'
     # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
     # ./spec/spec_helper.rb:301:in `block (2 levels) in <main>'
     # ./spec/spec_helper.rb:297:in `block (3 levels) in <main>'
     # ./spec/spec_helper.rb:297:in `block (2 levels) in <main>'
     # -e:1:in `<main>'

  2) Groups routing group path starting with projects also display group#show on the short path
     Failure/Error: expect(get("/#{group_path}")).to route_to('groups#show', id: group_path)
     
       The recognized options <{"controller"=>"projects", "action"=>"index", "format"=>"abc123"}> did not match <{"id"=>"projects.abc123", "controller"=>"groups", "action"=>"show"}>, difference:.
       --- expected
       +++ actual
       @@ -1 +1 @@
       -{"id"=>"projects.abc123", "controller"=>"groups", "action"=>"show"}
       +{"controller"=>"projects", "action"=>"index", "format"=>"abc123"}
     Shared Example Group: "groups routing" called from ./spec/routing/group_routing_spec.rb:74
     # ./spec/routing/group_routing_spec.rb:19:in `block (2 levels) in <main>'
     # ./spec/spec_helper.rb:310:in `block (3 levels) in <main>'
     # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
     # ./spec/spec_helper.rb:301:in `block (2 levels) in <main>'
     # ./spec/spec_helper.rb:297:in `block (3 levels) in <main>'
     # ./spec/spec_helper.rb:297:in `block (2 levels) in <main>'
     # -e:1:in `<main>'

Related to: #219421 (closed)

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Thong Kuah

Merge request reports