From 1de97a5ac6f4621f8013d6f73c6c9edfae445b70 Mon Sep 17 00:00:00 2001 From: hukl Date: Sun, 15 Nov 2009 14:31:52 +0100 Subject: 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// Added tests and convenient method --- test/unit/node_test.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/unit/node_test.rb') 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 assert_equal "quentin", node.head.user.login end + + test "update?" do + Node.root.descendants.delete_all + updates = Node.root.children.create!( :slug => "updates" ) + assert !updates.update? + + updates2009 = updates.children.create!( :slug => "2009" ) + assert !updates2009.update? + + update = updates2009.children.create!( :slug => "my-first-update" ) + assert update.update? + end + def create_revisions node, count count.times do node.find_or_create_draft @user1 -- cgit v1.3