summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-01-20 03:31:41 +0000
committerGo MAEDA <maeda@farend.jp>2023-01-20 03:31:41 +0000
commit9d65eee4248acef921d102f1e614618514afcd51 (patch)
tree46bb18bdb4bcb47f399b9c27019e2fa46e6b33fa /test/functional
parent21eef7e65c5972cd65c183bf17e261fa67e34867 (diff)
downloadredmine-9d65eee4248acef921d102f1e614618514afcd51.tar.gz
redmine-9d65eee4248acef921d102f1e614618514afcd51.zip
Avoid double-render error with ApplicationController#find_optional_project (#38063).
Patch by Holger Just. git-svn-id: https://svn.redmine.org/redmine/trunk@22066 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/news_controller_test.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/functional/news_controller_test.rb b/test/functional/news_controller_test.rb
index ffa439073..d21835656 100644
--- a/test/functional/news_controller_test.rb
+++ b/test/functional/news_controller_test.rb
@@ -40,11 +40,21 @@ class NewsControllerTest < Redmine::ControllerTest
assert_select 'h3 a', :text => 'eCookbook first release !'
end
- def test_index_with_invalid_project_should_respond_with_404
+ def test_index_with_invalid_project_should_respond_with_404_for_logged_users
+ @request.session[:user_id] = 2
+
get(:index, :params => {:project_id => 999})
assert_response 404
end
+ def test_index_with_invalid_project_should_respond_with_302_for_anonymous
+ Role.anonymous.remove_permission! :view_news
+ with_settings :login_required => '0' do
+ get(:index, :params => {:project_id => 999})
+ assert_response 302
+ end
+ end
+
def test_index_without_permission_should_fail
Role.all.each {|r| r.remove_permission! :view_news}
@request.session[:user_id] = 2