summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2014-04-28 12:13:29 +0200
committerJacob Vosmaer <contact@jacobvosmaer.nl>2014-04-28 12:13:29 +0200
commit0b615eb0e2b5cca7685360c0cae72484741d672e (patch)
treef5f2540b9de83311b01146b6f0c2ba30f3dbda36 /spec
parent7339464e7701c0778cca12c12ace83ebd8ffe2f7 (diff)
downloadgitlab-ce-0b615eb0e2b5cca7685360c0cae72484741d672e.tar.gz
Filter out old notes in NotesFinder
Diffstat (limited to 'spec')
-rw-r--r--spec/finders/notes_finder_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/finders/notes_finder_spec.rb b/spec/finders/notes_finder_spec.rb
index 27eaba8dfa1..ffd3f5db815 100644
--- a/spec/finders/notes_finder_spec.rb
+++ b/spec/finders/notes_finder_spec.rb
@@ -27,5 +27,12 @@ describe NotesFinder do
params = { target_id: commit.id, target_type: 'invalid' }
expect { NotesFinder.new.execute(project, user, params) }.to raise_error('invalid target_type')
end
+
+ it 'filters out old notes' do
+ note2.update_attribute(:updated_at, 2.hours.ago)
+ params = { target_id: commit.id, target_type: 'commit', last_fetched_at: 1.hour.ago }
+ notes = NotesFinder.new.execute(project, user, params)
+ notes.should eq([note1])
+ end
end
end