2017-08-14 13:08:09 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-06 13:16:09 -04:00
|
|
|
require "generators/generators_test_helper"
|
|
|
|
require "rails/generators/rails/assets/assets_generator"
|
2011-04-14 06:23:21 -04:00
|
|
|
|
|
|
|
class AssetsGeneratorTest < Rails::Generators::TestCase
|
|
|
|
include GeneratorsTestHelper
|
|
|
|
arguments %w(posts)
|
|
|
|
|
2011-04-17 05:48:15 -04:00
|
|
|
def test_assets
|
2011-04-14 06:23:21 -04:00
|
|
|
run_generator
|
2011-06-27 20:54:03 -04:00
|
|
|
assert_file "app/assets/javascripts/posts.js"
|
2011-05-24 02:39:04 -04:00
|
|
|
assert_file "app/assets/stylesheets/posts.css"
|
2011-04-14 06:23:21 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_skipping_assets
|
2011-10-09 07:45:55 -04:00
|
|
|
run_generator ["posts", "--no-stylesheets", "--no-javascripts"]
|
2011-06-27 20:54:03 -04:00
|
|
|
assert_no_file "app/assets/javascripts/posts.js"
|
2011-05-24 02:39:04 -04:00
|
|
|
assert_no_file "app/assets/stylesheets/posts.css"
|
2011-04-14 06:23:21 -04:00
|
|
|
end
|
|
|
|
end
|