summaryrefslogtreecommitdiff
path: root/spec/presenters
diff options
context:
space:
mode:
authorIllya Klymov <xanf@xanf.me>2019-04-19 13:02:35 +0000
committerStan Hu <stanhu@gmail.com>2019-04-19 13:02:35 +0000
commit6ea92ef1a01929e8a311e2eb56d2b298bc4db1a8 (patch)
treefacec66dc894043840f595f9881d7251a303e1db /spec/presenters
parent48b025d188420b46bfd0df79f5c1f1bdde65c138 (diff)
downloadgitlab-ce-6ea92ef1a01929e8a311e2eb56d2b298bc4db1a8.tar.gz
Improvements to Project overview UI
Diffstat (limited to 'spec/presenters')
-rw-r--r--spec/presenters/project_presenter_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/presenters/project_presenter_spec.rb b/spec/presenters/project_presenter_spec.rb
index 456de5f1b9a..5bf80f6e318 100644
--- a/spec/presenters/project_presenter_spec.rb
+++ b/spec/presenters/project_presenter_spec.rb
@@ -411,4 +411,23 @@ describe ProjectPresenter do
end
end
end
+
+ describe '#statistics_buttons' do
+ let(:project) { build(:project) }
+ let(:presenter) { described_class.new(project, current_user: user) }
+
+ it 'orders the items correctly' do
+ allow(project.repository).to receive(:readme).and_return(double(name: 'readme'))
+ allow(project.repository).to receive(:changelog).and_return(nil)
+ allow(project.repository).to receive(:contribution_guide).and_return(double(name: 'foo'))
+ allow(presenter).to receive(:filename_path).and_return('fake/path')
+ allow(presenter).to receive(:contribution_guide_path).and_return('fake_path')
+
+ buttons = presenter.statistics_buttons(show_auto_devops_callout: false)
+ expect(buttons.map(&:label)).to start_with(
+ a_string_including('README'),
+ a_string_including('CONTRIBUTING')
+ )
+ end
+ end
end