From 113449eacba67625004b14081f4cc0cc3b984553 Mon Sep 17 00:00:00 2001 From: hukl Date: Mon, 2 Mar 2009 17:22:48 +0100 Subject: added unlock functionality. not yet hooked up with permissions though. anybody can unlock. put a confirmation in front of it. destroy has to be confirmed as well --- test/functional/nodes_controller_test.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test/functional') diff --git a/test/functional/nodes_controller_test.rb b/test/functional/nodes_controller_test.rb index ed8afd8..afe7576 100644 --- a/test/functional/nodes_controller_test.rb +++ b/test/functional/nodes_controller_test.rb @@ -22,6 +22,28 @@ class NodesControllerTest < ActionController::TestCase assert_redirected_to node_path(Node.last) end + def test_editing_a_node + login_as :quentin + + node = Node.find_by_unique_name("fourth_child") + + assert_equal 1, node.pages.length + + draft = node.find_or_create_draft( User.first ) + draft.title = "Hello" + draft.body = "World" + draft.save + node.publish_draft! + + get :edit, :id => node.id + assert_response :success + + node.reload + assert_equal 2, node.pages.length + assert_equal "Hello", node.find_or_create_draft( User.first ).title + assert_equal "World", node.find_or_create_draft( User.first ).body + end + def test_update_a_draft test_node = Node.create! :slug => "test_node" test_node.move_to_child_of Node.root -- cgit v1.3