diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2010-05-27 17:16:10 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2010-05-27 17:16:10 +0000 |
commit | f3cc84b3437a1f5c26748f75bb5cc8b8bca2d719 (patch) | |
tree | ab6da5fd236250a913967ff8f443fd3bb48d25f2 /test/unit/project_test.rb | |
parent | e5ac73b7dc80af4c70289cfad13e5e632bb92670 (diff) | |
download | redmine-f3cc84b3437a1f5c26748f75bb5cc8b8bca2d719.tar.gz redmine-f3cc84b3437a1f5c26748f75bb5cc8b8bca2d719.zip |
Show subproject versions on the Roadmap.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3760 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/project_test.rb')
-rw-r--r-- | test/unit/project_test.rb | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb index fc08bb1f7..7870dc2a5 100644 --- a/test/unit/project_test.rb +++ b/test/unit/project_test.rb @@ -360,6 +360,59 @@ class ProjectTest < ActiveSupport::TestCase assert_equal [1,2], parent.rolled_up_trackers.collect(&:id) end + + context "#rolled_up_versions" do + setup do + @project = Project.generate! + @parent_version_1 = Version.generate!(:project => @project) + @parent_version_2 = Version.generate!(:project => @project) + end + + should "include the versions for the current project" do + assert_same_elements [@parent_version_1, @parent_version_2], @project.rolled_up_versions + end + + should "include versions for a subproject" do + @subproject = Project.generate! + @subproject.set_parent!(@project) + @subproject_version = Version.generate!(:project => @subproject) + + assert_same_elements [ + @parent_version_1, + @parent_version_2, + @subproject_version + ], @project.rolled_up_versions + end + + should "include versions for a sub-subproject" do + @subproject = Project.generate! + @subproject.set_parent!(@project) + @sub_subproject = Project.generate! + @sub_subproject.set_parent!(@subproject) + @sub_subproject_version = Version.generate!(:project => @sub_subproject) + + @project.reload + + assert_same_elements [ + @parent_version_1, + @parent_version_2, + @sub_subproject_version + ], @project.rolled_up_versions + end + + + should "only check active projects" do + @subproject = Project.generate! + @subproject.set_parent!(@project) + @subproject_version = Version.generate!(:project => @subproject) + assert @subproject.archive + + @project.reload + + assert !@subproject.active? + assert_same_elements [@parent_version_1, @parent_version_2], @project.rolled_up_versions + end + end def test_shared_versions_none_sharing p = Project.find(5) |