Commit 81b9d927 authored by Nick Thomas's avatar Nick Thomas

Fix an EE-only test order dependency

Timecop.freeze in a before block should always be paired with Timecop.return
in an after block
parent bc132812
...@@ -92,6 +92,10 @@ describe RemoteMirror do ...@@ -92,6 +92,10 @@ describe RemoteMirror do
Timecop.freeze(Time.now) Timecop.freeze(Time.now)
end end
after do
Timecop.return
end
context 'with remote mirroring enabled' do context 'with remote mirroring enabled' do
it 'schedules a RepositoryUpdateRemoteMirrorWorker to run within a certain backoff delay' do it 'schedules a RepositoryUpdateRemoteMirrorWorker to run within a certain backoff delay' do
expect(RepositoryUpdateRemoteMirrorWorker).to receive(:perform_in).with(RemoteMirror::BACKOFF_DELAY, remote_mirror.id, Time.now) expect(RepositoryUpdateRemoteMirrorWorker).to receive(:perform_in).with(RemoteMirror::BACKOFF_DELAY, remote_mirror.id, Time.now)
...@@ -126,6 +130,10 @@ describe RemoteMirror do ...@@ -126,6 +130,10 @@ describe RemoteMirror do
remote_mirror.update_attributes(last_update_started_at: Time.now) remote_mirror.update_attributes(last_update_started_at: Time.now)
end end
after do
Timecop.return
end
context 'when remote mirror does not have status failed' do context 'when remote mirror does not have status failed' do
it 'returns true when last update started after the timestamp' do it 'returns true when last update started after the timestamp' do
expect(remote_mirror.updated_since?(timestamp)).to be true expect(remote_mirror.updated_since?(timestamp)).to be true
......
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