From 20c735b0c5a2db9b8984848253ad99332d6211a8 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sun, 9 Aug 2026 03:33:55 +0200 Subject: Attach assets to the draft instead of to every lifecycle row Node#attach_asset! writes to the node's draft alone, creating one from the head when none is pending. It refuses when another user holds the lock, and when an autosave already exists The asset_attach verb goes with it. create_new_draft names the editor on the draft it creates and the publish entry's asset delta reports the attachment. --- test/controllers/content_controller_test.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/controllers/content_controller_test.rb') diff --git a/test/controllers/content_controller_test.rb b/test/controllers/content_controller_test.rb index 39fe276b..482c1ddf 100644 --- a/test/controllers/content_controller_test.rb +++ b/test/controllers/content_controller_test.rb @@ -170,6 +170,8 @@ class ContentControllerTest < ActionController::TestCase :upload_content_type => "image/png", :upload_updated_at => Time.at(1_700_000_000)) node.attach_asset!(asset, :user => @user1, :headline => true) + node.publish_draft! + node.reload # has_variant? only tests File.exist?, so touching the path is enough # and no ImageMagick runs in the suite. image/png takes .jpg for the -- cgit v1.3