Commit 0e109c7e authored by Martin Wortschack's avatar Martin Wortschack

Merge branch '238232-mr-analytics-page-not-marked-as-active-in-the-navbar' into 'master'

MR Analytics Page not marked as active in the navbar

See merge request gitlab-org/gitlab!40596
parents b0102eb9 83387ca1
...@@ -47,7 +47,7 @@ module EE ...@@ -47,7 +47,7 @@ module EE
navbar_sub_item( navbar_sub_item(
title: _('Merge Request'), title: _('Merge Request'),
path: 'projects/analytics/merge_requests_analytics#show', path: 'projects/analytics/merge_request_analytics#show',
link: project_analytics_merge_request_analytics_path(project) link: project_analytics_merge_request_analytics_path(project)
) )
end end
...@@ -57,8 +57,8 @@ module EE ...@@ -57,8 +57,8 @@ module EE
return unless group_sidebar_link?(:merge_request_analytics) return unless group_sidebar_link?(:merge_request_analytics)
navbar_sub_item( navbar_sub_item(
title: _('Merge Requests'), title: _('Merge Request'),
path: 'groups/analytics/merge_requests_analytics#show', path: 'groups/analytics/merge_request_analytics#show',
link: group_analytics_merge_request_analytics_path(group) link: group_analytics_merge_request_analytics_path(group)
) )
end end
......
...@@ -52,5 +52,17 @@ RSpec.describe Groups::Analytics::MergeRequestAnalyticsController do ...@@ -52,5 +52,17 @@ RSpec.describe Groups::Analytics::MergeRequestAnalyticsController do
it { is_expected.to have_gitlab_http_status(:forbidden) } it { is_expected.to have_gitlab_http_status(:forbidden) }
end end
context 'when requesting HTML' do
render_views
before do
get :show, params: { group_id: group }, format: :html
end
it 'renders the side navigation with the correct submenu set as active' do
expect(response.body).to have_active_sub_navigation('Merge Request')
end
end
end end
end end
...@@ -53,5 +53,17 @@ RSpec.describe Projects::Analytics::MergeRequestAnalyticsController do ...@@ -53,5 +53,17 @@ RSpec.describe Projects::Analytics::MergeRequestAnalyticsController do
it { is_expected.to have_gitlab_http_status(:not_found) } it { is_expected.to have_gitlab_http_status(:not_found) }
end end
context 'when requesting HTML' do
render_views
before do
get :show, params: { namespace_id: group, project_id: project }, format: :html
end
it 'renders the side navigation with the correct submenu set as active' do
expect(response.body).to have_active_sub_navigation('Merge Request')
end
end
end end
end end
...@@ -44,7 +44,7 @@ RSpec.describe 'Group navbar' do ...@@ -44,7 +44,7 @@ RSpec.describe 'Group navbar' do
insert_after_sub_nav_item( insert_after_sub_nav_item(
_('Contribution'), _('Contribution'),
within: _('Analytics'), within: _('Analytics'),
new_sub_nav_item_name: _('Merge Requests') new_sub_nav_item_name: _('Merge Request')
) )
visit group_path(group) visit group_path(group)
......
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