diff options
Diffstat (limited to 'spec/helpers/packages_helper_spec.rb')
-rw-r--r-- | spec/helpers/packages_helper_spec.rb | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/spec/helpers/packages_helper_spec.rb b/spec/helpers/packages_helper_spec.rb index 1917c851547..dacd386d01c 100644 --- a/spec/helpers/packages_helper_spec.rb +++ b/spec/helpers/packages_helper_spec.rb @@ -52,37 +52,14 @@ RSpec.describe PackagesHelper do end end - describe 'packages_coming_soon_enabled?' do - it 'returns false when the feature flag is disabled' do - stub_feature_flags(packages_coming_soon: false) + describe 'composer_config_repository_name' do + let(:host) { Gitlab.config.gitlab.host } + let(:group_id) { 1 } - expect(helper.packages_coming_soon_enabled?(project)).to eq(false) - end - - it 'returns false when not on dev or gitlab.com' do - expect(helper.packages_coming_soon_enabled?(project)).to eq(false) - end - end - - describe 'packages_coming_soon_data' do - let_it_be(:group) { create(:group) } - - before do - allow(Gitlab).to receive(:dev_env_or_com?) { true } - end - - it 'returns the gitlab project on gitlab.com' do - allow(Gitlab).to receive(:com?) { true } - - expect(helper.packages_coming_soon_data(project)).to include({ project_path: 'gitlab-org/gitlab' }) - end - - it 'returns the test project when not on gitlab.com' do - expect(helper.packages_coming_soon_data(project)).to include({ project_path: 'gitlab-org/gitlab-test' }) - end + it 'return global unique composer registry id' do + id = helper.composer_config_repository_name(group_id) - it 'works correctly with a group' do - expect(helper.packages_coming_soon_data(group)).to include({ project_path: 'gitlab-org/gitlab-test' }) + expect(id).to eq("#{host}/#{group_id}") end end end |