diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-23 12:24:52 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-23 12:24:52 +0200 |
| commit | 932d4a4be40587fa6d489eca16a1ef6d6f2936d1 (patch) | |
| tree | a7512889db54347845ce8f72e5a2155d917b4500 /test/controllers/assets_controller_test.rb | |
| parent | 6ef98ad444631b1d5ba67bb16aaaa2afdfa53ae0 (diff) | |
Witness asset uploads and out-of-band attaches in the action log
Diffstat (limited to 'test/controllers/assets_controller_test.rb')
| -rw-r--r-- | test/controllers/assets_controller_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
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 | |||
| 133 | assert_equal node_path(node), flash[:headline_kept_path] | 133 | assert_equal node_path(node), flash[:headline_kept_path] |
| 134 | end | 134 | end |
| 135 | 135 | ||
| 136 | test "create with node_id writes an asset_create and an asset_attach entry" do | ||
| 137 | node = Node.root.children.create!(:slug => "asset_log_pair") | ||
| 138 | assert_difference 'NodeAction.where(:action => "asset_create").count' do | ||
| 139 | assert_difference 'NodeAction.where(:action => "asset_attach").count' do | ||
| 140 | post :create, params: { asset: { name: 'Logged twice' }, node_id: node.id } | ||
| 141 | end | ||
| 142 | end | ||
| 143 | assert_equal users(:quentin), NodeAction.last.user | ||
| 144 | end | ||
| 145 | |||
| 136 | # --- edit --- | 146 | # --- edit --- |
| 137 | 147 | ||
| 138 | test "get edit" do | 148 | test "get edit" do |
