summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-06-06 20:54:14 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-06-06 20:54:14 +0000
commitb02b7369a0e29307bdd2fb820c0a532265a60653 (patch)
treeada03274056b587ea027e7c015103c123b877f2a /test/functional
parentc07a140f6164cc110796450b52c7db4e8338ec1c (diff)
downloadredmine-b02b7369a0e29307bdd2fb820c0a532265a60653.tar.gz
redmine-b02b7369a0e29307bdd2fb820c0a532265a60653.zip
Merged r16569 (#25791).
git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@16616 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/issues_controller_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 181bd86e3..8efe7e7b6 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -3081,6 +3081,22 @@ class IssuesControllerTest < ActionController::TestCase
assert_equal 1, issue.status_id
end
+ def test_create_as_copy_should_fail_without_add_issue_permission_on_original_tracker
+ role = Role.find(2)
+ role.set_permission_trackers :add_issues, [1, 3]
+ role.save!
+ Role.non_member.remove_permission! :add_issues
+
+ issue = Issue.generate!(:project_id => 1, :tracker_id => 2)
+ @request.session[:user_id] = 3
+
+ assert_no_difference 'Issue.count' do
+ post :create, :project_id => 1, :copy_from => issue.id,
+ :issue => {:project_id => '1'}
+ end
+ assert_select_error 'Tracker is invalid'
+ end
+
def test_create_as_copy_should_copy_attachments
@request.session[:user_id] = 2
issue = Issue.find(3)