diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-21 09:06:16 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-21 09:06:16 +0000 |
commit | a048261403ea7e12992ccffe704f0779235712d7 (patch) | |
tree | 59254549db6d39a4da824379a7bf354e7c8e7e67 /spec/models/note_spec.rb | |
parent | 80e5134020483299c039114e76b734436f006c66 (diff) | |
download | gitlab-ce-a048261403ea7e12992ccffe704f0779235712d7.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.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb index 3ab88b52568..b09e699a8a7 100644 --- a/spec/models/note_spec.rb +++ b/spec/models/note_spec.rb @@ -456,6 +456,19 @@ describe Note do end end + describe '#start_of_discussion?' do + let_it_be(:note) { create(:discussion_note_on_merge_request) } + let_it_be(:reply) { create(:discussion_note_on_merge_request, in_reply_to: note) } + + it 'returns true when note is the start of a discussion' do + expect(note).to be_start_of_discussion + end + + it 'returns false when note is a reply' do + expect(reply).not_to be_start_of_discussion + end + end + describe '.find_discussion' do let!(:note) { create(:discussion_note_on_merge_request) } let!(:note2) { create(:discussion_note_on_merge_request, in_reply_to: note) } |