##// END OF EJS Templates
remove trailing white-spaces from test/unit/project_nested_set_test.rb....
Toshi MARUYAMA -
r6651:616268855697
parent child
Show More
@@ -1,16 +1,16
1 1 # Redmine - project management software
2 # Copyright (C) 2006-2010 Jean-Philippe Lang
2 # Copyright (C) 2006-2011 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 #
8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 #
13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -18,7 +18,7
18 18 require File.expand_path('../../test_helper', __FILE__)
19 19
20 20 class ProjectNestedSetTest < ActiveSupport::TestCase
21
21
22 22 context "nested set" do
23 23 setup do
24 24 Project.delete_all
@@ -28,7 +28,7 class ProjectNestedSetTest < ActiveSupport::TestCase
28 28 @a1.set_parent!(@a)
29 29 @a2 = Project.create!(:name => 'Project A2', :identifier => 'projecta2')
30 30 @a2.set_parent!(@a)
31
31
32 32 @b = Project.create!(:name => 'Project B', :identifier => 'projectb')
33 33 @b1 = Project.create!(:name => 'Project B1', :identifier => 'projectb1')
34 34 @b1.set_parent!(@b)
@@ -36,14 +36,14 class ProjectNestedSetTest < ActiveSupport::TestCase
36 36 @b11.set_parent!(@b1)
37 37 @b2 = Project.create!(:name => 'Project B2', :identifier => 'projectb2')
38 38 @b2.set_parent!(@b)
39
39
40 40 @c = Project.create!(:name => 'Project C', :identifier => 'projectc')
41 41 @c1 = Project.create!(:name => 'Project C1', :identifier => 'projectc1')
42 42 @c1.set_parent!(@c)
43
43
44 44 [@a, @a1, @a2, @b, @b1, @b11, @b2, @c, @c1].each(&:reload)
45 45 end
46
46
47 47 context "#create" do
48 48 should "build valid tree" do
49 49 assert_nested_set_values({
@@ -59,7 +59,7 class ProjectNestedSetTest < ActiveSupport::TestCase
59 59 })
60 60 end
61 61 end
62
62
63 63 context "#set_parent!" do
64 64 should "keep valid tree" do
65 65 assert_no_difference 'Project.count' do
@@ -75,7 +75,7 class ProjectNestedSetTest < ActiveSupport::TestCase
75 75 })
76 76 end
77 77 end
78
78
79 79 context "#destroy" do
80 80 context "a root with children" do
81 81 should "not mess up the tree" do
@@ -91,7 +91,7 class ProjectNestedSetTest < ActiveSupport::TestCase
91 91 })
92 92 end
93 93 end
94
94
95 95 context "a child with children" do
96 96 should "not mess up the tree" do
97 97 assert_difference 'Project.count', -2 do
@@ -107,7 +107,7 class ProjectNestedSetTest < ActiveSupport::TestCase
107 107 end
108 108 end
109 109 end
110
110
111 111 def assert_nested_set_values(h)
112 112 assert Project.valid?
113 113 h.each do |project, expected|
General Comments 0
You need to be logged in to leave comments. Login now