diff options
Diffstat (limited to 'spec/helpers/ci/catalog/resources_helper_spec.rb')
-rw-r--r-- | spec/helpers/ci/catalog/resources_helper_spec.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/helpers/ci/catalog/resources_helper_spec.rb b/spec/helpers/ci/catalog/resources_helper_spec.rb new file mode 100644 index 00000000000..e873b9379fe --- /dev/null +++ b/spec/helpers/ci/catalog/resources_helper_spec.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Ci::Catalog::ResourcesHelper, feature_category: :pipeline_composition do + include Devise::Test::ControllerHelpers + + let_it_be(:project) { build(:project) } + + describe '#can_view_namespace_catalog?' do + subject { helper.can_view_namespace_catalog?(project) } + + before do + stub_licensed_features(ci_namespace_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(project) } + + it 'returns catalog data' do + expect(catalog_data).to eq(default_helper_data) + end + end +end |