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

Refactor presenter specs

parent 1f2fc99a
......@@ -429,22 +429,27 @@ describe ProjectPresenter do
a_string_including('CONTRIBUTING')
)
end
end
context 'empty repo' do
let(:project) { create(:project, :repository) }
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
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(
a_string_including('New'),
a_string_including('README'),
a_string_including('CHANGELOG'),
a_string_including('CONTRIBUTING'),
a_string_including('CI/CD')
)
end
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
\ No newline at end of file
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