Commit 9a51dea6 authored by charlie ablett's avatar charlie ablett

Merge branch '235932-fix-todos-spec' into 'master'

Fix flaky todo finder spec

Closes #235932

See merge request gitlab-org/gitlab!39425
parents 08b4e70e 1f4acbb1
...@@ -235,15 +235,18 @@ RSpec.describe TodosFinder do ...@@ -235,15 +235,18 @@ RSpec.describe TodosFinder do
context 'when filtering by target id' do context 'when filtering by target id' do
it 'returns the expected todos for the target' do it 'returns the expected todos for the target' do
todos = finder.new(user, { target_id: issue.id }).execute todos = finder.new(user, { type: 'Issue', target_id: issue.id }).execute
expect(todos).to match_array([todo1]) expect(todos).to match_array([todo1])
end end
it 'returns the expected todos for multiple target ids' do it 'returns the expected todos for multiple target ids' do
todos = finder.new(user, { target_id: [issue.id, merge_request.id] }).execute another_issue = create(:issue, project: project)
todo3 = create(:todo, user: user, project: project, target: another_issue)
expect(todos).to match_array([todo1, todo2]) todos = finder.new(user, { type: 'Issue', target_id: [issue.id, another_issue.id] }).execute
expect(todos).to match_array([todo1, todo3])
end end
it 'returns the expected todos for empty target id collection' do it 'returns the expected todos for empty target id collection' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment