summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-09-10 12:00:03 +0200
committerhukl <contact@smyck.org>2009-09-10 12:00:03 +0200
commit8afffc09bcaa4d1c77f1ca575fd5978423631bff (patch)
treecc9c4d8d402337903584d845f5f2df6afdc52ba1 /test
parentf7ce8c245fde3f6202103ae614b181c0ba44ed93 (diff)
refactored the create method to actually produce meaningful error messages when something goes wrong. added tests for corner cases
Diffstat (limited to 'test')
-rw-r--r--test/functional/nodes_controller_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/functional/nodes_controller_test.rb b/test/functional/nodes_controller_test.rb
index 08e50fd..801f2c0 100644
--- a/test/functional/nodes_controller_test.rb
+++ b/test/functional/nodes_controller_test.rb
@@ -70,6 +70,22 @@ class NodesControllerTest < ActionController::TestCase
70 assert_equal 1, Node.last.level 70 assert_equal 1, Node.last.level
71 end 71 end
72 72
73 test "creating a top_level node without a title should not work" do
74 login_as :quentin
75
76 assert_no_difference "Node.count" do
77 post(:create, :kind => "top_level")
78 end
79 end
80
81 test "creating a generic node without a parent_id should not work" do
82 login_as :quentin
83
84 assert_no_difference "Node.count" do
85 post(:create, :kind => "generic")
86 end
87 end
88
73 def test_editing_a_node 89 def test_editing_a_node
74 login_as :quentin 90 login_as :quentin
75 91