Adds a permission to log time for another user (#3848).

Patch by Marius BALTEANU.

git-svn-id: http://svn.redmine.org/redmine/trunk@17755 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2018-12-16 16:28:22 +00:00
parent 537f162f27
commit 2fdbcd35dd
14 changed files with 214 additions and 22 deletions

View File

@@ -143,8 +143,8 @@ class ProjectEnumerationsControllerTest < Redmine::ControllerTest
:enumerations => {
"9"=> {
"parent_id"=>"9", "custom_field_values"=> {
"7" => "1"}, "active"=>"0"} # Design, De-activate
"7" => "1"}, "active"=>"0"} # Design, De-activate
}
}
assert_response :redirect
@@ -163,10 +163,11 @@ class ProjectEnumerationsControllerTest < Redmine::ControllerTest
# TODO: Need to cause an exception on create but these tests
# aren't setup for mocking. Just create a record now so the
# second one is a dupicate
user = User.find(1)
parent = TimeEntryActivity.find(9)
TimeEntryActivity.create!({:name => parent.name, :project_id => 1,
:position => parent.position, :active => true, :parent_id => 9})
TimeEntry.create!({:project_id => 1, :hours => 1.0, :user => User.find(1),
TimeEntry.create!({:project_id => 1, :hours => 1.0, :user => user, :author => user,
:issue_id => 3, :activity_id => 10, :spent_on => '2009-01-01'})
assert_equal 3, TimeEntry.where(:activity_id => 9, :project_id => 1).count
assert_equal 1, TimeEntry.where(:activity_id => 10, :project_id => 1).count