summaryrefslogtreecommitdiff
path: root/spec/helpers/projects/pipeline_helper_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-04-20 10:00:54 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-04-20 10:00:54 +0000
commit3cccd102ba543e02725d247893729e5c73b38295 (patch)
treef36a04ec38517f5deaaacb5acc7d949688d1e187 /spec/helpers/projects/pipeline_helper_spec.rb
parent205943281328046ef7b4528031b90fbda70c75ac (diff)
downloadgitlab-ce-3cccd102ba543e02725d247893729e5c73b38295.tar.gz
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'spec/helpers/projects/pipeline_helper_spec.rb')
-rw-r--r--spec/helpers/projects/pipeline_helper_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/helpers/projects/pipeline_helper_spec.rb b/spec/helpers/projects/pipeline_helper_spec.rb
new file mode 100644
index 00000000000..67405ee3b21
--- /dev/null
+++ b/spec/helpers/projects/pipeline_helper_spec.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Projects::PipelineHelper do
+ let_it_be(:user) { create(:user) }
+ let_it_be(:project) { create(:project, :repository) }
+ let_it_be(:raw_pipeline) { create(:ci_pipeline, project: project, ref: 'master', sha: project.commit.id) }
+ let_it_be(:pipeline) { Ci::PipelinePresenter.new(raw_pipeline, current_user: user)}
+
+ describe '#js_pipeline_tabs_data' do
+ subject(:pipeline_tabs_data) { helper.js_pipeline_tabs_data(project, pipeline) }
+
+ it 'returns pipeline tabs data' do
+ expect(pipeline_tabs_data).to include({
+ can_generate_codequality_reports: pipeline.can_generate_codequality_reports?.to_json,
+ graphql_resource_etag: graphql_etag_pipeline_path(pipeline),
+ metrics_path: namespace_project_ci_prometheus_metrics_histograms_path(namespace_id: project.namespace, project_id: project, format: :json),
+ pipeline_project_path: project.full_path
+ })
+ end
+ end
+end