mirror of
https://github.com/redmine/redmine.git
synced 2026-03-31 17:50:57 +02:00
Merged r22066 from trunk to 4.2-stable (#38063).
git-svn-id: https://svn.redmine.org/redmine/branches/4.2-stable@22068 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user