diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-11-23 17:39:38 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-11-23 17:39:38 +0000 |
commit | 13f5301c097fab6b6865c739cfb4843cf7886c8a (patch) | |
tree | 9a69f25f91adf35c3ea94131e3046cea204a96da /test | |
parent | be7895e04ec08afbb5f68e5f828ae729f0902bff (diff) | |
download | redmine-13f5301c097fab6b6865c739cfb4843cf7886c8a.tar.gz redmine-13f5301c097fab6b6865c739cfb4843cf7886c8a.zip |
Fixed that Project.rebuild! sorts projects by id instead of name (#12431).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10866 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/project_nested_set_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/unit/project_nested_set_test.rb b/test/unit/project_nested_set_test.rb index 6f6aa1707..3bd37609b 100644 --- a/test/unit/project_nested_set_test.rb +++ b/test/unit/project_nested_set_test.rb @@ -47,6 +47,13 @@ class ProjectNestedSetTest < ActiveSupport::TestCase assert_valid_nested_set end + def test_rebuild_should_build_valid_tree + Project.update_all "lft = NULL, rgt = NULL" + + Project.rebuild! + assert_valid_nested_set + end + def test_moving_a_child_to_a_different_parent_should_keep_valid_tree assert_no_difference 'Project.count' do Project.find_by_name('B1').set_parent!(Project.find_by_name('A2')) |