diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2010-04-09 10:04:20 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-04-09 10:04:20 -0700 |
commit | ec8e747960da9c0413cb5da7834f458bc5dd8ce1 (patch) | |
tree | 1dca16b6de668a2d2f875b3e090c3650d5e115b5 /railties/test/generators | |
parent | c44cacb07077325d0434b571889ac032dfb026f6 (diff) | |
download | rails-ec8e747960da9c0413cb5da7834f458bc5dd8ce1.tar.gz rails-ec8e747960da9c0413cb5da7834f458bc5dd8ce1.tar.bz2 rails-ec8e747960da9c0413cb5da7834f458bc5dd8ce1.zip |
Partially revert "A new application now comes with a layout and a stylesheet."
This reverts commit ea2c5fa8046e2f953b366adc94f0610ccfea0828.
Conflicts:
railties/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb
railties/test/generators/app_generator_test.rb
Diffstat (limited to 'railties/test/generators')
3 files changed, 26 insertions, 0 deletions
diff --git a/railties/test/generators/scaffold_controller_generator_test.rb b/railties/test/generators/scaffold_controller_generator_test.rb index f5af137ced..8040b22fe6 100644 --- a/railties/test/generators/scaffold_controller_generator_test.rb +++ b/railties/test/generators/scaffold_controller_generator_test.rb @@ -66,6 +66,7 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase new show ).each { |view| assert_file "app/views/users/#{view}.html.erb" } + assert_no_file "app/views/layouts/users.html.erb" end def test_functional_tests diff --git a/railties/test/generators/scaffold_generator_test.rb b/railties/test/generators/scaffold_generator_test.rb index 3cad65f503..e8e622fe5c 100644 --- a/railties/test/generators/scaffold_generator_test.rb +++ b/railties/test/generators/scaffold_generator_test.rb @@ -70,10 +70,14 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase show _form ).each { |view| assert_file "app/views/product_lines/#{view}.html.erb" } + assert_no_file "app/views/layouts/product_lines.html.erb" # Helpers assert_file "app/helpers/product_lines_helper.rb" assert_file "test/unit/helpers/product_lines_helper_test.rb" + + # Stylesheets + assert_file "public/stylesheets/scaffold.css" end def test_scaffold_on_revoke @@ -97,9 +101,13 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase # Views assert_no_file "app/views/product_lines" + assert_no_file "app/views/layouts/product_lines.html.erb" # Helpers assert_no_file "app/helpers/product_lines_helper.rb" assert_no_file "test/unit/helpers/product_lines_helper_test.rb" + + # Stylesheets (should not be removed) + assert_file "public/stylesheets/scaffold.css" end end diff --git a/railties/test/generators/stylesheets_generator_test.rb b/railties/test/generators/stylesheets_generator_test.rb new file mode 100644 index 0000000000..aaeb686daa --- /dev/null +++ b/railties/test/generators/stylesheets_generator_test.rb @@ -0,0 +1,17 @@ +require 'generators/generators_test_helper' +require 'rails/generators/rails/stylesheets/stylesheets_generator' + +class StylesheetsGeneratorTest < Rails::Generators::TestCase + include GeneratorsTestHelper + + def test_copy_stylesheets + run_generator + assert_file "public/stylesheets/scaffold.css" + end + + def test_stylesheets_are_not_deleted_on_revoke + run_generator + run_generator [], :behavior => :revoke + assert_file "public/stylesheets/scaffold.css" + end +end |