summaryrefslogtreecommitdiff
path: root/test/models/node_test.rb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-23 03:28:55 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-23 03:28:55 +0200
commitd9e95bdb6436768c738539df74a164c885887174 (patch)
tree47b0c461194f3cc9a3194b570f4e077eeccba011 /test/models/node_test.rb
parentdd40bce5ff080885e017709325fb49e9ccd55655 (diff)
Add action_participants, recording every node a trash/destroy touches
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 ba383405..0083b088 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")