Sha256: b029edfe5cf91e07bde1e039d7e386b4edd13eb24da417819284564eb2a3900e

Contents?: true

Size: 1.02 KB

Versions: 23

Compression:

Stored size: 1.02 KB

Contents

require 'spec_helper'

describe Softcover::Book do
  context "#initialize" do
    context "valid book directory" do
      before(:all) { generate_book(id: 1) }
      after(:all)  { remove_book }

      # disabling these tests for now:
      its(:filenames) { should_not include "html/test-book.html"}

      its(:filenames) { should include "html/chapter-1_fragment.html"}
      its(:filenames) { should_not include "html/chapter-1.html"}

      its(:filenames) { should include "ebooks/test-book.mobi"}
      its(:filenames) { should include "ebooks/test-book.epub"}
      its(:filenames) { should include "ebooks/test-book.pdf"}

      its(:slug) { should eq "book" }
      its(:url) { should match /\/books\/(.*?)\/redirect/ }

      it "sets chapter attributes" do
        expect(subject.chapter_attributes.first[:menu_heading]).
          to match /Frontmatter/
      end

      it "has rendered latex in menu_heading" do
        expect(subject.chapter_attributes.last[:menu_heading]).
          to match /<em>/
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
softcover-0.7.11 spec/book_spec.rb
softcover-0.7.10 spec/book_spec.rb
softcover-0.7.9 spec/book_spec.rb
softcover-0.7.8 spec/book_spec.rb
softcover-0.7.7 spec/book_spec.rb
softcover-0.7.6 spec/book_spec.rb
softcover-0.7.5 spec/book_spec.rb
softcover-0.7.4 spec/book_spec.rb
softcover-0.7.3 spec/book_spec.rb
softcover-0.7.2 spec/book_spec.rb
softcover-0.7.1 spec/book_spec.rb
softcover-0.7.0 spec/book_spec.rb
softcover-0.6.10 spec/book_spec.rb
softcover-0.6.9 spec/book_spec.rb
softcover-0.6.7 spec/book_spec.rb
softcover-0.6.6 spec/book_spec.rb
softcover-0.6.5 spec/book_spec.rb
softcover-0.6.4 spec/book_spec.rb
softcover-0.6.3 spec/book_spec.rb
softcover-0.6.2 spec/book_spec.rb