Commit 0f712619 authored by Ash McKenzie's avatar Ash McKenzie

Merge branch 'mc/feature/show-setup-cicd-empty-repo' into 'master'

Show `Setup CI/CD` when repository is empty

Closes #26960

See merge request gitlab-org/gitlab!17274
parents 8f0f4454 55d32106
......@@ -51,7 +51,8 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
new_file_anchor_data,
readme_anchor_data,
changelog_anchor_data,
contribution_guide_anchor_data
contribution_guide_anchor_data,
gitlab_ci_anchor_data
].compact.reject { |item| item.is_link }
end
......
---
title: Show the "Set up CI/CD" prompt in empty repositories when applicable.
merge_request: 17274
author: Ben McCormick
type: changed
......@@ -430,4 +430,26 @@ describe ProjectPresenter do
)
end
end
describe '#empty_repo_statistics_buttons' do
let(:project) { create(:project, :repository) }
let(:presenter) { described_class.new(project, current_user: user) }
subject(:empty_repo_statistics_buttons) { presenter.empty_repo_statistics_buttons }
before do
project.add_developer(user)
allow(project).to receive(:auto_devops_enabled?).and_return(false)
end
it 'orders the items correctly in an empty project' do
expect(empty_repo_statistics_buttons.map(&:label)).to start_with(
a_string_including('New'),
a_string_including('README'),
a_string_including('CHANGELOG'),
a_string_including('CONTRIBUTING'),
a_string_including('CI/CD')
)
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