diff options
author | Rene Hennig <renehennig@my-united.net> | 2018-10-11 14:14:44 +0000 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2018-10-11 14:14:44 +0000 |
commit | caf0e44375fad3ba8add0d4f4eb47bed05c90d10 (patch) | |
tree | ddb2ee2cf6f26070449303c8d4ca6479e4231420 /spec/features/groups/show_spec.rb | |
parent | 9da83baf664ed3aca5f730bb904a9dabe9d863f1 (diff) | |
download | gitlab-ce-caf0e44375fad3ba8add0d4f4eb47bed05c90d10.tar.gz |
Add new sort option "most_stars" to "Group > Children" pages
Diffstat (limited to 'spec/features/groups/show_spec.rb')
-rw-r--r-- | spec/features/groups/show_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/features/groups/show_spec.rb b/spec/features/groups/show_spec.rb index ac961e98a61..4e6f73ef58a 100644 --- a/spec/features/groups/show_spec.rb +++ b/spec/features/groups/show_spec.rb @@ -101,4 +101,25 @@ describe 'Group show page' do expect(page).to have_emoji('smile') end end + + context 'where group has projects' do + let(:user) { create(:user) } + + before do + group.add_owner(user) + sign_in(user) + end + + it 'allows users to sorts projects by most stars', :js do + project1 = create(:project, namespace: group, star_count: 2) + project2 = create(:project, namespace: group, star_count: 3) + project3 = create(:project, namespace: group, star_count: 0) + + visit group_path(group, sort: :stars_desc) + + expect(find('.group-row:nth-child(1) .namespace-title > a')).to have_content(project2.title) + expect(find('.group-row:nth-child(2) .namespace-title > a')).to have_content(project1.title) + expect(find('.group-row:nth-child(3) .namespace-title > a')).to have_content(project3.title) + end + end end |