From d9e95bdb6436768c738539df74a164c885887174 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Thu, 23 Jul 2026 03:28:55 +0200 Subject: Add action_participants, recording every node a trash/destroy touches --- test/models/node_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/models/node_test.rb') diff --git a/test/models/node_test.rb b/test/models/node_test.rb index ba383405..0083b088 100644 --- a/test/models/node_test.rb +++ b/test/models/node_test.rb @@ -756,6 +756,16 @@ class NodeTest < ActiveSupport::TestCase assert node.valid? end + test "trash! records every subtree node as a participant, not just the root" do + parent = Node.root.children.create!(:slug => "trash_participants_parent") + child = parent.children.create!(:slug => "trash_participants_child") + + parent.trash!(users(:quentin)) + + action = parent.node_actions.where(:action => "trash").last + assert_includes action.action_participants.map(&:subject), child + end + test "destroying a node with children is refused" do parent = Node.root.children.create!(:slug => "destroy_guard_parent") parent.children.create!(:slug => "destroy_guard_child") -- cgit v1.3