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

resources_helper_spec.rb « catalog « ci « helpers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c4abdebd12e159c5aaad1e6b14c0be9d8acbd2cf (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
32
33
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Ci::Catalog::ResourcesHelper, feature_category: :pipeline_composition do
  let_it_be(:project) { build(:project) }

  describe 'can_view_private_catalog?' do
    subject { helper.can_view_private_catalog?(project) }

    before do
      allow(helper).to receive(:can_collaborate_with_project?).and_return(true)
      stub_licensed_features(ci_private_catalog: false)
    end

    it 'user cannot view the Catalog in CE regardless of permissions' do
      expect(subject).to be false
    end
  end

  describe '#js_ci_catalog_data' do
    let(:project) { build(:project, :repository) }
    let(:default_helper_data) do
      {}
    end

    subject(:catalog_data) { helper.js_ci_catalog_data }

    it 'returns catalog data' do
      expect(catalog_data).to eq(default_helper_data)
    end
  end
end