Commit da8fd03c authored by Robert Speicher's avatar Robert Speicher

Add "Keep divergent refs" feature spec

parent f715c41d
...@@ -72,6 +72,21 @@ describe 'Projects > Settings > Repository settings' do ...@@ -72,6 +72,21 @@ describe 'Projects > Settings > Repository settings' do
expect(project.remote_mirrors.first.only_protected_branches).to eq(true) expect(project.remote_mirrors.first.only_protected_branches).to eq(true)
end end
it 'creates a push mirror that keeps divergent refs', :js do
select_direction
fill_in 'url', with: 'ssh://user@localhost/project.git'
fill_in 'Password', with: 'password'
check 'Keep divergent refs'
Sidekiq::Testing.fake! do
click_button 'Mirror repository'
end
expect(page).to have_content('Mirroring settings were successfully updated')
expect(project.reload.remote_mirrors.first.keep_divergent_refs).to eq(true)
end
it 'generates an SSH public key on submission', :js do it 'generates an SSH public key on submission', :js do
fill_in 'url', with: 'ssh://user@localhost/project.git' fill_in 'url', with: 'ssh://user@localhost/project.git'
select 'SSH public key', from: 'Authentication method' select 'SSH public key', from: 'Authentication method'
...@@ -110,6 +125,20 @@ describe 'Projects > Settings > Repository settings' do ...@@ -110,6 +125,20 @@ describe 'Projects > Settings > Repository settings' do
end end
end end
# Removal: https://gitlab.com/gitlab-org/gitlab/-/issues/208828
context 'with the `keep_divergent_refs` feature flag disabled' do
before do
stub_feature_flags(keep_divergent_refs: { enabled: false, thing: project })
end
it 'hides the "Keep divergent refs" option' do
visit project_settings_repository_path(project)
expect(page).not_to have_selector('#keep_divergent_refs')
expect(page).not_to have_text('Keep divergent refs')
end
end
context 'repository cleanup settings' do context 'repository cleanup settings' do
let(:object_map_file) { Rails.root.join('spec', 'fixtures', 'bfg_object_map.txt') } let(:object_map_file) { Rails.root.join('spec', 'fixtures', 'bfg_object_map.txt') }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment