summaryrefslogtreecommitdiff
path: root/test/models
diff options
context:
space:
mode:
Diffstat (limited to 'test/models')
-rw-r--r--test/models/helpers/node_actions_helper_test.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/models/helpers/node_actions_helper_test.rb b/test/models/helpers/node_actions_helper_test.rb
index 16c833b..ef6035d 100644
--- a/test/models/helpers/node_actions_helper_test.rb
+++ b/test/models/helpers/node_actions_helper_test.rb
@@ -114,4 +114,23 @@ class NodeActionsHelperTest < ActionView::TestCase
114 assert_includes action_summary(restore), "club/new" 114 assert_includes action_summary(restore), "club/new"
115 assert_includes action_summary(doomed), "trash/old" 115 assert_includes action_summary(doomed), "trash/old"
116 end 116 end
117
118 test "revision lifecycle badges cover create, publish, rollback, and inference" do
119 created = entry("create", { "title" => "x", "path" => "a/b" })
120 published = entry("publish", { "via" => "draft", "title" => { "from" => nil, "to" => "x" } })
121 restored = entry("publish", { "via" => "revision", "title" => { "from" => "y", "to" => "x" } })
122 restored.update!(:inferred_from => "from_page_revision")
123
124 out = revision_lifecycle_badges([created, published, restored])
125
126 assert_includes out, "created"
127 assert_includes out, "published"
128 assert_includes out, "restored"
129 assert_includes out, "quentin"
130 assert_includes out, "node_action_inferred"
131 assert_includes out, "<span"
132 assert_not_includes out, "&lt;span"
133
134 assert_equal "", revision_lifecycle_badges(nil)
135 end
117end 136end