summaryrefslogtreecommitdiff
path: root/test/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'test/controllers')
-rw-r--r--test/controllers/assets_controller_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/controllers/assets_controller_test.rb b/test/controllers/assets_controller_test.rb
index 05fc6ded..0e251aad 100644
--- a/test/controllers/assets_controller_test.rb
+++ b/test/controllers/assets_controller_test.rb
@@ -182,6 +182,16 @@ class AssetsControllerTest < ActionController::TestCase
182 assert !Dir.exist?(upload_dir), "Upload directory should be removed after destroy" 182 assert !Dir.exist?(upload_dir), "Upload directory should be removed after destroy"
183 end 183 end
184 184
185 test "destroy is witnessed in the action log with the current user" do
186 asset = Asset.create!(:name => 'Witness me',
187 :upload_file_name => 'w.png',
188 :upload_content_type => 'image/png')
189 assert_difference 'NodeAction.where(:action => "asset_destroy").count' do
190 delete :destroy, params: { id: asset.id }
191 end
192 assert_equal users(:quentin), NodeAction.last.user
193 end
194
185 # --- URL helpers --- 195 # --- URL helpers ---
186 196
187 test "upload url returns correct path for original" do 197 test "upload url returns correct path for original" do