diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2013-06-27 00:16:20 -0700 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2013-06-27 00:16:20 -0700 |
| commit | f620bfd8e6fe8c483bf47fe69e52dc6608927f78 (patch) | |
| tree | 77469a4a31fa298cea8c410c2f962bd9f675b1de /test | |
| parent | 8d3d80f3bef205bd5f02ebd188915c2b3a89f987 (diff) | |
| parent | 76f19674e1eabdf6c973a7dcbeafc89ad6615599 (diff) | |
Merge pull request #459 from mojavelinux/showtitle
resolves #457 honor showtitle attribute as alternate to notitle!
Diffstat (limited to 'test')
| -rw-r--r-- | test/document_test.rb | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/test/document_test.rb b/test/document_test.rb index d7224684..bcd18c24 100644 --- a/test/document_test.rb +++ b/test/document_test.rb @@ -871,8 +871,31 @@ content assert_xpath '/*[@id="preamble"]', result, 1 end - test 'enable title when no header footer' do - result = render_string("= Title\n\npreamble", :header_footer => false, :attributes => {'notitle!' => ''}) + test 'enable title in embedded document by unassigning notitle attribute' do + input = <<-EOS += Document Title + +content + EOS + + result = render_string input, :header_footer => false, :attributes => {'notitle!' => ''} + assert_xpath '/html', result, 0 + assert_xpath '/h1', result, 1 + assert_xpath '/*[@id="header"]', result, 0 + assert_xpath '/*[@id="footer"]', result, 0 + assert_xpath '/*[@id="preamble"]', result, 1 + assert_xpath '(/*)[1]/self::h1', result, 1 + assert_xpath '(/*)[2]/self::*[@id="preamble"]', result, 1 + end + + test 'enable title in embedded document by assigning showtitle attribute' do + input = <<-EOS += Document Title + +content + EOS + + result = render_string input, :header_footer => false, :attributes => {'showtitle' => ''} assert_xpath '/html', result, 0 assert_xpath '/h1', result, 1 assert_xpath '/*[@id="header"]', result, 0 |
