summaryrefslogtreecommitdiff
path: root/spec/services/notes/create_service_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-04 12:07:12 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-04 12:07:12 +0000
commit98420be3dddf5a093c39d96a8ca109aa21d0eaf8 (patch)
tree694cbe805e82d5383dc30c462f5efb60e55ccebe /spec/services/notes/create_service_spec.rb
parentc4038d4bdff93b260cbdcd69f9a6c0b07a849457 (diff)
downloadgitlab-ce-98420be3dddf5a093c39d96a8ca109aa21d0eaf8.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/notes/create_service_spec.rb')
-rw-r--r--spec/services/notes/create_service_spec.rb24
1 files changed, 21 insertions, 3 deletions
diff --git a/spec/services/notes/create_service_spec.rb b/spec/services/notes/create_service_spec.rb
index cd4ea9c401d..79ea8f48a58 100644
--- a/spec/services/notes/create_service_spec.rb
+++ b/spec/services/notes/create_service_spec.rb
@@ -87,10 +87,28 @@ describe Notes::CreateService do
.to receive(:unfolded_diff?) { true }
end
- it 'clears noteable diff cache when it was unfolded for the note position' do
- expect_any_instance_of(Gitlab::Diff::HighlightCache).to receive(:clear)
+ context 'using Gitlab::Diff::DeprecatedHighlightCache' do
+ before do
+ stub_feature_flags(hset_redis_diff_caching: false)
+ end
+
+ it 'clears noteable diff cache when it was unfolded for the note position' do
+ expect_any_instance_of(Gitlab::Diff::DeprecatedHighlightCache).to receive(:clear)
+
+ described_class.new(project_with_repo, user, new_opts).execute
+ end
+ end
- described_class.new(project_with_repo, user, new_opts).execute
+ context 'using Gitlab::Diff::HighlightCache' do
+ before do
+ stub_feature_flags(hset_redis_diff_caching: true)
+ end
+
+ it 'clears noteable diff cache when it was unfolded for the note position' do
+ expect_any_instance_of(Gitlab::Diff::HighlightCache).to receive(:clear)
+
+ described_class.new(project_with_repo, user, new_opts).execute
+ end
end
it 'does not clear cache when note is not the first of the discussion' do