Commit 55d32106 authored by Matija Čupić's avatar Matija Čupić

Refactor presenter specs

parent 1f2fc99a
......@@ -429,15 +429,21 @@ describe ProjectPresenter do
a_string_including('CONTRIBUTING')
)
end
end
context 'empty repo' do
describe '#empty_repo_statistics_buttons' do
let(:project) { create(:project, :repository) }
let(:presenter) { described_class.new(project, current_user: user) }
it 'orders the items correctly in an empty project' do
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)
buttons = presenter.empty_repo_statistics_buttons
expect(buttons.map(&:label)).to start_with(
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'),
......@@ -446,5 +452,4 @@ describe ProjectPresenter do
)
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