2020-04-25 10:58:03 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2022-11-25 23:54:43 +05:30
|
|
|
RSpec.describe 'Group Repository settings', :js do
|
2020-04-25 10:58:03 +05:30
|
|
|
include WaitForRequests
|
|
|
|
|
2022-11-25 23:54:43 +05:30
|
|
|
let_it_be(:user) { create(:user) }
|
|
|
|
let_it_be(:group, reload: true) { create(:group) }
|
2020-04-25 10:58:03 +05:30
|
|
|
|
2022-11-25 23:54:43 +05:30
|
|
|
before_all do
|
2020-04-25 10:58:03 +05:30
|
|
|
group.add_owner(user)
|
2022-11-25 23:54:43 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
before do
|
2020-04-25 10:58:03 +05:30
|
|
|
sign_in(user)
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'Deploy tokens' do
|
|
|
|
let!(:deploy_token) { create(:deploy_token, :group, groups: [group]) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
stub_container_registry_config(enabled: true)
|
|
|
|
end
|
|
|
|
|
2023-01-13 00:05:48 +05:30
|
|
|
it_behaves_like 'a deploy token in settings' do
|
|
|
|
let(:entity_type) { 'group' }
|
|
|
|
let(:page_path) { group_settings_repository_path(group) }
|
2020-04-25 10:58:03 +05:30
|
|
|
end
|
|
|
|
end
|
2021-01-29 00:20:46 +05:30
|
|
|
|
2022-05-07 20:08:51 +05:30
|
|
|
context 'Default branch' do
|
2021-01-29 00:20:46 +05:30
|
|
|
before do
|
|
|
|
visit group_settings_repository_path(group)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'has the setting section' do
|
|
|
|
expect(page).to have_css("#js-default-branch-name")
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'renders the correct setting section content' do
|
|
|
|
within("#js-default-branch-name") do
|
2022-05-07 20:08:51 +05:30
|
|
|
expect(page).to have_content("Default branch")
|
|
|
|
expect(page).to have_content("Set the initial name and protections for the default branch of new repositories created in the group.")
|
2021-01-29 00:20:46 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2020-04-25 10:58:03 +05:30
|
|
|
end
|