Welcome to mirror list, hosted at ThFree Co, Russian Federation.

pipeline_editor_helper_spec.rb « ci « projects « helpers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 882b6548d64132d722be1069eeae8d69aedb1321 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe ::Ci::PipelineEditorHelper do
  let_it_be(:project) { create(:project, :public, :repository) }

  describe '#js_pipeline_editor_data' do
    before do
      allow(helper).to receive(:namespace_project_new_merge_request_path).and_return('/mock/project/-/merge_requests/new')
    end

    subject { helper.js_pipeline_editor_data(project) }

    it {
      is_expected.to match({
        "ci-config-path": project.ci_config_path_or_default,
        "commit-sha" => project.commit.sha,
        "default-branch" => project.default_branch,
        "empty-state-illustration-path" => match_asset_path("/assets/illustrations/empty-state/empty-dag-md.svg"),
        "initial-branch-name": nil,
        "lint-help-page-path" => help_page_path('ci/lint', anchor: 'validate-basic-logic-and-syntax'),
        "new-merge-request-path" => '/mock/project/-/merge_requests/new',
        "project-path" => project.path,
        "project-full-path" => project.full_path,
        "project-namespace" => project.namespace.full_path,
        "yml-help-page-path" => help_page_path('ci/yaml/README')
      })
    }
  end
end