diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2020-02-04 01:29:58 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-04 01:29:58 -0700 |
| commit | a0def6a3882ccc67c14d9294a20a8e2500dd4593 (patch) | |
| tree | b91850ce54cb5bcee1dc30f2b5d57daac4afa982 /spec/page_spec.rb | |
| parent | b3eebf0c98361396a616e6bc217538245897da69 (diff) | |
resolves #1536 add support for remote background images specified in theme (PR #1537)
Diffstat (limited to 'spec/page_spec.rb')
| -rw-r--r-- | spec/page_spec.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/page_spec.rb b/spec/page_spec.rb index 09bd819e..a2aaf969 100644 --- a/spec/page_spec.rb +++ b/spec/page_spec.rb @@ -269,6 +269,37 @@ describe 'Asciidoctor::PDF::Converter - Page' do (expect to_file).to visually_match 'page-background-image.pdf' end + it 'should use remote image specified by page-background-image attribute as page background', visual: true do + with_local_webserver do |base_url| + [%(#{base_url}/bg.png), %(image:#{base_url}/bg.png[])].each_with_index do |image_url, idx| + to_file = to_pdf_file <<~EOS, %(page-background-image-remote-#{idx}.pdf), attribute_overrides: { 'allow-uri-read' => '' } + = Document Title + :doctype: book + :page-background-image: #{image_url} + + content + EOS + + (expect to_file).to visually_match 'page-background-image.pdf' + end + end + end + + it 'should use remote image specified in theme as page background', visual: true do + with_local_webserver do |base_url| + [%(#{base_url}/bg.png), %(image:#{base_url}/bg.png[])].each_with_index do |image_url, idx| + to_file = to_pdf_file <<~EOS, %(page-background-image-remote-#{idx}.pdf), attribute_overrides: { 'allow-uri-read' => '' }, pdf_theme: { page_background_image: image_url } + = Document Title + :doctype: book + + content + EOS + + (expect to_file).to visually_match 'page-background-image.pdf' + end + end + end + it 'should resolve background image in theme relative to theme dir', visual: true do [true, false].each do |macro| pdf_theme = { |
