diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
commit | ee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch) | |
tree | f8479f94a28f66654c6a4f6fb99bad6b4e86a40e /spec/requests/api/branches_spec.rb | |
parent | 62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff) |
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to 'spec/requests/api/branches_spec.rb')
-rw-r--r-- | spec/requests/api/branches_spec.rb | 48 |
1 files changed, 9 insertions, 39 deletions
diff --git a/spec/requests/api/branches_spec.rb b/spec/requests/api/branches_spec.rb index f7539e13b80..750b9a39e15 100644 --- a/spec/requests/api/branches_spec.rb +++ b/spec/requests/api/branches_spec.rb @@ -221,55 +221,25 @@ RSpec.describe API::Branches do get api(route), params: { per_page: 1 } end - context 'when increase_branch_cache_expiry is enabled' do - it 'uses the cache up to 60 minutes' do - time_of_request = Time.current + it 'uses the cache up to 60 minutes' do + time_of_request = Time.current - get api(route), params: { per_page: 1 } - - travel_to time_of_request + 59.minutes do - expect(API::Entities::Branch).not_to receive(:represent) + get api(route), params: { per_page: 1 } - get api(route), params: { per_page: 1 } - end - end + travel_to time_of_request + 59.minutes do + expect(API::Entities::Branch).not_to receive(:represent) - it 'requests for new value after 60 minutes' do get api(route), params: { per_page: 1 } - - travel_to 61.minutes.from_now do - expect(API::Entities::Branch).to receive(:represent) - - get api(route), params: { per_page: 1 } - end end end - context 'when increase_branch_cache_expiry is disabled' do - before do - stub_feature_flags(increase_branch_cache_expiry: false) - end - - it 'uses the cache up to 10 minutes' do - time_of_request = Time.current - - get api(route), params: { per_page: 1 } + it 'requests for new value after 60 minutes' do + get api(route), params: { per_page: 1 } - travel_to time_of_request + 9.minutes do - expect(API::Entities::Branch).not_to receive(:represent) + travel_to 61.minutes.from_now do + expect(API::Entities::Branch).to receive(:represent) - get api(route), params: { per_page: 1 } - end - end - - it 'requests for new value after 10 minutes' do get api(route), params: { per_page: 1 } - - travel_to 11.minutes.from_now do - expect(API::Entities::Branch).to receive(:represent) - - get api(route), params: { per_page: 1 } - end end end end |