diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-04-28 11:48:18 +0200 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-04-28 11:48:18 +0200 |
commit | 410790a355a6389bfa372e0834c31541b8ac8e4f (patch) | |
tree | 5acb3476dff5263cc85b84069c797d0b2e4e668a /spec/finders | |
parent | 27f31a7e3a396e0014be96799e4a15589ef96224 (diff) | |
download | gitlab-ce-410790a355a6389bfa372e0834c31541b8ac8e4f.tar.gz |
Add NotesFinder spec
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/notes_finder_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/finders/notes_finder_spec.rb b/spec/finders/notes_finder_spec.rb new file mode 100644 index 00000000000..f0588f56b47 --- /dev/null +++ b/spec/finders/notes_finder_spec.rb @@ -0,0 +1,26 @@ +require 'spec_helper' + +describe NotesFinder do + let(:user) { create :user } + let(:project) { create :project } + let(:note1) { create :note_on_commit, project: project } + let(:note2) { create :note_on_commit, project: project } + let(:commit) { note1.commit } + + before do + project.team << [user, :master] + end + + describe :execute do + 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 + end +end |