diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/unit/node_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/node_test.rb b/test/unit/node_test.rb index 56012d6..5325daa 100644 --- a/test/unit/node_test.rb +++ b/test/unit/node_test.rb | |||
| @@ -41,7 +41,23 @@ class NodeTest < ActiveSupport::TestCase | |||
| 41 | end | 41 | end |
| 42 | 42 | ||
| 43 | def test_retrieving_page_by_revision | 43 | def test_retrieving_page_by_revision |
| 44 | updates = Node.create(:slug => 'updates') | ||
| 45 | updates.move_to_child_of @root | ||
| 46 | |||
| 47 | year = Node.create(:slug => '2008') | ||
| 48 | year.move_to_child_of updates | ||
| 49 | |||
| 50 | foo = Node.create(:slug => 'foo') | ||
| 51 | foo.move_to_child_of year | ||
| 52 | |||
| 53 | assert_not_nil Node.find_by_unique_name('updates/2008/foo') | ||
| 54 | |||
| 55 | foo.pages.create :title => "Version 1" | ||
| 56 | foo.pages.create :title => "Version 2" | ||
| 57 | foo.pages.create :title => "Version 3" | ||
| 44 | 58 | ||
| 59 | page = Node.find_page("updates/2008/foo", 2) | ||
| 60 | assert_equal "Version 2", page.title | ||
| 45 | end | 61 | end |
| 46 | 62 | ||
| 47 | def test_order_of_pages_by_revision | 63 | def test_order_of_pages_by_revision |
