diff options
author | Oswaldo Ferreira <oswaldo@gitlab.com> | 2019-02-19 16:29:10 -0300 |
---|---|---|
committer | Oswaldo Ferreira <oswaldo@gitlab.com> | 2019-06-05 08:38:09 -0300 |
commit | 5a89bcc4dae55c40bdd926797aba5e3f0ada05ae (patch) | |
tree | e64a364634faf196a3c59d40b50c437761d513d0 /spec/models/diff_note_spec.rb | |
parent | d9a761ed14ab5025626dee17faf1528c1264a1b0 (diff) | |
download | gitlab-ce-5a89bcc4dae55c40bdd926797aba5e3f0ada05ae.tar.gz |
Avoid 500's when commit is not reachable
Diffstat (limited to 'spec/models/diff_note_spec.rb')
-rw-r--r-- | spec/models/diff_note_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/models/diff_note_spec.rb b/spec/models/diff_note_spec.rb index fa19cb47a0d..d9e1fe4b165 100644 --- a/spec/models/diff_note_spec.rb +++ b/spec/models/diff_note_spec.rb @@ -321,6 +321,14 @@ describe DiffNote do end describe '#supports_suggestion?' do + context 'when noteable does not exist' do + it 'returns false' do + allow(subject).to receive(:noteable) { nil } + + expect(subject.supports_suggestion?).to be(false) + end + end + context 'when noteable does not support suggestions' do it 'returns false' do allow(subject.noteable).to receive(:supports_suggestion?) { false } |