summaryrefslogtreecommitdiff
path: root/test/models/node_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/models/node_test.rb')
-rw-r--r--test/models/node_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/models/node_test.rb b/test/models/node_test.rb
index ba38340..0083b08 100644
--- a/test/models/node_test.rb
+++ b/test/models/node_test.rb
@@ -756,6 +756,16 @@ class NodeTest < ActiveSupport::TestCase
756 assert node.valid? 756 assert node.valid?
757 end 757 end
758 758
759 test "trash! records every subtree node as a participant, not just the root" do
760 parent = Node.root.children.create!(:slug => "trash_participants_parent")
761 child = parent.children.create!(:slug => "trash_participants_child")
762
763 parent.trash!(users(:quentin))
764
765 action = parent.node_actions.where(:action => "trash").last
766 assert_includes action.action_participants.map(&:subject), child
767 end
768
759 test "destroying a node with children is refused" do 769 test "destroying a node with children is refused" do
760 parent = Node.root.children.create!(:slug => "destroy_guard_parent") 770 parent = Node.root.children.create!(:slug => "destroy_guard_parent")
761 parent.children.create!(:slug => "destroy_guard_child") 771 parent.children.create!(:slug => "destroy_guard_child")