-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
node.ancestors.count should return 0 if the parent_id is null.
Here's an example of what we get now:
it "has the correct tree after subchildren are added" do tree = Node.roots.first.self_and_descendents tree.each do |node| if node.parent_id.nil? expect(node.ancestors.count).to eq(0) end end
Gives us:
Failures:
1) Treeify Modifying the tree has the correct tree after subchildren are added
Failure/Error: expect(node.ancestors.count).to eq(0)
expected: 0
got: 53
(compared using ==)
# ./spec/treeify_spec.rb:104:in `block (4 levels) in <top (required)>'
# ./spec/treeify_spec.rb:102:in `each'
# ./spec/treeify_spec.rb:102:in `block (3 levels) in <top (required)>'
Reactions are currently unavailable