diff options
author | Jan Provaznik <jprovaznik@gitlab.com> | 2018-05-22 12:24:14 +0200 |
---|---|---|
committer | Jan Provaznik <jprovaznik@gitlab.com> | 2018-05-23 16:58:40 +0200 |
commit | 0230ca839a2ec8debcbe4476c3deed8b422bf451 (patch) | |
tree | 5a4435de36faf3ef696cf855491367097e2e30e5 /spec | |
parent | 4d674bd38c8a3568f6e1295c25c902ef10151aef (diff) | |
download | gitlab-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.rb | 8 |
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 |