1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/test/generators/assets_generator_test.rb

27 lines
915 B
Ruby
Raw Normal View History

require 'generators/generators_test_helper'
require 'rails/generators/rails/assets/assets_generator'
# FOXME: 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)
2011-04-17 05:48:15 -04:00
def test_assets
run_generator
2011-04-17 05:48:15 -04:00
assert_file "app/assets/javascripts/posts.js.coffee"
assert_file "app/assets/stylesheets/posts.css.scss"
end
def test_skipping_assets
2011-04-17 05:48:15 -04:00
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.scss"
end
2011-04-17 05:48:15 -04:00
def test_vanilla_assets
run_generator ["posts", "--no-javascript-engine", "--no-stylesheet-engine"]
assert_file "app/assets/javascripts/posts.js"
assert_file "app/assets/stylesheets/posts.css"
end
end