diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2013-01-30 12:11:13 -0700 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2013-01-30 12:11:13 -0700 |
| commit | a355a08ca9c3ac1e25e2262287b2de3c3b1f953b (patch) | |
| tree | 467a646090b0fd065172160b75417695cb121f7a /test/text_test.rb | |
| parent | b82ed8ea14a8e4b1b2e5a507dfe754c9dc422363 (diff) | |
resolves issue #144 - encoding issue w/ utf-8
- needed to add magic encoding line to all erb templates
- add example from issue to encodings test case
Diffstat (limited to 'test/text_test.rb')
| -rw-r--r-- | test/text_test.rb | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/test/text_test.rb b/test/text_test.rb index de8695b6..daa87ea9 100644 --- a/test/text_test.rb +++ b/test/text_test.rb @@ -1,12 +1,28 @@ require 'test_helper' context "Text" do - test "proper encoding to handle utf8 characters in document" do - assert_xpath "//p", example_document(:encoding).render, 1 + test "proper encoding to handle utf8 characters in document using html backend" do + output = example_document(:encoding).render + assert_xpath '//p', output, 2 + assert_xpath '//a', output, 1 end - test "proper encoding to handle utf8 characters in embedded document" do - assert_xpath "//p", example_document(:encoding).render(:header_footer => false), 1 + test "proper encoding to handle utf8 characters in embedded document using html backend" do + output = example_document(:encoding, :header_footer => false).render + assert_xpath '//p', output, 2 + assert_xpath '//a', output, 1 + end + + test "proper encoding to handle utf8 characters in document using docbook backend" do + output = example_document(:encoding, :attributes => {'backend' => 'docbook'}).render + assert_xpath '//simpara', output, 2 + assert_xpath '//ulink', output, 1 + end + + test "proper encoding to handle utf8 characters in embedded document using docbook backend" do + output = example_document(:encoding, :header_footer => false, :attributes => {'backend' => 'docbook'}).render + assert_xpath '//simpara', output, 2 + assert_xpath '//ulink', output, 1 end # NOTE this test ensures we have the encoding line on block templates too |
