aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators/controller_generator_test.rb
diff options
context:
space:
mode:
authorwycats <wycats@gmail.com>2010-03-26 15:10:24 -0700
committerwycats <wycats@gmail.com>2010-03-26 15:10:24 -0700
commit197904341f2b2f21d69c653cede3aec124e86720 (patch)
tree83f1234e238016126860a929594db22e1862d783 /railties/test/generators/controller_generator_test.rb
parent76d2c455c0607b4cd5f238cadef8f933a18567fb (diff)
parentb3a0aed028835ce4551c4a76742744a40a71b0be (diff)
downloadrails-197904341f2b2f21d69c653cede3aec124e86720.tar.gz
rails-197904341f2b2f21d69c653cede3aec124e86720.tar.bz2
rails-197904341f2b2f21d69c653cede3aec124e86720.zip
Merge branch 'master' into docrails
Diffstat (limited to 'railties/test/generators/controller_generator_test.rb')
-rw-r--r--railties/test/generators/controller_generator_test.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/railties/test/generators/controller_generator_test.rb b/railties/test/generators/controller_generator_test.rb
index 79a4e5bf17..be99dc068d 100644
--- a/railties/test/generators/controller_generator_test.rb
+++ b/railties/test/generators/controller_generator_test.rb
@@ -1,10 +1,12 @@
require 'generators/generators_test_helper'
-require 'generators/rails/controller/controller_generator'
+require 'rails/generators/rails/controller/controller_generator'
class ControllerGeneratorTest < Rails::Generators::TestCase
include GeneratorsTestHelper
arguments %w(Account foo bar)
+ setup :copy_routes
+
def test_help_does_not_show_invoked_generators_options_if_they_already_exist
content = run_generator ["--help"]
assert_no_match /Helper options\:/, content
@@ -23,8 +25,6 @@ class ControllerGeneratorTest < Rails::Generators::TestCase
Object.send :remove_const, :ObjectController
end
- # No need to spec content since it's already spec'ed on helper generator.
- #
def test_invokes_helper
run_generator
assert_file "app/helpers/account_helper.rb"
@@ -49,8 +49,13 @@ class ControllerGeneratorTest < Rails::Generators::TestCase
def test_invokes_default_template_engine
run_generator
- assert_file "app/views/account/foo.html.erb", /app\/views\/account\/foo/
- assert_file "app/views/account/bar.html.erb", /app\/views\/account\/bar/
+ assert_file "app/views/account/foo.html.erb", %r(app/views/account/foo\.html\.erb)
+ assert_file "app/views/account/bar.html.erb", %r(app/views/account/bar\.html\.erb)
+ end
+
+ def test_add_routes
+ run_generator
+ assert_file "config/routes.rb", /get "account\/foo"/, /get "account\/bar"/
end
def test_invokes_default_template_engine_even_with_no_action