Commit a4510729 authored by Yorick Peterse's avatar Yorick Peterse

Merge branch '15465-fix-sort-by-due-date' into 'master'

Remove the `.distinct` when finding issues

See merge request !3858
parents 0e2b6449 5e37d02d
......@@ -278,9 +278,7 @@ def by_label(items)
end
end
# When filtering by multiple labels we may end up duplicating issues (if one
# has multiple labels). This ensures we only return unique issues.
items.distinct
items
end
def by_due_date(items)
......
......@@ -178,6 +178,19 @@
expect(first_issue).to include('foo')
end
context 'with a filter on labels' do
let(:label) { create(:label, project: project) }
before { create(:label_link, label: label, target: foo) }
it 'sorts by least recently due date by excluding nil due dates' do
bar.update(due_date: nil)
visit namespace_project_issues_path(project.namespace, project, label_names: [label.name], sort: sort_value_due_date_later)
expect(first_issue).to include('foo')
end
end
end
describe 'filtering by due date' 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