summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2018-12-06 23:21:53 +0000
committerGo MAEDA <maeda@farend.jp>2018-12-06 23:21:53 +0000
commitc10df9f26667614c636c9d6ec98c5d1b3f233be6 (patch)
tree72c9abc31dfe99dcc74c4037248e564d08e6ed1f /test
parent1d5fd81871f2035dc0721ebbcdbd6da16e39bd5a (diff)
downloadredmine-c10df9f26667614c636c9d6ec98c5d1b3f233be6.tar.gz
redmine-c10df9f26667614c636c9d6ec98c5d1b3f233be6.zip
Include closed projects in search for scope subprojects (#28636).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@17692 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/search_controller_test.rb40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/functional/search_controller_test.rb b/test/functional/search_controller_test.rb
index aace89a81..f5b52b2b4 100644
--- a/test/functional/search_controller_test.rb
+++ b/test/functional/search_controller_test.rb
@@ -338,6 +338,46 @@ class SearchControllerTest < Redmine::ControllerTest
assert_response 404
end
+ def test_search_should_include_closed_projects
+ @request.session[:user_id] = 1
+
+ project = Project.find(5)
+ project.close
+ project.save
+
+ # scope all
+ get :index, :params => {:q => 'Issue of a private subproject', :scope => 'all'}
+ assert_response :success
+
+ assert_select '#search-results' do
+ assert_select 'dt.issue', :text => /Bug #6/
+ end
+
+ # scope my_projects
+ get :index, :params => {:q => 'Issue of a private subproject', :scope => 'my_projects'}
+ assert_response :success
+
+ assert_select '#search-results' do
+ assert_select 'dt.issue', :text => /Bug #6/
+ end
+
+ # scope subprojects
+ get :index, :params => {:id => 1, :q => 'Issue of a private subproject', :scope => 'subprojects'}
+ assert_response :success
+
+ assert_select '#search-results' do
+ assert_select 'dt.issue', :text => /Bug #6/
+ end
+
+ # scope project
+ get :index, :params => {:id => 5, :q => 'Issue of a private subproject'}
+ assert_response :success
+
+ assert_select '#search-results' do
+ assert_select 'dt.issue', :text => /Bug #6/
+ end
+ end
+
def test_quick_jump_to_issue
# issue of a public project
get :index, :params => {:q => "3"}