summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/draft_notes/publish_service_spec.rb7
-rw-r--r--spec/services/merge_requests/reload_diffs_service_spec.rb5
2 files changed, 9 insertions, 3 deletions
diff --git a/spec/services/draft_notes/publish_service_spec.rb b/spec/services/draft_notes/publish_service_spec.rb
index a4b1d8742d0..dab06637c1a 100644
--- a/spec/services/draft_notes/publish_service_spec.rb
+++ b/spec/services/draft_notes/publish_service_spec.rb
@@ -172,7 +172,12 @@ RSpec.describe DraftNotes::PublishService, feature_category: :code_review_workfl
end
end
- it 'does not requests a lot from Gitaly', :request_store do
+ it 'does not request a lot from Gitaly', :request_store, :clean_gitlab_redis_cache do
+ merge_request
+ position
+
+ Gitlab::GitalyClient.reset_counts
+
# NOTE: This should be reduced as we work on reducing Gitaly calls.
# Gitaly requests shouldn't go above this threshold as much as possible
# as it may add more to the Gitaly N+1 issue we are experiencing.
diff --git a/spec/services/merge_requests/reload_diffs_service_spec.rb b/spec/services/merge_requests/reload_diffs_service_spec.rb
index 4dd05f75a3e..f079e3983d7 100644
--- a/spec/services/merge_requests/reload_diffs_service_spec.rb
+++ b/spec/services/merge_requests/reload_diffs_service_spec.rb
@@ -35,8 +35,9 @@ feature_category: :code_review_workflow do
context 'cache clearing' do
it 'clears the cache for older diffs on the merge request' do
- expect_any_instance_of(Redis).to receive(:del).once.and_call_original
- expect(Rails.cache).to receive(:delete).once.and_call_original
+ expect_next_instance_of(Gitlab::Diff::FileCollection::MergeRequestDiff) do |instance|
+ expect(instance).to receive(:clear_cache).and_call_original
+ end
subject.execute
end