Commit d31775d9 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Merge branch...

Merge branch '12370-controller-test-for-making-side-nav-expanded-when-viewing-dependencies' into 'master'

Add sidenav test to dependencies controller

Closes #12370

See merge request gitlab-org/gitlab!20271
parents 3c768ddb 2beea778
...@@ -16,6 +16,8 @@ describe Projects::DependenciesController do ...@@ -16,6 +16,8 @@ describe Projects::DependenciesController do
end end
context 'when feature is available' do context 'when feature is available' do
render_views
before do before do
stub_licensed_features(dependency_list: true) stub_licensed_features(dependency_list: true)
end end
...@@ -26,6 +28,12 @@ describe Projects::DependenciesController do ...@@ -26,6 +28,12 @@ describe Projects::DependenciesController do
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to render_template(:show) expect(response).to render_template(:show)
end end
it 'renders the side navigation with the correct submenu set as active' do
subject
expect(response.body).to have_active_sub_navigation('Dependency List')
end
end end
context 'when feature is not available' do context 'when feature is not available' do
......
...@@ -9,6 +9,6 @@ end ...@@ -9,6 +9,6 @@ end
RSpec::Matchers.define :have_active_sub_navigation do |expected| RSpec::Matchers.define :have_active_sub_navigation do |expected|
match do |page| match do |page|
expect(page.find('.sidebar-sub-level-items > li.active:not(.fly-out-top-item)')).to have_content(expected) expect(page).to have_css('.sidebar-sub-level-items > li.active:not(.fly-out-top-item)', text: expected)
end end
end end
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