diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2017-03-01 15:31:56 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2017-03-01 15:39:59 +0200 |
commit | b7c30cae4eedab5e8e41d9764ac08ca12361d054 (patch) | |
tree | e5a594dfd920a55a52a00b34e632dfb553de4c45 /spec | |
parent | 11dd2348c410949c98adfc10cdcf5be787742179 (diff) | |
download | gitlab-ce-b7c30cae4eedab5e8e41d9764ac08ca12361d054.tar.gz |
Add filter and sorting to dashboard groups page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/dashboard/groups_list_spec.rb | 34 | ||||
-rw-r--r-- | spec/features/explore/groups_list_spec.rb | 33 |
2 files changed, 67 insertions, 0 deletions
diff --git a/spec/features/dashboard/groups_list_spec.rb b/spec/features/dashboard/groups_list_spec.rb new file mode 100644 index 00000000000..8cdd14ba1bb --- /dev/null +++ b/spec/features/dashboard/groups_list_spec.rb @@ -0,0 +1,34 @@ +require 'spec_helper' + +RSpec.describe 'Dashboard Groups page', js: true, feature: true do + include WaitForAjax + + let!(:user) { create :user } + let!(:group) { create(:group) } + let!(:nested_group) { create(:group, :nested) } + let!(:another_group) { create(:group) } + + before do + group.add_owner(user) + nested_group.add_owner(user) + + login_as(user) + + visit dashboard_groups_path + end + + it 'shows groups user is member of' do + expect(page).to have_content(group.full_name) + expect(page).to have_content(nested_group.full_name) + expect(page).not_to have_content(another_group.full_name) + end + + it 'filters groups' do + fill_in 'filter_groups', with: group.name + wait_for_ajax + + expect(page).to have_content(group.full_name) + expect(page).not_to have_content(nested_group.full_name) + expect(page).not_to have_content(another_group.full_name) + end +end diff --git a/spec/features/explore/groups_list_spec.rb b/spec/features/explore/groups_list_spec.rb new file mode 100644 index 00000000000..2ab97a8928b --- /dev/null +++ b/spec/features/explore/groups_list_spec.rb @@ -0,0 +1,33 @@ +require 'spec_helper' + +RSpec.describe 'Explore Groups page', js: true, feature: true do + include WaitForAjax + + let!(:user) { create :user } + let!(:group) { create(:group) } + let!(:public_group) { create(:group, :public) } + let!(:private_group) { create(:group, :private) } + + before do + group.add_owner(user) + + login_as(user) + + visit explore_groups_path + end + + it 'shows groups user is member of' do + expect(page).to have_content(group.full_name) + expect(page).to have_content(public_group.full_name) + expect(page).not_to have_content(private_group.full_name) + end + + it 'filters groups' do + fill_in 'filter_groups', with: group.name + wait_for_ajax + + expect(page).to have_content(group.full_name) + expect(page).not_to have_content(public_group.full_name) + expect(page).not_to have_content(private_group.full_name) + end +end |