summaryrefslogtreecommitdiffstats
path: root/test/functional/issues_controller_test.rb
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2021-07-26 20:20:41 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2021-07-26 20:20:41 +0000
commit3ebe6a8b0a1cd1ba32b7ffa934d20c9d24fdd9c3 (patch)
treea33bfa12910c18a75323c69f12a21f2f04aeb283 /test/functional/issues_controller_test.rb
parent985450347e32e43c2656683eaa79d6c18e3019b3 (diff)
downloadredmine-3ebe6a8b0a1cd1ba32b7ffa934d20c9d24fdd9c3.tar.gz
redmine-3ebe6a8b0a1cd1ba32b7ffa934d20c9d24fdd9c3.zip
When updating an issue, allow adding time entry on an issue that was visible for the previous assignee (#34856).
git-svn-id: http://svn.redmine.org/redmine/trunk@21081 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/issues_controller_test.rb')
-rw-r--r--test/functional/issues_controller_test.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index b8e185a28..b2ca3ed0c 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -6510,6 +6510,29 @@ class IssuesControllerTest < Redmine::ControllerTest
assert_select 'input[name=?][value=?]', 'time_entry[comments]', 'this is my comment'
end
+ def test_put_with_spent_time_when_assigned_to_of_private_issue_is_update_at_the_same_time
+ @request.session[:user_id] = 3
+ Role.find(2).update! :issues_visibility => 'own'
+ private_issue = Issue.find(3)
+
+ assert_difference('TimeEntry.count', 1) do
+ put(
+ :update,
+ params: {
+ id: private_issue.id,
+ issue: { assigned_to_id: nil },
+ time_entry: {
+ comments: "add spent time", activity_id: TimeEntryActivity.first.id, hours: 1
+ }
+ }
+ )
+ end
+ assert_select '#errorExplanation', {text: /Log time is invalid/, count: 0}
+ assert_select '#errorExplanation', {text: /Issue is invalid/, count: 0}
+ assert_redirected_to action: 'show', id: private_issue.id
+ assert_not private_issue.reload.visible?
+ end
+
def test_put_update_should_allow_fixed_version_to_be_set_to_a_subproject
issue = Issue.find(2)
@request.session[:user_id] = 2