diff options
author | Stan Hu <stanhu@gmail.com> | 2019-07-27 07:28:56 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-07-27 07:28:56 +0300 |
commit | c41788fe54fecf113a31b1aa3238ea22ac1947d5 (patch) | |
tree | 44f2b0ab268dba1e96da487711ac47ad51d96c14 /spec/finders/notes_finder_spec.rb | |
parent | 5861b9fd32435a0e691646e7ffef19dec2561ecf (diff) |
Revert "Merge branch '52123-issuable-actions-notesfinder-pderichs' into 'master'"
This reverts merge request !29733
Diffstat (limited to 'spec/finders/notes_finder_spec.rb')
-rw-r--r-- | spec/finders/notes_finder_spec.rb | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/spec/finders/notes_finder_spec.rb b/spec/finders/notes_finder_spec.rb index 677fde0d8ce..87bde4ca2f6 100644 --- a/spec/finders/notes_finder_spec.rb +++ b/spec/finders/notes_finder_spec.rb @@ -118,11 +118,16 @@ describe NotesFinder do context 'for target' do let(:project) { create(:project, :repository) } - let!(:note1) { create :note_on_commit, project: project } - let!(:note2) { create :note_on_commit, project: project } + let(:note1) { create :note_on_commit, project: project } + let(:note2) { create :note_on_commit, project: project } let(:commit) { note1.noteable } let(:params) { { target_id: commit.id, target_type: 'commit', last_fetched_at: 1.hour.ago.to_i } } + before do + note1 + note2 + end + it 'finds all notes' do notes = described_class.new(project, user, params).execute expect(notes.size).to eq(2) @@ -189,28 +194,6 @@ describe NotesFinder do end end end - - context 'for explicit target' do - let(:project) { create(:project, :repository) } - let!(:note1) { create :note_on_commit, project: project, created_at: 1.day.ago, updated_at: 2.hours.ago } - let!(:note2) { create :note_on_commit, project: project } - let(:commit) { note1.noteable } - let(:params) { { target: commit } } - - it 'returns the expected notes' do - expect(described_class.new(project, user, params).execute).to eq([note1, note2]) - end - - it 'returns the expected notes when last_fetched_at is given' do - params = { target: commit, last_fetched_at: 1.hour.ago.to_i } - expect(described_class.new(project, user, params).execute).to eq([note2]) - end - - it 'fails when nil is provided' do - params = { target: nil } - expect { described_class.new(project, user, params).execute }.to raise_error(RuntimeError) - end - end end describe '.search' do |