summaryrefslogtreecommitdiff
path: root/test/controllers/nodes_controller_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/controllers/nodes_controller_test.rb')
-rw-r--r--test/controllers/nodes_controller_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/controllers/nodes_controller_test.rb b/test/controllers/nodes_controller_test.rb
index 9da9514..5b66bd3 100644
--- a/test/controllers/nodes_controller_test.rb
+++ b/test/controllers/nodes_controller_test.rb
@@ -647,4 +647,19 @@ class NodesControllerTest < ActionController::TestCase
647 assert_select ".sitemap_node_actions", :text => /Create Child/ 647 assert_select ".sitemap_node_actions", :text => /Create Child/
648 assert_select ".sitemap_node_actions", :text => /Revisions/, :count => 0 648 assert_select ".sitemap_node_actions", :text => /Revisions/, :count => 0
649 end 649 end
650
651 test "create logs a create NodeAction with path and title" do
652 login_as :quentin
653
654 assert_difference "NodeAction.count" do
655 post :create, params: { :kind => "generic", :title => "Brand New", :parent_id => Node.root.id }
656 end
657
658 action = NodeAction.last
659 assert_equal "create", action.action
660 assert_equal users(:quentin), action.user
661 assert_equal Node.last, action.node
662 assert_equal "Brand New", action.metadata["title"]
663 assert_equal Node.last.unique_name, action.metadata["path"]
664 end
650end 665end