Sha256: a6d0759a1b8fe58fc35c04d7f36936d0ef5a561186c5e5a9fd38a8a53700908f

Contents?: true

Size: 1.79 KB

Versions: 2

Compression:

Stored size: 1.79 KB

Contents

require "test_helper"
require "generators/html5/install/install_generator"

class InstallGeneratorTest < Rails::Generators::TestCase
  include GeneratorTestHelper
  tests Html5::Generators::InstallGenerator

  test "Compass config file should be generated" do
    run_generator
    assert_file "config/compass.rb"
  end

  test "html5_rails.yml config file should be generated" do
    run_generator
    assert_file "config/html5_rails.yml"
  end
  
  test "application layout should be generated" do
    run_generator
    assert_file "app/views/layouts/application.html.erb"
  end

  test "with flag --template-engine=haml" do
    run_generator ["--template-engine=haml"]
    assert_no_file "app/views/layouts/application.html.erb"
    assert_file "app/views/layouts/application.html.haml"
  end

  test "minimal application partials should be generated" do
    run_generator
    %w(_footer _head _header _chromeframe).each do |file|
      assert_file "app/views/application/#{ file }.html.erb"
    end
    %w(_flashes _javascripts _stylesheets).each do |file|
      assert_no_file "app/views/application/#{ file }.html.erb"
    end
  end

  test "assets should be generated" do
    run_generator

    assert_file "app/assets/stylesheets/_variables.css.scss"
    assert_file "app/assets/stylesheets/application.css.scss", /@import "application\/chromeframe";/
    assert_file "app/assets/stylesheets/application.css.scss", /@import "application\/document";/
    assert_file "app/assets/stylesheets/application.css.scss", /@import "application\/media_queries";/
    %w(chromeframe document media_queries).each do |file|
      assert_file "app/assets/stylesheets/application/#{ file }.css.scss"
    end
  end

  test "application.css gets removed" do
    run_generator
    assert_no_file "app/assets/stylesheets/application.css"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
html5-rails-0.0.6 test/generators/install_generator_test.rb
html5-rails-0.0.5 test/generators/install_generator_test.rb