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:
authorDouwe Maan <douwe@gitlab.com>2019-01-15 19:26:27 +0300
committerRobert Speicher <rspeicher@gmail.com>2019-01-17 02:35:34 +0300
commit8d81aa9d7921b2e220f29571e2ba804508624fb7 (patch)
treea09d5830856194234e95fa348c1b501edc4ed1ac /spec/workers/repository_update_remote_mirror_worker_spec.rb
parentc68de0e9edec903cdb7df7f0dd6730a9f1ae9013 (diff)
Merge branch 'sh-suppress-duplicate-remote-mirror-notifications' into 'master'
Only send one notification for failed remote mirror Closes #56222 See merge request gitlab-org/gitlab-ce!24381 (cherry picked from commit 9cd5c5f5359cdebc2ae9ba1d20d2e79bd18edce2) 6fbbd4ab Only send one notification for failed remote mirror
Diffstat (limited to 'spec/workers/repository_update_remote_mirror_worker_spec.rb')
-rw-r--r--spec/workers/repository_update_remote_mirror_worker_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/workers/repository_update_remote_mirror_worker_spec.rb b/spec/workers/repository_update_remote_mirror_worker_spec.rb
index d73b0b53713..b582a3650b6 100644
--- a/spec/workers/repository_update_remote_mirror_worker_spec.rb
+++ b/spec/workers/repository_update_remote_mirror_worker_spec.rb
@@ -22,6 +22,13 @@ describe RepositoryUpdateRemoteMirrorWorker do
expect { subject.perform(remote_mirror.id, Time.now) }.to change { remote_mirror.reload.update_status }.to('finished')
end
+ it 'resets the notification flag upon success' do
+ expect_any_instance_of(Projects::UpdateRemoteMirrorService).to receive(:execute).with(remote_mirror).and_return(status: :success)
+ remote_mirror.update_column(:error_notification_sent, true)
+
+ expect { subject.perform(remote_mirror.id, Time.now) }.to change { remote_mirror.reload.error_notification_sent }.to(false)
+ end
+
it 'sets status as failed when update remote mirror service executes with errors' do
error_message = 'fail!'