diff options
author | Luke Bennett <lbennett@gitlab.com> | 2019-05-06 16:15:03 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-05-06 16:15:03 +0300 |
commit | 18c07084a6faea04ab446e523fff603843406ac8 (patch) | |
tree | b13bd44f9f56f32afb4ed387284e45102d653a4f /spec/features/projects/settings | |
parent | 53823531ff88f8c568973841fac66e3629df7522 (diff) |
Destroy repo mirrors instead of disabling them
It is important to destroy data related to repo mirrors when they are
disabled.
Use `_destroy` nested attribute instead of `enabled` for push mirrors.
Call `remove_import_data` after saving a project if its pull mirror is
disabled.
Diffstat (limited to 'spec/features/projects/settings')
-rw-r--r-- | spec/features/projects/settings/repository_settings_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/features/projects/settings/repository_settings_spec.rb b/spec/features/projects/settings/repository_settings_spec.rb index 1259ad45791..f7de769cee9 100644 --- a/spec/features/projects/settings/repository_settings_spec.rb +++ b/spec/features/projects/settings/repository_settings_spec.rb @@ -217,5 +217,24 @@ describe 'Projects > Settings > Repository settings' do expect(RepositoryCleanupWorker.jobs.count).to eq(1) end end + + context 'with an existing mirror', :js do + let(:mirrored_project) { create(:project, :repository, :remote_mirror) } + + before do + mirrored_project.add_maintainer(user) + + visit project_settings_repository_path(mirrored_project) + end + + it 'delete remote mirrors' do + expect(mirrored_project.remote_mirrors.count).to eq(1) + + find('.js-delete-mirror').click + wait_for_requests + + expect(mirrored_project.remote_mirrors.count).to eq(0) + end + end end end |