Commit 7339464e7701c0778cca12c12ace83ebd8ffe2f7
1 parent
e5cf5f4f
Exists in
spb-stable
and in
2 other branches
Fail faster on an invalid target_type
Showing
2 changed files
with
7 additions
and
0 deletions
Show diff stats
app/finders/notes_finder.rb
spec/finders/notes_finder_spec.rb
... | ... | @@ -22,5 +22,10 @@ describe NotesFinder do |
22 | 22 | notes = NotesFinder.new.execute(project, user, params) |
23 | 23 | notes.size.should eq(2) |
24 | 24 | end |
25 | + | |
26 | + it 'should raise an exception for an invalid target_type' do | |
27 | + params = { target_id: commit.id, target_type: 'invalid' } | |
28 | + expect { NotesFinder.new.execute(project, user, params) }.to raise_error('invalid target_type') | |
29 | + end | |
25 | 30 | end |
26 | 31 | end | ... | ... |