Sha256: cd5bfb9d6260a903e3efd49c739630d0b3537aacb8789fe1d6572aeb37659d1e

Contents?: true

Size: 1.83 KB

Versions: 10

Compression:

Stored size: 1.83 KB

Contents

require 'spec_helper'

module RevealCK
  module Builders
    describe IndexHtml do
      let :index_html_erb do
        RevealCK.template_path('index.html',
                               'index.html.erb')
      end

      let :slides_html do
        spec_data('builders', 'index_html', 'slides.html')
      end

      let :config do
        config = Config.new
        config.title = 'Sample Title'
        config.author = 'Sample Author'
        config.theme = 'night'
        config.transition = 'page'
        config
      end

      let :index_html do
        IndexHtml.new(template: index_html_erb,
                      slides_html: slides_html,
                      config: config)
      end

      let :rendered_content do
        index_html.render
      end

      it 'is created with a file location and a config' do
        expect(index_html.template).to include 'index.html.erb'
        expect(index_html.config.title).to eq config.title
      end

      it 'can render html' do
        expect(rendered_content)
          .to include('<html lang="en">')
      end

      it 'supports replacing the configured title' do
        expect(rendered_content)
          .to include('<title>Sample Title</title>')
      end

      it 'supports replacing the configured author' do
        expect(rendered_content)
          .to include('<meta name="author" content="Sample Author">')
      end

      it 'supports replacing the configured theme' do
        expect(rendered_content)
          .to include('<link rel="stylesheet" href="css/theme/night.css"')
      end

      it 'supports replacing the configured transition' do
        expect(rendered_content)
          .to include("transition: 'page'")
      end

      it 'supports replacing the associated slides' do
        expect(rendered_content)
          .to include('This is a slide')
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
reveal-ck-3.0.1 spec/lib/reveal-ck/builders/index_html_spec.rb
reveal-ck-3.0.0 spec/lib/reveal-ck/builders/index_html_spec.rb
reveal-ck-0.6.2 spec/lib/reveal-ck/builders/index_html_spec.rb
reveal-ck-0.6.1 spec/lib/reveal-ck/builders/index_html_spec.rb
reveal-ck-0.6.0 spec/lib/reveal-ck/builders/index_html_spec.rb
reveal-ck-0.5.1 spec/lib/reveal-ck/builders/index_html_spec.rb
reveal-ck-0.5.0 spec/lib/reveal-ck/builders/index_html_spec.rb
reveal-ck-0.4.2 spec/lib/reveal-ck/builders/index_html_spec.rb
reveal-ck-0.4.1 spec/lib/reveal-ck/builders/index_html_spec.rb
reveal-ck-0.4.0 spec/lib/reveal-ck/builders/index_html_spec.rb