Sha256: 321974c158ccdb060a8cd57b85f816d6723616fae77eb128de5243cdfdb3b2aa

Contents?: true

Size: 924 Bytes

Versions: 9

Compression:

Stored size: 924 Bytes

Contents

require 'spec_helper'
require 'minimart/web/dashboard_generator'

describe Minimart::Web::DashboardGenerator do
  let(:cookbooks) do
    Minimart::Web::Cookbooks.new(inventory_directory: 'spec/fixtures')
  end

  let(:web_directory) { test_directory }

  subject do
    Minimart::Web::DashboardGenerator.new(
      web_directory: web_directory,
      cookbooks:     cookbooks)
  end

  describe '#generate' do
    it 'should create an index.html file in the web directory' do
      subject.generate
      expect(File.exists?(File.join(web_directory, 'index.html'))).to eq true
    end

    it 'should have a proper link back to the home page' do
      subject.generate
      expect(subject.template_content).to match(%{href="index.html"})
    end

    it 'should have the proper relative path to any loaded assets' do
      subject.generate
      expect(subject.template_content).to match %{href="assets/}
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
minimart-1.2.5 spec/lib/minimart/web/dashboard_generator_spec.rb
minimart-1.2.4 spec/lib/minimart/web/dashboard_generator_spec.rb
minimart-1.2.3 spec/lib/minimart/web/dashboard_generator_spec.rb
minimart-1.2.0 spec/lib/minimart/web/dashboard_generator_spec.rb
minimart-1.1.6 spec/lib/minimart/web/dashboard_generator_spec.rb
minimart-1.1.3 spec/lib/minimart/web/dashboard_generator_spec.rb
minimart-1.0.2 spec/lib/minimart/web/dashboard_generator_spec.rb
minimart-1.0.1 spec/lib/minimart/web/dashboard_generator_spec.rb
minimart-0.0.1 spec/lib/minimart/web/dashboard_generator_spec.rb