summaryrefslogtreecommitdiffstats
path: root/test/functional/search_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-12-05 08:48:29 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-12-05 08:48:29 +0000
commit8323bc98f5a9ffe9cb14bd0e262d4d06e30db146 (patch)
tree608ec9aac934ca27c493228919750f3c54a85743 /test/functional/search_controller_test.rb
parent56edfcf6e92c4eb19f2654fb17b44b0c4ae50c21 (diff)
downloadredmine-8323bc98f5a9ffe9cb14bd0e262d4d06e30db146.tar.gz
redmine-8323bc98f5a9ffe9cb14bd0e262d4d06e30db146.zip
Adds tests for searching private or archived projects.
git-svn-id: http://svn.redmine.org/redmine/trunk@13710 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/search_controller_test.rb')
-rw-r--r--test/functional/search_controller_test.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/functional/search_controller_test.rb b/test/functional/search_controller_test.rb
index baf37deee..4124985db 100644
--- a/test/functional/search_controller_test.rb
+++ b/test/functional/search_controller_test.rb
@@ -39,6 +39,29 @@ class SearchControllerTest < ActionController::TestCase
assert assigns(:results).include?(Project.find(1))
end
+ def test_search_on_archived_project_should_return_404
+ Project.find(3).archive
+ get :index, :id => 3
+ assert_response 404
+ end
+
+ def test_search_on_invisible_project_by_user_should_be_denied
+ @request.session[:user_id] = 7
+ get :index, :id => 2
+ assert_response 403
+ end
+
+ def test_search_on_invisible_project_by_anonymous_user_should_redirect
+ get :index, :id => 2
+ assert_response 302
+ end
+
+ def test_search_on_private_project_by_member_should_succeed
+ @request.session[:user_id] = 2
+ get :index, :id => 2
+ assert_response :success
+ end
+
def test_search_all_projects
with_settings :default_language => 'en' do
get :index, :q => 'recipe subproject commit', :all_words => ''