From 482448d05686b6aaa549208dafa36d682b3059b6 Mon Sep 17 00:00:00 2001 From: hukl Date: Sat, 31 Jan 2009 16:00:05 +0100 Subject: made sure that returned pages are always ordered by there revision --- test/unit/node_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/unit/node_test.rb') diff --git a/test/unit/node_test.rb b/test/unit/node_test.rb index 14fdad0..2b35403 100644 --- a/test/unit/node_test.rb +++ b/test/unit/node_test.rb @@ -27,6 +27,16 @@ class NodeTest < ActiveSupport::TestCase end + def test_order_of_pages_by_revision + one = @first_child.pages.create :title => "one" + two = @first_child.pages.create :title => "two" + three = @first_child.pages.create :title => "three" + + @first_child.pages.reload + + assert_equal [1,2,3], @first_child.pages.map { |x| x.revision } + end + def test_behavior_of_acts_as_list one = @first_child.pages.create :title => "one" two = @first_child.pages.create :title => "two" -- cgit v1.3