aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators
diff options
context:
space:
mode:
authortomhuda <tomhuda@strobecorp.com>2011-05-23 23:39:04 -0700
committerwycats <wycats@gmail.com>2011-05-24 16:04:28 -0700
commit74ade51eee5a7f975f98ab2f28c77f1a10119ff5 (patch)
tree5f614130a055ec33bc4abbc3f96a452047ab4c61 /railties/test/generators
parent88cb89056bbdf970031a85437265c45b4007d1b6 (diff)
downloadrails-74ade51eee5a7f975f98ab2f28c77f1a10119ff5.tar.gz
rails-74ade51eee5a7f975f98ab2f28c77f1a10119ff5.tar.bz2
rails-74ade51eee5a7f975f98ab2f28c77f1a10119ff5.zip
Move SCSS generators and default templates from Rails to the Sass Railtie (d435726312601edb3ba6f97b34f562221f72c1f8).
* 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
Diffstat (limited to 'railties/test/generators')
-rw-r--r--railties/test/generators/assets_generator_test.rb6
-rw-r--r--railties/test/generators/controller_generator_test.rb2
-rw-r--r--railties/test/generators/namespaced_generators_test.rb8
-rw-r--r--railties/test/generators/scaffold_generator_test.rb32
4 files changed, 24 insertions, 24 deletions
diff --git a/railties/test/generators/assets_generator_test.rb b/railties/test/generators/assets_generator_test.rb
index 375632e5bc..2d20982d04 100644
--- a/railties/test/generators/assets_generator_test.rb
+++ b/railties/test/generators/assets_generator_test.rb
@@ -9,17 +9,17 @@ class AssetsGeneratorTest < Rails::Generators::TestCase
def test_assets
run_generator
assert_file "app/assets/javascripts/posts.js.coffee"
- assert_file "app/assets/stylesheets/posts.css.scss"
+ 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.scss"
+ assert_no_file "app/assets/stylesheets/posts.css"
end
def test_vanilla_assets
- run_generator ["posts", "--no-javascript-engine", "--no-stylesheet-engine"]
+ run_generator ["posts", "--no-javascript-engine"]
assert_file "app/assets/javascripts/posts.js"
assert_file "app/assets/stylesheets/posts.css"
end
diff --git a/railties/test/generators/controller_generator_test.rb b/railties/test/generators/controller_generator_test.rb
index 46533b70be..3adf7be118 100644
--- a/railties/test/generators/controller_generator_test.rb
+++ b/railties/test/generators/controller_generator_test.rb
@@ -40,7 +40,7 @@ class ControllerGeneratorTest < Rails::Generators::TestCase
def test_invokes_assets
run_generator
assert_file "app/assets/javascripts/account.js.coffee"
- assert_file "app/assets/stylesheets/account.css.scss"
+ assert_file "app/assets/stylesheets/account.css"
end
def test_invokes_default_test_framework
diff --git a/railties/test/generators/namespaced_generators_test.rb b/railties/test/generators/namespaced_generators_test.rb
index 6f8a9b4280..17cbac0912 100644
--- a/railties/test/generators/namespaced_generators_test.rb
+++ b/railties/test/generators/namespaced_generators_test.rb
@@ -252,7 +252,7 @@ class NamespacedScaffoldGeneratorTest < NamespacedGeneratorTestCase
assert_file "test/unit/helpers/test_app/product_lines_helper_test.rb"
# Stylesheets
- assert_file "app/assets/stylesheets/scaffold.css.scss"
+ assert_file "app/assets/stylesheets/scaffold.css"
end
def test_scaffold_on_revoke
@@ -283,7 +283,7 @@ class NamespacedScaffoldGeneratorTest < NamespacedGeneratorTestCase
assert_no_file "test/unit/helpers/test_app/product_lines_helper_test.rb"
# Stylesheets (should not be removed)
- assert_file "app/assets/stylesheets/scaffold.css.scss"
+ assert_file "app/assets/stylesheets/scaffold.css"
end
def test_scaffold_with_namespace_on_invoke
@@ -324,7 +324,7 @@ class NamespacedScaffoldGeneratorTest < NamespacedGeneratorTestCase
assert_file "test/unit/helpers/test_app/admin/roles_helper_test.rb"
# Stylesheets
- assert_file "app/assets/stylesheets/scaffold.css.scss"
+ assert_file "app/assets/stylesheets/scaffold.css"
end
def test_scaffold_with_namespace_on_revoke
@@ -356,6 +356,6 @@ class NamespacedScaffoldGeneratorTest < NamespacedGeneratorTestCase
assert_no_file "test/unit/helpers/test_app/admin/roles_helper_test.rb"
# Stylesheets (should not be removed)
- assert_file "app/assets/stylesheets/scaffold.css.scss"
+ assert_file "app/assets/stylesheets/scaffold.css"
end
end
diff --git a/railties/test/generators/scaffold_generator_test.rb b/railties/test/generators/scaffold_generator_test.rb
index 4b07f8bcbe..2135ffac81 100644
--- a/railties/test/generators/scaffold_generator_test.rb
+++ b/railties/test/generators/scaffold_generator_test.rb
@@ -80,9 +80,9 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
assert_file "test/unit/helpers/product_lines_helper_test.rb"
# Assets
- assert_file "app/assets/stylesheets/scaffold.css.scss"
+ assert_file "app/assets/stylesheets/scaffold.css"
assert_file "app/assets/javascripts/product_lines.js.coffee"
- assert_file "app/assets/stylesheets/product_lines.css.scss"
+ assert_file "app/assets/stylesheets/product_lines.css"
end
def test_scaffold_on_revoke
@@ -113,9 +113,9 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
assert_no_file "test/unit/helpers/product_lines_helper_test.rb"
# Assets
- assert_file "app/assets/stylesheets/scaffold.css.scss", /&:visited/
+ assert_file "app/assets/stylesheets/scaffold.css", /:visited/
assert_no_file "app/assets/javascripts/product_lines.js.coffee"
- assert_no_file "app/assets/stylesheets/product_lines.css.scss"
+ assert_no_file "app/assets/stylesheets/product_lines.css"
end
def test_scaffold_with_namespace_on_invoke
@@ -189,9 +189,9 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
assert_file "test/unit/helpers/admin/roles_helper_test.rb"
# Assets
- assert_file "app/assets/stylesheets/scaffold.css.scss", /&:visited/
+ assert_file "app/assets/stylesheets/scaffold.css", /:visited/
assert_file "app/assets/javascripts/admin/roles.js.coffee"
- assert_file "app/assets/stylesheets/admin/roles.css.scss"
+ assert_file "app/assets/stylesheets/admin/roles.css"
end
def test_scaffold_with_namespace_on_revoke
@@ -223,9 +223,9 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
assert_no_file "test/unit/helpers/admin/roles_helper_test.rb"
# Assets
- assert_file "app/assets/stylesheets/scaffold.css.scss"
+ assert_file "app/assets/stylesheets/scaffold.css"
assert_no_file "app/assets/javascripts/admin/roles.js.coffee"
- assert_no_file "app/assets/stylesheets/admin/roles.css.scss"
+ assert_no_file "app/assets/stylesheets/admin/roles.css"
end
def test_scaffold_generator_on_revoke_does_not_mutilate_legacy_map_parameter
@@ -245,27 +245,27 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
def test_scaffold_generator_no_assets
run_generator [ "posts", "--no-assets" ]
- assert_file "app/assets/stylesheets/scaffold.css.scss"
+ assert_file "app/assets/stylesheets/scaffold.css"
assert_no_file "app/assets/javascripts/posts.js.coffee"
- assert_no_file "app/assets/stylesheets/posts.css.scss"
+ assert_no_file "app/assets/stylesheets/posts.css"
end
def test_scaffold_generator_no_stylesheets
run_generator [ "posts", "--no-stylesheets" ]
- assert_no_file "app/assets/stylesheets/scaffold.css.scss"
+ assert_no_file "app/assets/stylesheets/scaffold.css"
assert_file "app/assets/javascripts/posts.js.coffee"
- assert_no_file "app/assets/stylesheets/posts.css.scss"
+ assert_no_file "app/assets/stylesheets/posts.css"
end
def test_scaffold_generator_no_javascripts
run_generator [ "posts", "--no-javascripts" ]
- assert_file "app/assets/stylesheets/scaffold.css.scss"
+ assert_file "app/assets/stylesheets/scaffold.css"
assert_no_file "app/assets/javascripts/posts.js.coffee"
- assert_file "app/assets/stylesheets/posts.css.scss"
+ assert_file "app/assets/stylesheets/posts.css"
end
- def test_scaffold_generator_no_negines
- run_generator [ "posts", "--no-javascript-engine", "--no-stylesheet-engine" ]
+ def test_scaffold_generator_no_engines
+ run_generator [ "posts", "--no-javascript-engine" ]
assert_file "app/assets/stylesheets/scaffold.css"
assert_file "app/assets/javascripts/posts.js"
assert_file "app/assets/stylesheets/posts.css"