summaryrefslogtreecommitdiffstats
path: root/test/functional/issues_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-08 11:48:36 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-08 11:48:36 +0000
commit2a55d37619719cff870f02a9c771963269b45a93 (patch)
tree29045b35d1b9f4ff01114eade380fd72def73ac5 /test/functional/issues_controller_test.rb
parent121bc44cc504b3086c35d40f984d75d978c59fb0 (diff)
downloadredmine-2a55d37619719cff870f02a9c771963269b45a93.tar.gz
redmine-2a55d37619719cff870f02a9c771963269b45a93.zip
Check project assignment on issue copy/move.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8553 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/issues_controller_test.rb')
-rw-r--r--test/functional/issues_controller_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 5879e666b..c6b96cb3e 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -1630,6 +1630,18 @@ class IssuesControllerTest < ActionController::TestCase
assert_tag 'input', :attributes => {:name => 'copy_from', :value => '1'}
end
+ def test_create_as_copy_on_project_without_permission_should_ignore_target_project
+ @request.session[:user_id] = 2
+ assert !User.find(2).member_of?(Project.find(4))
+
+ assert_difference 'Issue.count' do
+ post :create, :project_id => 1, :copy_from => 1,
+ :issue => {:project_id => '4', :tracker_id => '3', :status_id => '1', :subject => 'Copy'}
+ end
+ issue = Issue.first(:order => 'id DESC')
+ assert_equal 1, issue.project_id
+ end
+
def test_get_edit
@request.session[:user_id] = 2
get :edit, :id => 1