Commit 628002e31d386a6ce6f91e7ed9d61c3683d3d127
1 parent
0cd4c377
Exists in
master
and in
23 other branches
Testing documentation ordering
(ActionItem1487)
Showing
2 changed files
with
14 additions
and
3 deletions
Show diff stats
app/models/doc_topic.rb
test/unit/doc_topic_test.rb
| 1 | -require 'test_helper' | |
| 1 | +require File.dirname(__FILE__) + '/../test_helper' | |
| 2 | 2 | |
| 3 | 3 | class DocTopicTest < ActiveSupport::TestCase |
| 4 | 4 | should 'be a DocItem' do |
| ... | ... | @@ -25,4 +25,12 @@ class DocTopicTest < ActiveSupport::TestCase |
| 25 | 25 | end |
| 26 | 26 | end |
| 27 | 27 | |
| 28 | + should 'read order from HTML' do | |
| 29 | + assert_equal 1, DocTopic.order('<h1 class="order-1">Some topic</h1>') | |
| 30 | + end | |
| 31 | + | |
| 32 | + should 'use 0 as order by default' do | |
| 33 | + assert_equal 0, DocTopic.order('<h1>Some topic</h1>') | |
| 34 | + end | |
| 35 | + | |
| 28 | 36 | end | ... | ... |