Commit 9408b6b4 authored by Miguel Rincon's avatar Miguel Rincon

Sidebar tests include can_collaborate_with_project

As we have a new reference to can_collaborate_with_project, the tests
for the sidebar should include a check for this.

Addtionally, a new test to check the editor link has been added.
parent c9af0026
......@@ -784,6 +784,11 @@ module ProjectsHelper
def project_access_token_available?(project)
can?(current_user, :admin_resource_access_tokens, project)
end
def can_view_pipeline_editor?(project)
can_collaborate_with_project?(project) &&
::Gitlab::Ci::Features.ci_pipeline_editor_page_enabled?(project)
end
end
ProjectsHelper.prepend_if_ee('EE::ProjectsHelper')
......@@ -9,6 +9,7 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
assign(:project, project)
assign(:repository, project.repository)
allow(view).to receive(:current_ref).and_return('master')
allow(view).to receive(:can_collaborate_with_project?).and_return(true)
end
describe 'issue boards' do
......
......@@ -11,6 +11,7 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
allow(view).to receive(:current_ref).and_return('master')
allow(view).to receive(:can?).and_return(true)
allow(view).to receive(:can_collaborate_with_project?).and_return(true)
end
it_behaves_like 'has nav sidebar'
......
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