Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-06-15 03:08:43 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-06-15 03:08:43 +0300
commit45ccc5610c9afec64de3c4894789896ee2d5c48d (patch)
tree544b5e40167eca28e075cec24d4736283620b88e /spec/workers/group_import_worker_spec.rb
parent6b4c082fc8f266aa796595103e6c5f6ddb199280 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers/group_import_worker_spec.rb')
-rw-r--r--spec/workers/group_import_worker_spec.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/workers/group_import_worker_spec.rb b/spec/workers/group_import_worker_spec.rb
index bb7dc116a08..324a5fa6978 100644
--- a/spec/workers/group_import_worker_spec.rb
+++ b/spec/workers/group_import_worker_spec.rb
@@ -26,7 +26,7 @@ describe GroupImportWorker do
subject.perform(user.id, group.id)
end
- context 'import state' do
+ context 'when the import state does not exist' do
it 'creates group import' do
expect(group.import_state).to be_nil
@@ -54,6 +54,17 @@ describe GroupImportWorker do
subject.perform(user.id, group.id)
end
end
+
+ context 'when the import state already exists' do
+ it 'updates the existing state' do
+ existing_state = create(:group_import_state, group: group)
+
+ expect { subject.perform(user.id, group.id) }
+ .not_to change { GroupImportState.count }
+
+ expect(existing_state.reload).to be_finished
+ end
+ end
end
context 'when it fails' do