aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-06-26 20:42:00 +0200
committerJosé Valim <jose.valim@gmail.com>2009-06-26 20:42:00 +0200
commite375819b76ac04bc60fd516b15bbe42c093eb547 (patch)
treeeb5ef93fdc0f2f381c34c20662314e0038c1f822
parent95a5cc6167ce8ff57d90190d3e21f49abb1eb060 (diff)
downloadrails-e375819b76ac04bc60fd516b15bbe42c093eb547.tar.gz
rails-e375819b76ac04bc60fd516b15bbe42c093eb547.tar.bz2
rails-e375819b76ac04bc60fd516b15bbe42c093eb547.zip
Spec --no and --skip.
-rw-r--r--railties/lib/generators/rails/controller/USAGE1
-rw-r--r--railties/test/generators/controller_generator_test.rb13
2 files changed, 12 insertions, 2 deletions
diff --git a/railties/lib/generators/rails/controller/USAGE b/railties/lib/generators/rails/controller/USAGE
index b714d061d2..6ed4b2edfc 100644
--- a/railties/lib/generators/rails/controller/USAGE
+++ b/railties/lib/generators/rails/controller/USAGE
@@ -16,4 +16,3 @@ Example:
Functional Test: test/functional/credit_card_controller_test.rb
Views: app/views/credit_card/debit.html.erb [...]
Helper: app/helpers/credit_card_helper.rb
- Helper Test: test/unit/helpers/credit_card_helper_test.rb
diff --git a/railties/test/generators/controller_generator_test.rb b/railties/test/generators/controller_generator_test.rb
index 88b54a54ed..e10580f40f 100644
--- a/railties/test/generators/controller_generator_test.rb
+++ b/railties/test/generators/controller_generator_test.rb
@@ -20,17 +20,28 @@ class ControllerGeneratorTest < GeneratorsTestCase
assert_match /The name 'ObjectController' is either already used in your application or reserved/, content
end
- def test_invokes_helpers
+ def test_invokes_helper
run_generator
assert_file "app/helpers/account_helper.rb"
assert_file "test/unit/helpers/account_helper_test.rb"
end
+ def test_does_not_invoke_helper_if_required
+ run_generator ["account", "--skip-helper"]
+ assert_no_file "app/helpers/account_helper.rb"
+ assert_no_file "test/unit/helpers/account_helper_test.rb"
+ end
+
def test_invokes_default_test_framework
run_generator
assert_file "test/functional/account_controller_test.rb"
end
+ def test_does_not_invoke_test_framework_if_required
+ run_generator ["account", "--no-test-framework"]
+ assert_no_file "test/functional/account_controller_test.rb"
+ end
+
def test_invokes_default_template_engine
run_generator
assert_file "app/views/account/foo.html.erb", /app\/views\/account\/foo/