summaryrefslogtreecommitdiff
path: root/spec/finders
diff options
context:
space:
mode:
authorFelipe Artur <fcardozo@gitlab.com>2018-11-05 12:30:14 +0000
committerPhil Hughes <me@iamphill.com>2018-11-05 12:30:14 +0000
commitb4d005eb7b4a51e8cf6b11e6aea3d0c264e4abfd (patch)
tree2d073cb044761fce0a08ca375b195e12836c985b /spec/finders
parent90473e064eac21be283e751005e0c7abbdbf9089 (diff)
downloadgitlab-ce-b4d005eb7b4a51e8cf6b11e6aea3d0c264e4abfd.tar.gz
Add 'only history' option to notes filter
Diffstat (limited to 'spec/finders')
-rw-r--r--spec/finders/notes_finder_spec.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/finders/notes_finder_spec.rb b/spec/finders/notes_finder_spec.rb
index de9974c45e1..b51f1955ac4 100644
--- a/spec/finders/notes_finder_spec.rb
+++ b/spec/finders/notes_finder_spec.rb
@@ -13,7 +13,7 @@ describe NotesFinder do
let!(:comment) { create(:note_on_issue, project: project) }
let!(:system_note) { create(:note_on_issue, project: project, system: true) }
- it 'filters system notes' do
+ it 'returns only user notes when using only_comments filter' do
finder = described_class.new(project, user, notes_filter: UserPreference::NOTES_FILTERS[:only_comments])
notes = finder.execute
@@ -21,6 +21,14 @@ describe NotesFinder do
expect(notes).to match_array(comment)
end
+ it 'returns only system notes when using only_activity filters' do
+ finder = described_class.new(project, user, notes_filter: UserPreference::NOTES_FILTERS[:only_activity])
+
+ notes = finder.execute
+
+ expect(notes).to match_array(system_note)
+ end
+
it 'gets all notes' do
finder = described_class.new(project, user, notes_filter: UserPreference::NOTES_FILTERS[:all_activity])