summaryrefslogtreecommitdiff
path: root/spec/image_spec.rb
diff options
context:
space:
mode:
authorMarat Radchenko <marat@slonopotamus.org>2021-04-18 21:18:55 +0300
committerMarat Radchenko <marat@slonopotamus.org>2021-04-18 21:19:28 +0300
commitfc6c16b10a7222f3977da127ecf5d1bba284c2cc (patch)
treeec6caa16b9e68c96d9753deebfdf4577923ebdb9 /spec/image_spec.rb
parent0b1021b42a7ff22b17a6274f77ea1a055ee7613f (diff)
resolves #396 add support for :back-cover-image: document attribute
Diffstat (limited to 'spec/image_spec.rb')
-rw-r--r--spec/image_spec.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/spec/image_spec.rb b/spec/image_spec.rb
index 3323fde..437c950 100644
--- a/spec/image_spec.rb
+++ b/spec/image_spec.rb
@@ -49,11 +49,20 @@ describe 'Asciidoctor::Epub3::Converter - Image' do
it 'adds front cover image' do
book, = to_epub fixture_file('front-cover-image/book.adoc')
- cover_image = book.item_by_href 'jacket/cover.png'
+ cover_image = book.item_by_href 'jacket/front-cover.png'
expect(cover_image).not_to be_nil
- cover_page = book.item_by_href 'cover.xhtml'
+ cover_page = book.item_by_href 'front-cover.xhtml'
expect(cover_page).not_to be_nil
- expect(cover_page.content).to include '<image width="1050" height="1600" xlink:href="jacket/cover.png"/>'
+ expect(cover_page.content).to include '<image width="1050" height="1600" xlink:href="jacket/front-cover.png"/>'
+ end
+
+ it 'adds back cover image' do
+ book, = to_epub fixture_file('back-cover-image/book.adoc')
+ cover_image = book.item_by_href 'jacket/back-cover.png'
+ expect(cover_image).not_to be_nil
+ cover_page = book.item_by_href 'back-cover.xhtml'
+ expect(cover_page).not_to be_nil
+ expect(cover_page.content).to include '<image width="1050" height="1600" xlink:href="jacket/back-cover.png"/>'
end
it "doesn't crash if cover image points to a directory" do