diff options
author | Jan Provaznik <jprovaznik@gitlab.com> | 2018-03-05 13:25:56 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-03-05 13:25:56 +0000 |
commit | 741caf93e14758c223b6ef819390f5889bdd108b (patch) | |
tree | 3dcd6e8377b6688eed28e4a24a92cb4ba902ede6 /spec/finders | |
parent | f56de375f756ffc4ba4aa76f0cada1a64c45d759 (diff) | |
download | gitlab-ce-741caf93e14758c223b6ef819390f5889bdd108b.tar.gz |
Use limited count queries also for scoped searches
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/notes_finder_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/finders/notes_finder_spec.rb b/spec/finders/notes_finder_spec.rb index 7b43494eea2..f1ae2c7ab65 100644 --- a/spec/finders/notes_finder_spec.rb +++ b/spec/finders/notes_finder_spec.rb @@ -75,6 +75,18 @@ describe NotesFinder do end end + context 'for target type' do + let(:project) { create(:project, :repository) } + let!(:note1) { create :note_on_issue, project: project } + let!(:note2) { create :note_on_commit, project: project } + + it 'finds only notes for the selected type' do + notes = described_class.new(project, user, target_type: 'issue').execute + + expect(notes).to eq([note1]) + end + end + context 'for target' do let(:project) { create(:project, :repository) } let(:note1) { create :note_on_commit, project: project } |