Let user always see his private notes (#17632).

git-svn-id: http://svn.redmine.org/redmine/trunk@16181 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2017-01-14 09:50:28 +00:00
parent 45879a41b2
commit 7b32a0371d
3 changed files with 22 additions and 7 deletions

View File

@@ -1605,6 +1605,20 @@ class IssuesControllerTest < Redmine::ControllerTest
assert_select "#change-#{journal.id}", 0
end
def test_show_should_display_private_notes_created_by_current_user
User.find(3).roles_for_project(Project.find(1)).each do |role|
role.remove_permission! :view_private_notes
end
visible = Journal.create!(:journalized => Issue.find(2), :notes => 'Private notes', :private_notes => true, :user_id => 3)
not_visible = Journal.create!(:journalized => Issue.find(2), :notes => 'Private notes', :private_notes => true, :user_id => 1)
@request.session[:user_id] = 3
get :show, :id => 2
assert_response :success
assert_select "#change-#{visible.id}", 1
assert_select "#change-#{not_visible.id}", 0
end
def test_show_atom
get :show, :id => 2, :format => 'atom'
assert_response :success