Fixed default group sort option

Closes #38808
This commit is contained in:
Phil Hughes 2017-10-06 14:42:01 +01:00
parent 0505480324
commit 0f366c7413
No known key found for this signature in database
GPG Key ID: 32245528C52E0F9F
3 changed files with 12 additions and 1 deletions

View File

@ -1,6 +1,6 @@
class Dashboard::GroupsController < Dashboard::ApplicationController
def index
@sort = params[:sort] || 'id_desc'
@sort = params[:sort] || 'created_desc'
@groups =
if params[:parent_id] && Group.supports_nested_groups?

View File

@ -0,0 +1,5 @@
---
title: Fixed group sort dropdown defaulting to empty
merge_request:
author:
type: fixed

View File

@ -5,6 +5,12 @@ RSpec.describe 'Dashboard Group' do
sign_in(create(:user))
end
it 'defaults sort dropdown to last created' do
visit dashboard_groups_path
expect(page).to have_button('Last created')
end
it 'creates new group', js: true do
visit dashboard_groups_path
find('.btn-new').trigger('click')