diff options
Diffstat (limited to 'spec/models/remote_mirror_spec.rb')
-rw-r--r-- | spec/models/remote_mirror_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/models/remote_mirror_spec.rb b/spec/models/remote_mirror_spec.rb index d2d7859e726..51351c9fdd1 100644 --- a/spec/models/remote_mirror_spec.rb +++ b/spec/models/remote_mirror_spec.rb @@ -5,6 +5,10 @@ require 'spec_helper' RSpec.describe RemoteMirror, :mailer do include GitHelpers + before do + stub_feature_flags(remote_mirror_no_delay: false) + end + describe 'URL validation' do context 'with a valid URL' do it 'is valid' do @@ -343,6 +347,20 @@ RSpec.describe RemoteMirror, :mailer do remote_mirror.sync end + + context 'when remote_mirror_no_delay is enabled' do + before do + stub_feature_flags(remote_mirror_no_delay: true) + end + + it 'schedules a RepositoryUpdateRemoteMirrorWorker to run now' do + remote_mirror.last_update_started_at = Time.current - 30.seconds + + expect(RepositoryUpdateRemoteMirrorWorker).to receive(:perform_async).with(remote_mirror.id, Time.current) + + remote_mirror.sync + end + end end end end |