Sha256: fbb549eb2ddf5486b9764f9d1581be73059b002ff073edc93061548d52b29f82

Contents?: true

Size: 1.03 KB

Versions: 3

Compression:

Stored size: 1.03 KB

Contents

require "spec_helper"

require "generator_spec/test_case"

require "generators/quick-templater/layout/layout_generator"

describe QuickTemplater::Layout do
  include GeneratorSpec::TestCase
  destination File.expand_path('../../tmp', __FILE__)

  before(:all) do
    prepare_destination
  end

  it 'creates layout with name test1' do
    run_generator %w(test1)
    assert_file 'app/views/layouts/test1.html.erb'
  end

  describe 'are generated' do
    describe 'with default template engine' do
      before {run_generator}
      it 'application.html.erb' do
        assert_file 'app/views/layouts/application.html.erb'
      end
    end
    describe 'with haml' do
      before {run_generator %w(--engine=haml)}
      it 'application.html.haml' do
        assert_file 'app/views/layouts/application.html.haml'
      end
    end
    describe 'with slim' do
      before do
        run_generator %w(--engine=slim)
      end
      it 'application.html.slim' do
        assert_file 'app/views/layouts/application.html.slim'
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
quick-templater-0.0.8 spec/generators/layout_spec.rb
quick-templater-0.0.7 spec/generators/layout_spec.rb
quick-templater-0.0.5 spec/generators/layout_spec.rb