diff options
author | Kushal Pandya <kushalspandya@gmail.com> | 2019-08-20 07:57:25 +0000 |
---|---|---|
committer | Kushal Pandya <kushalspandya@gmail.com> | 2019-08-20 07:57:25 +0000 |
commit | a2d470d2786e2398aade7d7213ea4a3c344a797c (patch) | |
tree | 1709c2acbc587f8773e0ce484d7ad6c427226a13 /spec/features | |
parent | f77d174371b9c0d826fa6558c8e2c8c870afb22a (diff) | |
parent | cacf128d5d5c7f6ab4f90f66f181057086ad1920 (diff) | |
download | gitlab-ce-a2d470d2786e2398aade7d7213ea4a3c344a797c.tar.gz |
Merge branch 'fe-fix-merge-url-params-with-plus' into 'master'
Fix `mergeUrlParams` handling of '+'
Closes #66152
See merge request gitlab-org/gitlab-ce!31973
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/search/user_searches_for_code_spec.rb | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/spec/features/search/user_searches_for_code_spec.rb b/spec/features/search/user_searches_for_code_spec.rb index 5a60991c1bf..4ca79ccaea8 100644 --- a/spec/features/search/user_searches_for_code_spec.rb +++ b/spec/features/search/user_searches_for_code_spec.rb @@ -39,17 +39,16 @@ describe 'User searches for code' do context 'when on a project page', :js do before do visit(search_path) - end - - include_examples 'top right search form' - - it 'finds code' do find('.js-search-project-dropdown').click page.within('.project-filter') do click_link(project.full_name) end + end + include_examples 'top right search form' + + it 'finds code' do fill_in('dashboard_search', with: 'rspec') find('.btn-search').click @@ -57,6 +56,27 @@ describe 'User searches for code' do expect(find(:css, '.search-results')).to have_content('Update capybara, rspec-rails, poltergeist to recent versions') end end + + it 'search mutiple words with refs switching' do + expected_result = 'Use `snake_case` for naming files' + search = 'for naming files' + + fill_in('dashboard_search', with: search) + find('.btn-search').click + + page.within('.results') do + expect(find('.search-results')).to have_content(expected_result) + end + + find('.js-project-refs-dropdown').click + find('.dropdown-page-one .dropdown-content').click_link('v1.0.0') + + page.within('.results') do + expect(find(:css, '.search-results')).to have_content(expected_result) + end + + expect(find_field('dashboard_search').value).to eq(search) + end end context 'search code within refs', :js do |