@@ -39,6 +39,29 class SearchControllerTest < ActionController::TestCase | |||||
39 | assert assigns(:results).include?(Project.find(1)) |
|
39 | assert assigns(:results).include?(Project.find(1)) | |
40 | end |
|
40 | end | |
41 |
|
41 | |||
|
42 | def test_search_on_archived_project_should_return_404 | |||
|
43 | Project.find(3).archive | |||
|
44 | get :index, :id => 3 | |||
|
45 | assert_response 404 | |||
|
46 | end | |||
|
47 | ||||
|
48 | def test_search_on_invisible_project_by_user_should_be_denied | |||
|
49 | @request.session[:user_id] = 7 | |||
|
50 | get :index, :id => 2 | |||
|
51 | assert_response 403 | |||
|
52 | end | |||
|
53 | ||||
|
54 | def test_search_on_invisible_project_by_anonymous_user_should_redirect | |||
|
55 | get :index, :id => 2 | |||
|
56 | assert_response 302 | |||
|
57 | end | |||
|
58 | ||||
|
59 | def test_search_on_private_project_by_member_should_succeed | |||
|
60 | @request.session[:user_id] = 2 | |||
|
61 | get :index, :id => 2 | |||
|
62 | assert_response :success | |||
|
63 | end | |||
|
64 | ||||
42 | def test_search_all_projects |
|
65 | def test_search_all_projects | |
43 | with_settings :default_language => 'en' do |
|
66 | with_settings :default_language => 'en' do | |
44 | get :index, :q => 'recipe subproject commit', :all_words => '' |
|
67 | get :index, :q => 'recipe subproject commit', :all_words => '' |
General Comments 0
You need to be logged in to leave comments.
Login now