diff options
Diffstat (limited to 'spec/features/search_spec.rb')
-rw-r--r-- | spec/features/search_spec.rb | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/spec/features/search_spec.rb b/spec/features/search_spec.rb index da6388dcdf2..7834807b1f1 100644 --- a/spec/features/search_spec.rb +++ b/spec/features/search_spec.rb @@ -5,7 +5,7 @@ describe "Search", feature: true do let(:user) { create(:user) } let(:project) { create(:empty_project, namespace: user.namespace) } - let!(:issue) { create(:issue, project: project, assignee: user) } + let!(:issue) { create(:issue, project: project, assignees: [user]) } let!(:issue2) { create(:issue, project: project, author: user) } before do @@ -20,14 +20,15 @@ describe "Search", feature: true do context 'search filters', js: true do let(:group) { create(:group) } + let!(:group_project) { create(:empty_project, group: group) } before do group.add_owner(user) end it 'shows group name after filtering' do - find('.js-search-group-dropdown').click - wait_for_ajax + find('.js-search-group-dropdown').trigger('click') + wait_for_requests page.within '.search-holder' do click_link group.name @@ -36,10 +37,28 @@ describe "Search", feature: true do expect(find('.js-search-group-dropdown')).to have_content(group.name) end + it 'filters by group projects after filtering by group' do + find('.js-search-group-dropdown').trigger('click') + wait_for_requests + + page.within '.search-holder' do + click_link group.name + end + + expect(find('.js-search-group-dropdown')).to have_content(group.name) + + page.within('.project-filter') do + find('.js-search-project-dropdown').trigger('click') + wait_for_requests + + expect(page).to have_link(group_project.name_with_namespace) + end + end + it 'shows project name after filtering' do page.within('.project-filter') do - find('.js-search-project-dropdown').click - wait_for_ajax + find('.js-search-project-dropdown').trigger('click') + wait_for_requests click_link project.name_with_namespace end |