aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators/controller_generator_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-03-19 18:11:37 +0100
committerJosé Valim <jose.valim@gmail.com>2010-03-19 18:12:54 +0100
commit562154fcbc8f36f94c986a3253c73ae88e2c1146 (patch)
tree69f03eef669c16786dc71385decacfa6e856a06c /railties/test/generators/controller_generator_test.rb
parent541194f641c960efe739b16f76999f47742d12ba (diff)
downloadrails-562154fcbc8f36f94c986a3253c73ae88e2c1146.tar.gz
rails-562154fcbc8f36f94c986a3253c73ae88e2c1146.tar.bz2
rails-562154fcbc8f36f94c986a3253c73ae88e2c1146.zip
Controller generator now creates routes as well [#4233 state:resolved]
Diffstat (limited to 'railties/test/generators/controller_generator_test.rb')
-rw-r--r--railties/test/generators/controller_generator_test.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/railties/test/generators/controller_generator_test.rb b/railties/test/generators/controller_generator_test.rb
index 79a4e5bf17..14773373af 100644
--- a/railties/test/generators/controller_generator_test.rb
+++ b/railties/test/generators/controller_generator_test.rb
@@ -5,6 +5,8 @@ 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"
@@ -53,6 +53,11 @@ class ControllerGeneratorTest < Rails::Generators::TestCase
assert_file "app/views/account/bar.html.erb", /app\/views\/account\/bar/
end
+ def test_add_routes
+ run_generator
+ assert_file "config/routes.rb", /get "\/account\/foo" => "account#foo"/, /get "\/account\/bar" => "account#bar"/
+ end
+
def test_invokes_default_template_engine_even_with_no_action
run_generator ["account"]
assert_file "app/views/account"