summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJan Provaznik <jprovaznik@gitlab.com>2018-05-22 12:24:14 +0200
committerJan Provaznik <jprovaznik@gitlab.com>2018-05-23 16:58:40 +0200
commit0230ca839a2ec8debcbe4476c3deed8b422bf451 (patch)
tree5a4435de36faf3ef696cf855491367097e2e30e5 /spec
parent4d674bd38c8a3568f6e1295c25c902ef10151aef (diff)
downloadgitlab-ce-0230ca839a2ec8debcbe4476c3deed8b422bf451.tar.gz
Check if note's noteable is not nil when checking resolvabilityjprovazn-fix-resolvable
This can occur when a note is added to a commit and then this commit is deleted.
Diffstat (limited to 'spec')
-rw-r--r--spec/models/concerns/resolvable_note_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/models/concerns/resolvable_note_spec.rb b/spec/models/concerns/resolvable_note_spec.rb
index 91591017587..fcb5250278e 100644
--- a/spec/models/concerns/resolvable_note_spec.rb
+++ b/spec/models/concerns/resolvable_note_spec.rb
@@ -326,4 +326,12 @@ describe Note, ResolvableNote do
end
end
end
+
+ describe "#potentially_resolvable?" do
+ it 'returns false if noteable could not be found' do
+ allow(subject).to receive(:noteable).and_return(nil)
+
+ expect(subject.potentially_resolvable?).to be_falsey
+ end
+ end
end