diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-02 15:10:57 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-02 15:10:57 +0000 |
commit | 426384d091a0c229ff849ed6ba481bfbe700fb6a (patch) | |
tree | 2e1cc21f46ee6235984ae072d391ffb15f4a1d1c /spec/models/bulk_imports | |
parent | 2ce2a08284a698742c24d1b50fab5f77aa5c6321 (diff) | |
download | gitlab-ce-426384d091a0c229ff849ed6ba481bfbe700fb6a.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/bulk_imports')
-rw-r--r-- | spec/models/bulk_imports/entity_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/bulk_imports/entity_spec.rb b/spec/models/bulk_imports/entity_spec.rb index 17ab4d5954c..6c9dc061430 100644 --- a/spec/models/bulk_imports/entity_spec.rb +++ b/spec/models/bulk_imports/entity_spec.rb @@ -189,4 +189,20 @@ RSpec.describe BulkImports::Entity, type: :model do expect(entity.next_page_for(:relation)).to eq('nextPage') end end + + describe 'caching', :clean_gitlab_redis_cache do + let(:entity) { create(:bulk_import_entity, :started) } + + it 'removes entity cache keys' do + cache_key = "bulk_import:#{entity.bulk_import.id}:entity:#{entity.id}:relation:1" + + Gitlab::Redis::Cache.with do |redis| + redis.set(cache_key, 1) + + expect(redis).to receive(:del).with(cache_key) + end + + entity.finish! + end + end end |