Created
July 29, 2008 19:47
-
-
Save bkeepers/3157 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_invalidate_tree | |
r1 = Category.create | |
r2 = Category.create | |
r3 = Category.create | |
r4 = Category.create | |
nodes = [r1, r2, r3, r4] | |
r2.move_to_child_of(r1) | |
nodes.each(&:reload) | |
assert Category.valid? | |
r3.move_to_child_of(r1) | |
nodes.each(&:reload) | |
assert Category.valid? | |
r4.move_to_child_of(r2) | |
nodes.each(&:reload) | |
assert Category.valid? | |
puts r1.children.inspect | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment