summaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-11-17 12:35:04 +0100
committerhukl <contact@smyck.org>2009-11-17 12:35:04 +0100
commitbc6080a332806c2d0d359e05aaee2a7865d08673 (patch)
tree47e811f99c60a82d0dd6004b257d3a88a3d42652 /test/unit
parentc4b8b7f61d0c455aa77f72b96de4ba02ed03aa41 (diff)
don't set the published_at upon creation of the first draft but rather on publish
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/node_test.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/unit/node_test.rb b/test/unit/node_test.rb
index a106856..514ba3f 100644
--- a/test/unit/node_test.rb
+++ b/test/unit/node_test.rb
@@ -254,7 +254,7 @@ class NodeTest < ActiveSupport::TestCase
254 node = create_node_with_draft 254 node = create_node_with_draft
255 draft = node.draft 255 draft = node.draft
256 draft.user = users(:aaron) 256 draft.user = users(:aaron)
257 draft.save 257 draft.save!
258 node.publish_draft! 258 node.publish_draft!
259 new_draft = node.find_or_create_draft( users(:quentin) ) 259 new_draft = node.find_or_create_draft( users(:quentin) )
260 new_draft.user_id = users(:quentin).id 260 new_draft.user_id = users(:quentin).id
@@ -276,6 +276,11 @@ class NodeTest < ActiveSupport::TestCase
276 assert update.update? 276 assert update.update?
277 end 277 end
278 278
279 test "new nodes should have drafts with no publidhed_at set" do
280 node = Node.root.children.create( :slug => "wow" )
281 assert_nil node.draft.published_at
282 end
283
279 def create_revisions node, count 284 def create_revisions node, count
280 count.times do 285 count.times do
281 node.find_or_create_draft @user1 286 node.find_or_create_draft @user1