summaryrefslogtreecommitdiff
path: root/spec/helpers
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2017-06-07 12:32:16 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2017-06-13 16:05:38 +0200
commit25b99a5b3beecb7251fef9097c44afd1f82f9f57 (patch)
tree8f005048ec11ae7ad27e5d999b263b458c7487a8 /spec/helpers
parentd03e687882552cedaac2a493c9dbf4a3d98e0bac (diff)
downloadgitlab-ce-25b99a5b3beecb7251fef9097c44afd1f82f9f57.tar.gz
Update tests and applicationfix-external-ci-services
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/projects_helper_spec.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb
index a695621b87a..3ed0b0a756b 100644
--- a/spec/helpers/projects_helper_spec.rb
+++ b/spec/helpers/projects_helper_spec.rb
@@ -300,4 +300,37 @@ describe ProjectsHelper do
expect(helper.send(:visibility_select_options, project, Gitlab::VisibilityLevel::PRIVATE)).to include('Private')
end
end
+
+ describe '#get_project_nav_tabs' do
+ let(:project) { create(:empty_project) }
+ let(:user) { create(:user) }
+
+ before do
+ allow(helper).to receive(:can?) { true }
+ end
+
+ subject do
+ helper.send(:get_project_nav_tabs, project, user)
+ end
+
+ context 'when builds feature is enabled' do
+ before do
+ allow(project).to receive(:builds_enabled?).and_return(true)
+ end
+
+ it "does include pipelines tab" do
+ is_expected.to include(:pipelines)
+ end
+ end
+
+ context 'when builds feature is disabled' do
+ before do
+ allow(project).to receive(:builds_enabled?).and_return(false)
+ end
+
+ it "do not include pipelines tab" do
+ is_expected.not_to include(:pipelines)
+ end
+ end
+ end
end