summaryrefslogtreecommitdiff
path: root/spec/finders
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2014-04-28 11:48:18 +0200
committerJacob Vosmaer <contact@jacobvosmaer.nl>2014-04-28 11:48:18 +0200
commit410790a355a6389bfa372e0834c31541b8ac8e4f (patch)
tree5acb3476dff5263cc85b84069c797d0b2e4e668a /spec/finders
parent27f31a7e3a396e0014be96799e4a15589ef96224 (diff)
downloadgitlab-ce-410790a355a6389bfa372e0834c31541b8ac8e4f.tar.gz
Add NotesFinder spec
Diffstat (limited to 'spec/finders')
-rw-r--r--spec/finders/notes_finder_spec.rb26
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