diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-07-11 12:09:25 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-07-11 12:09:25 -0500 |
commit | c00baf496ef40d09962aabcb63d6d319cb8a0584 (patch) | |
tree | 203102125f42826c9cf9da04f64ebd35233661ec /railties/test/generators | |
parent | f522a89d6447da306778b67353adaf679c26bbd1 (diff) | |
download | rails-c00baf496ef40d09962aabcb63d6d319cb8a0584.tar.gz rails-c00baf496ef40d09962aabcb63d6d319cb8a0584.tar.bz2 rails-c00baf496ef40d09962aabcb63d6d319cb8a0584.zip |
Added tests to show that 2d372d7 breaks old generator behavior (#545 state:resolved)
Diffstat (limited to 'railties/test/generators')
-rw-r--r-- | railties/test/generators/rails_controller_generator_test.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/railties/test/generators/rails_controller_generator_test.rb b/railties/test/generators/rails_controller_generator_test.rb index 0090d21b85..8304fb5a01 100644 --- a/railties/test/generators/rails_controller_generator_test.rb +++ b/railties/test/generators/rails_controller_generator_test.rb @@ -17,4 +17,23 @@ class RailsControllerGeneratorTest < GeneratorTestCase assert_generated_functional_test_for "admin::products" assert_generated_helper_for "admin::products" end + + def test_controller_generates_namespaced_and_not_namespaced_controllers + run_generator('controller', %w(products)) + + # We have to require the generated helper to show the problem because + # the test helpers just check for generated files and contents but + # do not actually load them. But they have to be loaded (as in a real environment) + # to make the second generator run fail + require "#{RAILS_ROOT}/app/helpers/products_helper" + + assert_nothing_raised do + begin + run_generator('controller', %w(admin::products)) + ensure + # cleanup + Object.send(:remove_const, :ProductsHelper) + end + end + end end |