summaryrefslogtreecommitdiff
path: root/spec/models/note_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-18 14:02:45 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-18 14:02:45 +0000
commit80f61b4035607d7cd87de993b8f5e996bde3481f (patch)
tree06b12f51e97d87192e3dd0e05edf55143645b894 /spec/models/note_spec.rb
parent4ab54c2233e91f60a80e5b6fa2181e6899fdcc3e (diff)
downloadgitlab-ce-80f61b4035607d7cd87de993b8f5e996bde3481f.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/note_spec.rb')
-rw-r--r--spec/models/note_spec.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb
index 927fbdb93d8..66e3c6d5e9d 100644
--- a/spec/models/note_spec.rb
+++ b/spec/models/note_spec.rb
@@ -73,6 +73,10 @@ describe Note do
end
describe "Commit notes" do
+ before do
+ allow(Gitlab::Git::KeepAround).to receive(:execute).and_call_original
+ end
+
let!(:note) { create(:note_on_commit, note: "+1 from me") }
let!(:commit) { note.noteable }
@@ -92,7 +96,9 @@ describe Note do
end
it "keeps the commit around" do
- expect(note.project.repository.kept_around?(commit.id)).to be_truthy
+ repo = note.project.repository
+
+ expect(repo.ref_exists?("refs/keep-around/#{commit.id}")).to be_truthy
end
it 'does not generate N+1 queries for participants', :request_store do