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/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