Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/shared_examples/attention_request_cache_invalidation_examples.rb')
-rw-r--r--spec/support/shared_examples/attention_request_cache_invalidation_examples.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/support/shared_examples/attention_request_cache_invalidation_examples.rb b/spec/support/shared_examples/attention_request_cache_invalidation_examples.rb
new file mode 100644
index 00000000000..7fe696abc69
--- /dev/null
+++ b/spec/support/shared_examples/attention_request_cache_invalidation_examples.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+RSpec.shared_examples 'invalidates attention request cache' do
+ it 'invalidates the merge requests requiring attention count' do
+ cache_mock = double
+
+ users.each do |user|
+ expect(cache_mock).to receive(:delete).with(['users', user.id, 'attention_requested_open_merge_requests_count'])
+ end
+
+ allow(Rails).to receive(:cache).and_return(cache_mock)
+
+ service.execute
+ end
+end