summaryrefslogtreecommitdiff
path: root/test/headers_test.rb
blob: 4bb04c2924c8d4210330787160941a79430d3db9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
require 'test_helper'

context "Headers" do
  test "main header" do
    assert_xpath "//h1", render_string("My Title\n=======")
  end

  context "level 1" do 
    test "with multiline syntax" do
      assert_xpath "//h2", render_string("My Section\n-----------")
    end

    test "with single line syntax" do
      assert_xpath "//h2", render_string("== My Title")
    end
  end  

  context "level 2" do 
    test "with multiline syntax" do
      assert_xpath "//h3", render_string("My Section\n~~~~~~~~~~~")
    end

    test "with single line syntax" do
      assert_xpath "//h3", render_string("=== My Title")
    end
  end  

  context "level 3" do 
    test "with multiline syntax" do
      assert_xpath "//h4", render_string("My Section\n^^^^^^^^^^")
    end

    test "with single line syntax" do
      assert_xpath "//h4", render_string("==== My Title")
    end
  end

  context "level 4" do 
    test "with multiline syntax" do
      assert_xpath "//h5", render_string("My Section\n++++++++++")
    end

    test "with single line syntax" do
      assert_xpath "//h5", render_string("===== My Title")
    end
  end  
end