diff options
author | Go MAEDA <maeda@farend.jp> | 2019-03-25 01:57:20 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2019-03-25 01:57:20 +0000 |
commit | 391c069d87588dfccda7b308c1a4c808611a3b65 (patch) | |
tree | 559afeaaa16e2f4e7d71d4b6a66183d70cf1d86d /test | |
parent | 292f5ac97f68ebeb58741215e520d810949bcc39 (diff) | |
download | redmine-391c069d87588dfccda7b308c1a4c808611a3b65.tar.gz redmine-391c069d87588dfccda7b308c1a4c808611a3b65.zip |
Project search should select subprojects scope when the project has subprojects (#30923).
Patch by Marius BALTEANU.
git-svn-id: http://svn.redmine.org/redmine/trunk@18005 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/projects_controller_test.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index 129dc44c0..e1a17059b 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -1044,4 +1044,35 @@ class ProjectsControllerTest < Redmine::ControllerTest } assert_select 'body.project-ecookbook' end + + def test_default_search_scope_in_global_page + get :index + + assert_select 'div#quick-search form' do + assert_select 'input[name=scope][type=hidden]' + assert_select 'a[href=?]', '/search' + end + end + + def test_default_search_scope_for_project_without_subprojects + get :show, :params => { + :id => 4, + } + + assert_select 'div#quick-search form' do + assert_select 'input[name=scope][type=hidden]' + assert_select 'a[href=?]', '/projects/subproject2/search' + end + end + + def test_default_search_scope_for_project_with_subprojects + get :show, :params => { + :id => 1, + } + + assert_select 'div#quick-search form' do + assert_select 'input[name=scope][type=hidden][value=subprojects]' + assert_select 'a[href=?]', '/projects/ecookbook/search?scope=subprojects' + end + end end |