summaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-03-02 17:22:48 +0100
committerhukl <contact@smyck.org>2009-03-02 17:22:48 +0100
commit113449eacba67625004b14081f4cc0cc3b984553 (patch)
tree1114418aa27ffc3f815a05caba16c4d80395163f /test/functional
parentddc961fd81b37b44078fba35f0769b661e1e81ce (diff)
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
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/nodes_controller_test.rb22
1 files changed, 22 insertions, 0 deletions
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
22 assert_redirected_to node_path(Node.last) 22 assert_redirected_to node_path(Node.last)
23 end 23 end
24 24
25 def test_editing_a_node
26 login_as :quentin
27
28 node = Node.find_by_unique_name("fourth_child")
29
30 assert_equal 1, node.pages.length
31
32 draft = node.find_or_create_draft( User.first )
33 draft.title = "Hello"
34 draft.body = "World"
35 draft.save
36 node.publish_draft!
37
38 get :edit, :id => node.id
39 assert_response :success
40
41 node.reload
42 assert_equal 2, node.pages.length
43 assert_equal "Hello", node.find_or_create_draft( User.first ).title
44 assert_equal "World", node.find_or_create_draft( User.first ).body
45 end
46
25 def test_update_a_draft 47 def test_update_a_draft
26 test_node = Node.create! :slug => "test_node" 48 test_node = Node.create! :slug => "test_node"
27 test_node.move_to_child_of Node.root 49 test_node.move_to_child_of Node.root