def test_rolled_up_trackers
parent = Project.find(1)
- parent.trackers = Tracker.find([1,2])
+ parent.trackers = Tracker.find([1, 2])
child = parent.children.find(3)
- child.trackers = Tracker.find([2,3])
+ child.trackers = Tracker.find([2, 3])
assert_equal [1, 2], parent.tracker_ids
assert_equal [2, 3], child.trackers.collect(&:id)
def test_rolled_up_trackers_should_ignore_archived_subprojects
parent = Project.find(1)
- parent.trackers = Tracker.find([1,2])
+ parent.trackers = Tracker.find([1, 2])
child = parent.children.find(3)
- child.trackers = Tracker.find([1,3])
+ child.trackers = Tracker.find([1, 3])
parent.children.each(&:archive)
- assert_equal [1,2], parent.rolled_up_trackers.collect(&:id)
+ assert_equal [1, 2], parent.rolled_up_trackers.collect(&:id)
end
def test_rolled_up_statuses
child = parent.children.find(3)
private_child = parent.children.find(5)
- assert_equal [1,2,3], parent.version_ids.sort
+ assert_equal [1, 2, 3], parent.version_ids.sort
assert_equal [4], child.version_ids
assert_equal [6], private_child.version_ids
assert_equal [7], Version.where(:sharing => 'system').collect(&:id)
assert_kind_of Version, version
end
- assert_equal [1,2,3,4,6,7], parent.shared_versions.collect(&:id).sort
+ assert_equal [1, 2, 3, 4, 6, 7], parent.shared_versions.collect(&:id).sort
end
def test_shared_versions_should_ignore_archived_subprojects
child.archive
parent.reload
- assert_equal [1,2,3], parent.version_ids.sort
+ assert_equal [1, 2, 3], parent.version_ids.sort
assert_equal [4], child.version_ids
assert !parent.shared_versions.collect(&:id).include?(4)
end
parent = Project.find(1)
child = parent.children.find(5)
- assert_equal [1,2,3], parent.version_ids.sort
+ assert_equal [1, 2, 3], parent.version_ids.sort
assert_equal [6], child.version_ids
versions = parent.shared_versions.visible(user)