summaryrefslogtreecommitdiff
path: root/test/models/node_action_test.rb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-23 17:49:18 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-23 17:49:18 +0200
commitf993853db3e233f05a55de5ba2a87b77acf041aa (patch)
tree0a28289ff471ab5853b22c2a68ed21ce4e0eb4ac /test/models/node_action_test.rb
parent932d4a4be40587fa6d489eca16a1ef6d6f2936d1 (diff)
Record asset deltas at publish, with changed assets as participants
Diffstat (limited to 'test/models/node_action_test.rb')
-rw-r--r--test/models/node_action_test.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/models/node_action_test.rb b/test/models/node_action_test.rb
index 849b36f4..4672456a 100644
--- a/test/models/node_action_test.rb
+++ b/test/models/node_action_test.rb
@@ -59,7 +59,7 @@ class NodeActionTest < ActiveSupport::TestCase
59 assert_nil NodeAction.head_diff(old_page, build_page(:template_name => "standard_template"))[:template_changed] 59 assert_nil NodeAction.head_diff(old_page, build_page(:template_name => "standard_template"))[:template_changed]
60 end 60 end
61 61
62 test "assets_changed flag when the attached set differs" do 62 test "asset delta when the attached set differs" do
63 asset = Asset.create!(:name => "diff probe", 63 asset = Asset.create!(:name => "diff probe",
64 :upload_file_name => "test_image.png", 64 :upload_file_name => "test_image.png",
65 :upload_content_type => "image/png", 65 :upload_content_type => "image/png",
@@ -68,10 +68,9 @@ class NodeActionTest < ActiveSupport::TestCase
68 old_page, new_page = build_page, build_page 68 old_page, new_page = build_page, build_page
69 new_page.related_assets.create!(:asset_id => asset.id, :position => 1) 69 new_page.related_assets.create!(:asset_id => asset.id, :position => 1)
70 70
71 71 diff = NodeAction.head_diff(old_page, new_page)
72 diff = NodeAction.head_diff(old_page, new_page.reload) 72 assert diff[:assets].present?
73 assert diff[:assets_changed] 73 assert_nil NodeAction.head_diff(old_page, old_page)[:assets]
74 assert_nil NodeAction.head_diff(old_page, old_page)[:assets_changed]
75 end 74 end
76 75
77 test "default-locale abstract and body changes become flags, only when true" do 76 test "default-locale abstract and body changes become flags, only when true" do