mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
74ade51eee
* Sass gem registers a compressor * Sass gem registers generators for assets and scaffold * Create a default stylesheet_engine ("css") for apps that remove the Sass gem
26 lines
879 B
Ruby
26 lines
879 B
Ruby
require 'generators/generators_test_helper'
|
|
require 'rails/generators/rails/assets/assets_generator'
|
|
|
|
# FIXME: Silence the 'Could not find task "using_coffee?"' message in tests due to the public stub
|
|
class AssetsGeneratorTest < Rails::Generators::TestCase
|
|
include GeneratorsTestHelper
|
|
arguments %w(posts)
|
|
|
|
def test_assets
|
|
run_generator
|
|
assert_file "app/assets/javascripts/posts.js.coffee"
|
|
assert_file "app/assets/stylesheets/posts.css"
|
|
end
|
|
|
|
def test_skipping_assets
|
|
content = run_generator ["posts", "--no-stylesheets", "--no-javascripts"]
|
|
assert_no_file "app/assets/javascripts/posts.js.coffee"
|
|
assert_no_file "app/assets/stylesheets/posts.css"
|
|
end
|
|
|
|
def test_vanilla_assets
|
|
run_generator ["posts", "--no-javascript-engine"]
|
|
assert_file "app/assets/javascripts/posts.js"
|
|
assert_file "app/assets/stylesheets/posts.css"
|
|
end
|
|
end
|