Sha256: 1db54dc737a8baefacf773e4ff9c9b493325f936625dba53d308132681592b89

Contents?: true

Size: 1.25 KB

Versions: 26

Compression:

Stored size: 1.25 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 "html/#{subject.slug}.html"}

        its(:filenames) { should include "config/marketing.yml"}

        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

26 entries across 26 versions & 2 rubygems

Version Path
softcover-1.0.beta15 spec/book_spec.rb
softcover-1.0.beta14 spec/book_spec.rb
softcover-1.0.beta13 spec/book_spec.rb
softcover-1.0.beta12 spec/book_spec.rb
softcover-1.0.beta11 spec/book_spec.rb
softcover-1.0.beta10 spec/book_spec.rb
softcover-1.0.beta9 spec/book_spec.rb
softcover-1.0.beta8 spec/book_spec.rb
softcover-1.0.beta7 spec/book_spec.rb
softcover-1.0.beta6 spec/book_spec.rb
softcover-1.0.beta5 spec/book_spec.rb
softcover-1.0.beta4 spec/book_spec.rb
softcover-1.0.beta3 spec/book_spec.rb
softcover-nonstop-1.0.beta2 spec/book_spec.rb
softcover-1.0.beta2 spec/book_spec.rb
softcover-1.0.beta1 spec/book_spec.rb
softcover-0.9.23 spec/book_spec.rb
softcover-0.9.22 spec/book_spec.rb
softcover-0.9.21 spec/book_spec.rb
softcover-0.9.20 spec/book_spec.rb