Commit bbfa4a771ab8ca4745419b8d660af89249e088f4

Authored by Jacob Vosmaer
1 parent 0b615eb0

Always set last_fetched_at in NotesFinder spec

Showing 1 changed file with 3 additions and 3 deletions   Show diff stats
spec/finders/notes_finder_spec.rb
... ... @@ -12,25 +12,25 @@ describe NotesFinder do
12 12 end
13 13  
14 14 describe :execute do
  15 + let(:params) { { target_id: commit.id, target_type: 'commit', last_fetched_at: 1.hour.ago } }
  16 +
15 17 before do
16 18 note1
17 19 note2
18 20 end
19 21  
20 22 it 'should find all notes' do
21   - params = { target_id: commit.id, target_type: 'commit' }
22 23 notes = NotesFinder.new.execute(project, user, params)
23 24 notes.size.should eq(2)
24 25 end
25 26  
26 27 it 'should raise an exception for an invalid target_type' do
27   - params = { target_id: commit.id, target_type: 'invalid' }
  28 + params.merge!(target_type: 'invalid')
28 29 expect { NotesFinder.new.execute(project, user, params) }.to raise_error('invalid target_type')
29 30 end
30 31  
31 32 it 'filters out old notes' do
32 33 note2.update_attribute(:updated_at, 2.hours.ago)
33   - params = { target_id: commit.id, target_type: 'commit', last_fetched_at: 1.hour.ago }
34 34 notes = NotesFinder.new.execute(project, user, params)
35 35 notes.should eq([note1])
36 36 end
... ...