diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-21 12:09:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-21 12:09:01 +0300 |
commit | a53d2c37c4934f564caa94543dd4cf5af1703e2d (patch) | |
tree | a028dc39771a4612a9845ab700a73af2d6f3f51b /spec/features | |
parent | 18b8435318887d3fc6e9f9d305967a953cdd7d3f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/projects/navbar_spec.rb | 203 |
1 files changed, 112 insertions, 91 deletions
diff --git a/spec/features/projects/navbar_spec.rb b/spec/features/projects/navbar_spec.rb index bcb05e1c718..4ab6b0ce506 100644 --- a/spec/features/projects/navbar_spec.rb +++ b/spec/features/projects/navbar_spec.rb @@ -3,102 +3,123 @@ require 'spec_helper' describe 'Project navbar' do - it_behaves_like 'verified navigation bar' do - let(:user) { create(:user) } - let(:project) { create(:project, :repository) } + let(:user) { create(:user) } + let(:project) { create(:project, :repository) } - let(:structure) do - [ - { - nav_item: _('Project overview'), - nav_sub_items: [ - _('Details'), - _('Activity'), - _('Releases') - ] - }, - { - nav_item: _('Repository'), - nav_sub_items: [ - _('Files'), - _('Commits'), - _('Branches'), - _('Tags'), - _('Contributors'), - _('Graph'), - _('Compare'), - (_('Locked Files') if Gitlab.ee?) - ] - }, - { - nav_item: _('Issues'), - nav_sub_items: [ - _('List'), - _('Boards'), - _('Labels'), - _('Milestones') - ] - }, - { - nav_item: _('Merge Requests'), - nav_sub_items: [] - }, - { - nav_item: _('CI / CD'), - nav_sub_items: [ - _('Pipelines'), - _('Jobs'), - _('Artifacts'), - _('Schedules') - ] - }, - { - nav_item: _('Operations'), - nav_sub_items: [ - _('Metrics'), - _('Environments'), - _('Error Tracking'), - _('Serverless'), - _('Kubernetes') - ] - }, - { - nav_item: _('Analytics'), - nav_sub_items: [ - _('CI / CD Analytics'), - (_('Code Review') if Gitlab.ee?), - _('Repository Analytics'), - _('Value Stream Analytics') - ] - }, - { - nav_item: _('Wiki'), - nav_sub_items: [] - }, - { - nav_item: _('Snippets'), - nav_sub_items: [] - }, - { - nav_item: _('Settings'), - nav_sub_items: [ - _('General'), - _('Members'), - _('Integrations'), - _('Repository'), - _('CI / CD'), - _('Operations'), - (_('Audit Events') if Gitlab.ee?) - ].compact - } + let(:analytics_nav_item) do + { + nav_item: _('Analytics'), + nav_sub_items: [ + _('CI / CD Analytics'), + (_('Code Review') if Gitlab.ee?), + _('Repository Analytics'), + _('Value Stream Analytics') ] - end + } + end - before do - project.add_maintainer(user) - sign_in(user) + let(:structure) do + [ + { + nav_item: _('Project overview'), + nav_sub_items: [ + _('Details'), + _('Activity'), + _('Releases') + ] + }, + { + nav_item: _('Repository'), + nav_sub_items: [ + _('Files'), + _('Commits'), + _('Branches'), + _('Tags'), + _('Contributors'), + _('Graph'), + _('Compare'), + (_('Locked Files') if Gitlab.ee?) + ] + }, + { + nav_item: _('Issues'), + nav_sub_items: [ + _('List'), + _('Boards'), + _('Labels'), + _('Milestones') + ] + }, + { + nav_item: _('Merge Requests'), + nav_sub_items: [] + }, + { + nav_item: _('CI / CD'), + nav_sub_items: [ + _('Pipelines'), + _('Jobs'), + _('Artifacts'), + _('Schedules') + ] + }, + { + nav_item: _('Operations'), + nav_sub_items: [ + _('Metrics'), + _('Environments'), + _('Error Tracking'), + _('Serverless'), + _('Kubernetes') + ] + }, + analytics_nav_item, + { + nav_item: _('Wiki'), + nav_sub_items: [] + }, + { + nav_item: _('Snippets'), + nav_sub_items: [] + }, + { + nav_item: _('Settings'), + nav_sub_items: [ + _('General'), + _('Members'), + _('Integrations'), + _('Repository'), + _('CI / CD'), + _('Operations'), + (_('Audit Events') if Gitlab.ee?) + ].compact + } + ] + end + + before do + project.add_maintainer(user) + sign_in(user) + end + it_behaves_like 'verified navigation bar' do + before do visit project_path(project) end end + + if Gitlab.ee? + context 'when issues analytics is available' do + before do + stub_licensed_features(issues_analytics: true) + + analytics_nav_item[:nav_sub_items] << _('Issues Analytics') + analytics_nav_item[:nav_sub_items].sort! + + visit project_path(project) + end + + it_behaves_like 'verified navigation bar' + end + end end |