diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-03-02 16:22:50 +0000 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-03-02 16:22:50 +0000 |
commit | ba9bb4f59f0a8095350c433a303dc46c24bc34b1 (patch) | |
tree | f0206afc57f7a835d0bb75fdc54a8b8129735bbb /spec/features | |
parent | 1fbc4886684b904f2de9e5f726f9e8c0baa76352 (diff) | |
parent | b8ca9bc43a9504dad94a66630170ab6311eb5c09 (diff) | |
download | gitlab-ce-ba9bb4f59f0a8095350c433a303dc46c24bc34b1.tar.gz |
Merge branch 'master' into 'zj-create-mattermost-team'
# Conflicts:
# app/assets/javascripts/dispatcher.js.es6
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/dashboard/groups_list_spec.rb | 47 | ||||
-rw-r--r-- | spec/features/explore/groups_list_spec.rb | 46 |
2 files changed, 93 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..ca04107d33a --- /dev/null +++ b/spec/features/dashboard/groups_list_spec.rb @@ -0,0 +1,47 @@ +require 'spec_helper' + +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 + + it 'resets search when user cleans the input' do + fill_in 'filter_groups', with: group.name + wait_for_ajax + + fill_in 'filter_groups', with: "" + wait_for_ajax + + 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) + expect(page.all('.js-groups-list-holder .content-list li').length).to eq 2 + 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..773ae4b38bc --- /dev/null +++ b/spec/features/explore/groups_list_spec.rb @@ -0,0 +1,46 @@ +require 'spec_helper' + +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 + + it 'resets search when user cleans the input' do + fill_in 'filter_groups', with: group.name + wait_for_ajax + + fill_in 'filter_groups', with: "" + wait_for_ajax + + 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) + expect(page.all('.js-groups-list-holder .content-list li').length).to eq 2 + end +end |