From 603ccfbd5fe96f0b83aaf3d5118aded2a39992fb Mon Sep 17 00:00:00 2001 From: erdgeist Date: Thu, 16 Jul 2026 13:50:15 +0200 Subject: Condense the action log into a scannable table Several minor improvements to the action log presentation: * Now a table with date and human readable presentation as rows is displayed * If no changes in a title were detected, the old version is omitted * The "inferred" flag is demoted to the end of the line * You can zoom in on the node's history directly from a log line * byline for the first publish action is preserved * Revisions are directly linked to when a new one i published --- test/models/node_action_test.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/models/node_action_test.rb') diff --git a/test/models/node_action_test.rb b/test/models/node_action_test.rb index 24d8245..b177cca 100644 --- a/test/models/node_action_test.rb +++ b/test/models/node_action_test.rb @@ -18,6 +18,12 @@ class NodeActionTest < ActiveSupport::TestCase assert_equal({ :title => { "from" => nil, "to" => "Erstausgabe" } }, diff) end + test "first publish carries the byline when the page has one" do + diff = NodeAction.head_diff(nil, build_page(:user => users(:quentin))) + + assert_equal({ "from" => nil, "to" => users(:quentin).login }, diff[:author]) + end + test "title pair is always present, even when unchanged" do diff = NodeAction.head_diff(build_page, build_page) @@ -109,4 +115,14 @@ class NodeActionTest < ActiveSupport::TestCase assert_nil NodeAction.head_diff(old_page, new_page)[:translation_diff] end + + test "record! passes provenance and historical timestamps through" do + long_ago = 2.years.ago + action = NodeAction.record!(:node => nil, :action => "publish", + :occurred_at => long_ago, + :inferred_from => "from_page_revision") + + assert_equal "from_page_revision", action.inferred_from + assert_in_delta long_ago.to_f, action.occurred_at.to_f, 1.0 + end end -- cgit v1.3