diff --git a/lib/generators/suspenders/styles_generator.rb b/lib/generators/suspenders/styles_generator.rb index 610dcc32b..a83b686ff 100644 --- a/lib/generators/suspenders/styles_generator.rb +++ b/lib/generators/suspenders/styles_generator.rb @@ -25,8 +25,13 @@ def build_directory_structure return if is_tailwind? create_file "app/assets/stylesheets/base.css" + append_to_file "app/assets/stylesheets/base.css", "/* Base Styles */" + create_file "app/assets/stylesheets/components.css" + append_to_file "app/assets/stylesheets/components.css", "/* Component Styles */" + create_file "app/assets/stylesheets/utilities.css" + append_to_file "app/assets/stylesheets/utilities.css", "/* Utility Styles */" end # Modify if https://github.com/rails/cssbundling-rails/pull/139 is merged diff --git a/test/generators/suspenders/styles_generator_test.rb b/test/generators/suspenders/styles_generator_test.rb index f9890be84..1c5f87234 100644 --- a/test/generators/suspenders/styles_generator_test.rb +++ b/test/generators/suspenders/styles_generator_test.rb @@ -186,9 +186,15 @@ class StylesGenerator::PostCssTest < Rails::Generators::TestCase test "creates stylesheets" do run_generator - assert_file app_root("app/assets/stylesheets/base.css") - assert_file app_root("app/assets/stylesheets/components.css") - assert_file app_root("app/assets/stylesheets/utilities.css") + assert_file app_root("app/assets/stylesheets/base.css") do |file| + assert_equal "/* Base Styles */", file + end + assert_file app_root("app/assets/stylesheets/components.css") do |file| + assert_equal "/* Component Styles */", file + end + assert_file app_root("app/assets/stylesheets/utilities.css") do |file| + assert_equal "/* Utility Styles */", file + end end private