From 85dc423f7090da0a52c73eb66faf22ddb20efff9 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Sat, 19 Sep 2020 01:45:44 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-4-stable-ee --- spec/lib/gitlab/external_authorization/access_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'spec/lib/gitlab/external_authorization/access_spec.rb') diff --git a/spec/lib/gitlab/external_authorization/access_spec.rb b/spec/lib/gitlab/external_authorization/access_spec.rb index 4bb81230ac0..a6773cc19e1 100644 --- a/spec/lib/gitlab/external_authorization/access_spec.rb +++ b/spec/lib/gitlab/external_authorization/access_spec.rb @@ -7,7 +7,7 @@ RSpec.describe Gitlab::ExternalAuthorization::Access, :clean_gitlab_redis_cache describe '#loaded?' do it 'is `true` when it was loaded recently' do - Timecop.freeze do + freeze_time do allow(access).to receive(:loaded_at).and_return(5.minutes.ago) expect(access).to be_loaded @@ -19,7 +19,7 @@ RSpec.describe Gitlab::ExternalAuthorization::Access, :clean_gitlab_redis_cache end it 'is `false` when there the result was loaded a long time ago' do - Timecop.freeze do + freeze_time do allow(access).to receive(:loaded_at).and_return(2.weeks.ago) expect(access).not_to be_loaded @@ -70,7 +70,7 @@ RSpec.describe Gitlab::ExternalAuthorization::Access, :clean_gitlab_redis_cache end it 'stores the result in redis' do - Timecop.freeze do + freeze_time do fake_cache = double expect(fake_cache).to receive(:store).with(true, nil, Time.now) expect(access).to receive(:cache).and_return(fake_cache) @@ -118,7 +118,7 @@ RSpec.describe Gitlab::ExternalAuthorization::Access, :clean_gitlab_redis_cache end it 'does not load from the webservice' do - Timecop.freeze do + freeze_time do expect(fake_cache).to receive(:load).and_return([true, nil, Time.now]) expect(access).to receive(:load_from_cache).and_call_original @@ -129,7 +129,7 @@ RSpec.describe Gitlab::ExternalAuthorization::Access, :clean_gitlab_redis_cache end it 'loads from the webservice when the cached result was too old' do - Timecop.freeze do + freeze_time do expect(fake_cache).to receive(:load).and_return([true, nil, 2.days.ago]) expect(access).to receive(:load_from_cache).and_call_original -- cgit v1.2.1