diff options
author | Markus Koller <mkoller@gitlab.com> | 2019-07-15 19:59:57 +0200 |
---|---|---|
committer | Markus Koller <mkoller@gitlab.com> | 2019-08-12 22:01:15 +0200 |
commit | 49c83155ccb78284b17a9ffa47583ddace5dbd01 (patch) | |
tree | f9b5697ef11d581737d07b395f529ef3d20e1325 /spec/features/search | |
parent | 71ec793214dd81701b5485aa10e20c9719cb0584 (diff) | |
download | gitlab-ce-49c83155ccb78284b17a9ffa47583ddace5dbd01.tar.gz |
Load search result counts asynchronously
Querying all counts for the different search results in the same request
led to timeouts, so we now only calculate the count for the *current*
search results, and request the others in separate asynchronous calls.
Diffstat (limited to 'spec/features/search')
-rw-r--r-- | spec/features/search/user_searches_for_users_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/search/user_uses_header_search_field_spec.rb | 17 |
2 files changed, 19 insertions, 2 deletions
diff --git a/spec/features/search/user_searches_for_users_spec.rb b/spec/features/search/user_searches_for_users_spec.rb index 2517a843c62..e10c1afc0b8 100644 --- a/spec/features/search/user_searches_for_users_spec.rb +++ b/spec/features/search/user_searches_for_users_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' describe 'User searches for users' do context 'when on the dashboard' do - it 'finds the user' do + it 'finds the user', :js do create(:user, username: 'gob_bluth', name: 'Gob Bluth') sign_in(create(:user)) @@ -12,7 +12,7 @@ describe 'User searches for users' do visit dashboard_projects_path fill_in 'search', with: 'gob' - click_button 'Go' + find('#search').send_keys(:enter) expect(page).to have_content('Users 1') diff --git a/spec/features/search/user_uses_header_search_field_spec.rb b/spec/features/search/user_uses_header_search_field_spec.rb index c781048d06d..5006631cc14 100644 --- a/spec/features/search/user_uses_header_search_field_spec.rb +++ b/spec/features/search/user_uses_header_search_field_spec.rb @@ -96,6 +96,23 @@ describe 'User uses header search field', :js do let(:url) { root_path } let(:scope_name) { 'All GitLab' } end + + context 'when searching through the search field' do + before do + create(:issue, project: project, title: 'project issue') + + fill_in('search', with: 'project') + find('#search').send_keys(:enter) + end + + it 'displays result counts for all categories' do + expect(page).to have_content('Projects 1') + expect(page).to have_content('Issues 1') + expect(page).to have_content('Merge requests 0') + expect(page).to have_content('Milestones 0') + expect(page).to have_content('Users 0') + end + end end context 'when user is in a project scope' do |