summaryrefslogtreecommitdiff
path: root/test/unit/node_test.rb
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-11-15 14:31:52 +0100
committerhukl <contact@smyck.org>2009-11-15 14:31:52 +0100
commit1de97a5ac6f4621f8013d6f73c6c9edfae445b70 (patch)
treeee500916af41898ff2ecaf5c8567acf7cfd0f867 /test/unit/node_test.rb
parent713f8f76e2ae1635bb938de6d8c74587d842790f (diff)
removed date and author from the standard template and introduced a dedicated update template which will get auto assigned if a node is created under updates/<year>/<slug>
Added tests and convenient method
Diffstat (limited to 'test/unit/node_test.rb')
-rw-r--r--test/unit/node_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/node_test.rb b/test/unit/node_test.rb
index dd010cd..a106856 100644
--- a/test/unit/node_test.rb
+++ b/test/unit/node_test.rb
@@ -263,6 +263,19 @@ class NodeTest < ActiveSupport::TestCase
263 assert_equal "quentin", node.head.user.login 263 assert_equal "quentin", node.head.user.login
264 end 264 end
265 265
266
267 test "update?" do
268 Node.root.descendants.delete_all
269 updates = Node.root.children.create!( :slug => "updates" )
270 assert !updates.update?
271
272 updates2009 = updates.children.create!( :slug => "2009" )
273 assert !updates2009.update?
274
275 update = updates2009.children.create!( :slug => "my-first-update" )
276 assert update.update?
277 end
278
266 def create_revisions node, count 279 def create_revisions node, count
267 count.times do 280 count.times do
268 node.find_or_create_draft @user1 281 node.find_or_create_draft @user1