Sha256: 58fcc722bc6d359ab59c2238731e125611dfa1a20a453a50a16ee78566ab65a2

Contents?: true

Size: 1.31 KB

Versions: 21

Compression:

Stored size: 1.31 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 }

      describe "reading from book.yml" do
        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

      describe "reading from marketing.yml" do
        its(:prices) { should_not be_empty }
        its(:faq) { should_not be_empty }
        its(:testimonials) { should_not be_empty }
        its(:marketing_content) { should be_empty }
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
softcover-0.9.10 spec/book_spec.rb
softcover-0.9.9 spec/book_spec.rb
softcover-0.9.8 spec/book_spec.rb
softcover-0.9.7 spec/book_spec.rb
softcover-0.9.6 spec/book_spec.rb
softcover-0.9.5 spec/book_spec.rb
softcover-0.9.4 spec/book_spec.rb
softcover-0.9.3 spec/book_spec.rb
softcover-0.9.2 spec/book_spec.rb
softcover-0.9.1 spec/book_spec.rb
softcover-0.9.0 spec/book_spec.rb
softcover-0.8.9 spec/book_spec.rb
softcover-0.8.8 spec/book_spec.rb
softcover-0.8.7 spec/book_spec.rb
softcover-0.8.6 spec/book_spec.rb
softcover-0.8.5 spec/book_spec.rb
softcover-0.8.4 spec/book_spec.rb
softcover-0.8.3 spec/book_spec.rb
softcover-0.8.2 spec/book_spec.rb
softcover-0.8.1 spec/book_spec.rb