summaryrefslogtreecommitdiff
path: root/test/controllers/assets_controller_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/controllers/assets_controller_test.rb')
-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 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