Commit fc6ff243 authored by Miguel Rincon's avatar Miguel Rincon

Move can_view_pipeline_editor to dedicated helper

In order to avoid increasing complexity in the projects_helper,
this change moves can_view_pipeline_editor to its own module.
parent 1dff19b3
......@@ -784,11 +784,6 @@ 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,7 +9,6 @@ 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,7 +11,6 @@ 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