diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-03-25 19:32:05 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-03-25 19:32:05 +0000 |
commit | 1294f721755f415b9212fda82e4f40179c0921d4 (patch) | |
tree | 235b41e4eaac806cc1a7b7a3d1e644f1d7b23df4 /test | |
parent | 5663ca89facc10db2b9c665ecda6101ece14ce3e (diff) | |
download | redmine-1294f721755f415b9212fda82e4f40179c0921d4.tar.gz redmine-1294f721755f415b9212fda82e4f40179c0921d4.zip |
Fixed that issues can be moved to projects with issue tracking disabled (#10467).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9267 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/issue_test.rb | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb index bd54de705..ddebbee19 100644 --- a/test/unit/issue_test.rb +++ b/test/unit/issue_test.rb @@ -530,6 +530,15 @@ class IssueTest < ActiveSupport::TestCase assert issue.save end + def test_allowed_target_projects_on_move_should_include_projects_with_issue_tracking_enabled + assert_include Project.find(2), Issue.allowed_target_projects_on_move(User.find(2)) + end + + def test_allowed_target_projects_on_move_should_not_include_projects_with_issue_tracking_disabled + Project.find(2).disable_module! :issue_tracking + assert_not_include Project.find(2), Issue.allowed_target_projects_on_move(User.find(2)) + end + def test_move_to_another_project_with_same_category issue = Issue.find(1) issue.project = Project.find(2) @@ -1172,22 +1181,6 @@ class IssueTest < ActiveSupport::TestCase assert_equal 2, groups.inject(0) {|sum, group| sum + group['total'].to_i} end - context ".allowed_target_projects_on_move" do - should "return all active projects for admin users" do - User.current = User.find(1) - assert_equal Project.active.count, Issue.allowed_target_projects_on_move.size - end - - should "return allowed projects for non admin users" do - User.current = User.find(2) - Role.non_member.remove_permission! :move_issues - assert_equal 3, Issue.allowed_target_projects_on_move.size - - Role.non_member.add_permission! :move_issues - assert_equal Project.active.count, Issue.allowed_target_projects_on_move.size - end - end - def test_recently_updated_with_limit_scopes #should return the last updated issue assert_equal 1, Issue.recently_updated.with_limit(1).length |