diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-04-28 12:16:34 +0200 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-04-28 12:16:34 +0200 |
commit | bbfa4a771ab8ca4745419b8d660af89249e088f4 (patch) | |
tree | 41665cab0a0a2ee1e7b37393d874f29658b0c632 /spec/finders | |
parent | 0b615eb0e2b5cca7685360c0cae72484741d672e (diff) | |
download | gitlab-ce-bbfa4a771ab8ca4745419b8d660af89249e088f4.tar.gz |
Always set last_fetched_at in NotesFinder spec
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/notes_finder_spec.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/finders/notes_finder_spec.rb b/spec/finders/notes_finder_spec.rb index ffd3f5db815..80d6a36c311 100644 --- a/spec/finders/notes_finder_spec.rb +++ b/spec/finders/notes_finder_spec.rb @@ -12,25 +12,25 @@ describe NotesFinder do end describe :execute do + let(:params) { { target_id: commit.id, target_type: 'commit', last_fetched_at: 1.hour.ago } } + before do note1 note2 end it 'should find all notes' do - params = { target_id: commit.id, target_type: 'commit' } notes = NotesFinder.new.execute(project, user, params) notes.size.should eq(2) end it 'should raise an exception for an invalid target_type' do - params = { target_id: commit.id, target_type: 'invalid' } + params.merge!(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 |