2020-01-29 10:08:59 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-16 14:09:01 -04:00
|
|
|
RSpec.describe 'Group navbar' do
|
2020-03-19 11:09:41 -04:00
|
|
|
include NavbarStructureHelper
|
2020-09-11 14:08:42 -04:00
|
|
|
include WikiHelpers
|
2020-02-06 07:10:29 -05:00
|
|
|
|
2020-03-19 11:09:41 -04:00
|
|
|
include_context 'group navbar structure'
|
|
|
|
|
|
|
|
let_it_be(:user) { create(:user) }
|
|
|
|
let_it_be(:group) { create(:group) }
|
2020-01-29 10:08:59 -05:00
|
|
|
|
2020-03-19 11:09:41 -04:00
|
|
|
before do
|
2020-07-21 08:09:30 -04:00
|
|
|
insert_package_nav(_('Kubernetes'))
|
|
|
|
|
2020-06-10 08:08:58 -04:00
|
|
|
stub_feature_flags(group_iterations: false)
|
2020-11-13 16:09:31 -05:00
|
|
|
stub_config(dependency_proxy: { enabled: false })
|
|
|
|
stub_config(registry: { enabled: false })
|
2020-09-11 14:08:42 -04:00
|
|
|
stub_group_wikis(false)
|
2020-03-19 11:09:41 -04:00
|
|
|
group.add_maintainer(user)
|
|
|
|
sign_in(user)
|
2020-02-06 07:10:29 -05:00
|
|
|
end
|
2020-01-29 10:08:59 -05:00
|
|
|
|
2020-02-06 07:10:29 -05:00
|
|
|
it_behaves_like 'verified navigation bar' do
|
2020-01-29 10:08:59 -05:00
|
|
|
before do
|
|
|
|
visit group_path(group)
|
|
|
|
end
|
|
|
|
end
|
2020-05-11 08:10:28 -04:00
|
|
|
|
|
|
|
context 'when container registry is available' do
|
|
|
|
before do
|
|
|
|
stub_config(registry: { enabled: true })
|
|
|
|
|
2021-04-01 08:08:56 -04:00
|
|
|
insert_container_nav
|
2020-07-21 08:09:30 -04:00
|
|
|
|
2020-05-11 08:10:28 -04:00
|
|
|
visit group_path(group)
|
|
|
|
end
|
|
|
|
|
|
|
|
it_behaves_like 'verified navigation bar'
|
|
|
|
end
|
2020-09-28 11:09:44 -04:00
|
|
|
|
2020-11-13 16:09:31 -05:00
|
|
|
context 'when dependency proxy is available' do
|
|
|
|
before do
|
|
|
|
stub_config(dependency_proxy: { enabled: true })
|
|
|
|
|
2021-04-01 08:08:56 -04:00
|
|
|
insert_dependency_proxy_nav
|
2020-11-13 16:09:31 -05:00
|
|
|
|
|
|
|
visit group_path(group)
|
|
|
|
end
|
|
|
|
|
|
|
|
it_behaves_like 'verified navigation bar'
|
|
|
|
end
|
2020-01-29 10:08:59 -05:00
|
|
|
end
|