views:

126

answers:

1

How could i test a model that acts_as_tree in a unit test ?

A: 

You could initialize it with some random values and see if traversing it in several different ways (such as preorder, postorder, inorder and level order) produces the same result.

Serhat Özgel