summaryrefslogtreecommitdiff
path: root/spec/views
diff options
context:
space:
mode:
authorElias Werberich <elias@werberich.de>2019-03-31 16:09:51 +0200
committerElias Werberich <elias@werberich.de>2019-03-31 16:09:51 +0200
commitde6bab915cc080ecbbce5eb827017d46e1f95e1d (patch)
tree16ba654cffed824c33ac19ebb5c568a01ff94797 /spec/views
parentafbc827465e6fc0e4eec1308e34637bcd317eb52 (diff)
downloadgitlab-ce-de6bab915cc080ecbbce5eb827017d46e1f95e1d.tar.gz
Disable inaccessible navigation links upon archiving a project
Diffstat (limited to 'spec/views')
-rw-r--r--spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb52
1 files changed, 52 insertions, 0 deletions
diff --git a/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb b/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
index 2c60ccfb754..c6c10001bc5 100644
--- a/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
+++ b/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
@@ -113,4 +113,56 @@ describe 'layouts/nav/sidebar/_project' do
end
end
end
+
+ describe 'ci/cd settings tab' do
+ before do
+ project.update!(archived: project_archived)
+ end
+
+ context 'when project is archived' do
+ let(:project_archived) { true }
+
+ it 'does not show the ci/cd settings tab' do
+ render
+
+ expect(rendered).not_to have_link('CI / CD', href: project_settings_ci_cd_path(project))
+ end
+ end
+
+ context 'when project is active' do
+ let(:project_archived) { false }
+
+ it 'shows the ci/cd settings tab' do
+ render
+
+ expect(rendered).to have_link('CI / CD', href: project_settings_ci_cd_path(project))
+ end
+ end
+ end
+
+ describe 'operations settings tab' do
+ before do
+ project.update!(archived: project_archived)
+ end
+
+ context 'when project is archived' do
+ let(:project_archived) { true }
+
+ it 'does not show the operations settings tab' do
+ render
+
+ expect(rendered).not_to have_link('Operations', href: project_settings_operations_path(project))
+ end
+ end
+
+ context 'when project is active' do
+ let(:project_archived) { false }
+
+ it 'shows the operations settings tab' do
+ render
+
+ expect(rendered).to have_link('Operations', href: project_settings_operations_path(project))
+ end
+ end
+ end
end