Remove the .distinct when finding issues

This is not needed anymore after !3815.

Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
Rémy Coutable 2016-04-21 18:49:08 +02:00
parent d2bf73b776
commit 5e37d02d0e
No known key found for this signature in database
GPG key ID: 46DF07E5CD9E96AB
2 changed files with 14 additions and 3 deletions

View file

@ -278,9 +278,7 @@ class IssuableFinder
end end
end end
# When filtering by multiple labels we may end up duplicating issues (if one items
# has multiple labels). This ensures we only return unique issues.
items.distinct
end end
def by_due_date(items) def by_due_date(items)

View file

@ -178,6 +178,19 @@ describe 'Issues', feature: true do
expect(first_issue).to include('foo') expect(first_issue).to include('foo')
end 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 end
describe 'filtering by due date' do describe 'filtering by due date' do