From 932d4a4be40587fa6d489eca16a1ef6d6f2936d1 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Thu, 23 Jul 2026 12:24:52 +0200 Subject: Witness asset uploads and out-of-band attaches in the action log --- test/controllers/assets_controller_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/controllers') diff --git a/test/controllers/assets_controller_test.rb b/test/controllers/assets_controller_test.rb index 0e251aad..4be2e8a1 100644 --- a/test/controllers/assets_controller_test.rb +++ b/test/controllers/assets_controller_test.rb @@ -133,6 +133,16 @@ class AssetsControllerTest < ActionController::TestCase assert_equal node_path(node), flash[:headline_kept_path] end + test "create with node_id writes an asset_create and an asset_attach entry" do + node = Node.root.children.create!(:slug => "asset_log_pair") + assert_difference 'NodeAction.where(:action => "asset_create").count' do + assert_difference 'NodeAction.where(:action => "asset_attach").count' do + post :create, params: { asset: { name: 'Logged twice' }, node_id: node.id } + end + end + assert_equal users(:quentin), NodeAction.last.user + end + # --- edit --- test "get edit" do -- cgit v1.3