debian-mirror-gitlab/spec/features/groups/navbar_spec.rb

99 lines
2.2 KiB
Ruby
Raw Normal View History

2020-03-13 15:44:24 +05:30
# frozen_string_literal: true
require 'spec_helper'
2020-06-23 00:09:42 +05:30
RSpec.describe 'Group navbar' do
2020-04-22 19:07:51 +05:30
include NavbarStructureHelper
2020-11-24 15:15:51 +05:30
include WikiHelpers
2020-03-13 15:44:24 +05:30
2020-04-22 19:07:51 +05:30
include_context 'group navbar structure'
let_it_be(:user) { create(:user) }
2022-03-02 08:16:31 +05:30
let(:group) { create(:group) }
2020-03-13 15:44:24 +05:30
2020-04-22 19:07:51 +05:30
before do
2020-10-24 23:57:45 +05:30
insert_package_nav(_('Kubernetes'))
2021-12-11 22:18:48 +05:30
stub_feature_flags(customer_relations: false)
2021-01-29 00:20:46 +05:30
stub_config(dependency_proxy: { enabled: false })
stub_config(registry: { enabled: false })
2022-05-07 20:08:51 +05:30
stub_feature_flags(harbor_registry_integration: false)
2020-11-24 15:15:51 +05:30
stub_group_wikis(false)
2020-04-22 19:07:51 +05:30
group.add_maintainer(user)
sign_in(user)
2020-03-13 15:44:24 +05:30
end
it_behaves_like 'verified navigation bar' do
before do
visit group_path(group)
end
end
2020-05-24 23:13:21 +05:30
context 'when container registry is available' do
before do
stub_config(registry: { enabled: true })
2021-04-29 21:17:54 +05:30
insert_container_nav
2020-10-24 23:57:45 +05:30
2020-05-24 23:13:21 +05:30
visit group_path(group)
end
it_behaves_like 'verified navigation bar'
end
2021-01-03 14:25:43 +05:30
2022-03-02 08:16:31 +05:30
context 'when customer_relations feature and flag is enabled' do
let(:group) { create(:group, :crm_enabled) }
2021-12-11 22:18:48 +05:30
before do
stub_feature_flags(customer_relations: true)
if Gitlab.ee?
insert_customer_relations_nav(_('Analytics'))
else
insert_customer_relations_nav(_('Packages & Registries'))
end
visit group_path(group)
end
it_behaves_like 'verified navigation bar'
end
2022-05-07 20:08:51 +05:30
context 'when customer_relations feature and flag is enabled but subgroup' do
let(:group) { create(:group, :crm_enabled, parent: create(:group)) }
before do
stub_feature_flags(customer_relations: true)
visit group_path(group)
end
it_behaves_like 'verified navigation bar'
end
2021-01-29 00:20:46 +05:30
context 'when dependency proxy is available' do
before do
stub_config(dependency_proxy: { enabled: true })
2021-04-29 21:17:54 +05:30
insert_dependency_proxy_nav
2021-01-29 00:20:46 +05:30
visit group_path(group)
end
it_behaves_like 'verified navigation bar'
end
2022-05-07 20:08:51 +05:30
context 'when harbor registry is available' do
before do
stub_feature_flags(harbor_registry_integration: true)
insert_harbor_registry_nav(_('Package Registry'))
visit group_path(group)
end
it_behaves_like 'verified navigation bar'
end
2020-03-13 15:44:24 +05:30
end