Merge branch '53290-incorrect-project-list-order-select-default-label' into 'master'
Resolve "Incorrect project list order select default label" Closes #53290 See merge request gitlab-org/gitlab-ce!23058
This commit is contained in:
commit
a0c86637c1
|
@ -178,7 +178,7 @@ class GroupDescendantsFinder
|
|||
end
|
||||
|
||||
def sort
|
||||
params.fetch(:sort, 'id_asc')
|
||||
params.fetch(:sort, 'created_desc')
|
||||
end
|
||||
|
||||
# rubocop: disable CodeReuse/ActiveRecord
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Fix default sorting for subgroups and projects list
|
||||
merge_request: 23058
|
||||
author: Jacopo Beschi @jacopo-beschi
|
||||
type: fixed
|
|
@ -74,6 +74,13 @@ describe GroupDescendantsFinder do
|
|||
end
|
||||
end
|
||||
|
||||
it 'sorts elements by latest created as default' do
|
||||
project1 = create(:project, namespace: group, created_at: 1.hour.ago)
|
||||
project2 = create(:project, namespace: group)
|
||||
|
||||
expect(subject.execute).to eq([project2, project1])
|
||||
end
|
||||
|
||||
context 'sorting by name' do
|
||||
let!(:project1) { create(:project, namespace: group, name: 'a', path: 'project-a') }
|
||||
let!(:project2) { create(:project, namespace: group, name: 'z', path: 'project-z') }
|
||||
|
|
Loading…
Reference in New Issue