From 15aff3eff51809d1ce21caab406a0ef8b13624b6 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sat, 11 Jul 2026 01:33:07 +0200 Subject: Do not offer to destroy the only draft of a never-published node --- test/controllers/nodes_controller_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/controllers/nodes_controller_test.rb b/test/controllers/nodes_controller_test.rb index 37091d5..b563d4d 100644 --- a/test/controllers/nodes_controller_test.rb +++ b/test/controllers/nodes_controller_test.rb @@ -463,4 +463,12 @@ class NodesControllerTest < ActionController::TestCase put :revert, params: { :id => node.id } assert_redirected_to edit_node_path(node) end + + test "nodes#show does not offer to destroy the only draft of a never-published node" do + node = Node.root.children.create!(:slug => "draft_only_test") + login_as :quentin + get :show, params: { :id => node.id } + assert_response :success + assert_select "form.destructive", :count => 0 + end end -- cgit v1.3