diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-07-16 17:45:28 -0500 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-07-16 17:45:28 -0500 |
commit | 73ade4fe100ae7f48c5f95dcdf7067f6a0cd51fa (patch) | |
tree | 2f1601292978a844226e16f3cef428ed760b9eb5 /railties/test | |
parent | 8fe01de2e8753d045408ecde3178ab4e9192bf9a (diff) | |
parent | 90c930f45c5c6766306929241462ffff8f67b86e (diff) | |
download | rails-73ade4fe100ae7f48c5f95dcdf7067f6a0cd51fa.tar.gz rails-73ade4fe100ae7f48c5f95dcdf7067f6a0cd51fa.tar.bz2 rails-73ade4fe100ae7f48c5f95dcdf7067f6a0cd51fa.zip |
Resolved conflict
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/generators/generator_test_helper.rb | 2 | ||||
-rw-r--r-- | railties/test/generators/rails_controller_generator_test.rb | 19 |
2 files changed, 20 insertions, 1 deletions
diff --git a/railties/test/generators/generator_test_helper.rb b/railties/test/generators/generator_test_helper.rb index 05dca3400e..80d5b145be 100644 --- a/railties/test/generators/generator_test_helper.rb +++ b/railties/test/generators/generator_test_helper.rb @@ -226,7 +226,7 @@ class GeneratorTestCase < Test::Unit::TestCase end end - # Asserts that the given fixtures yaml file was generated. + # Asserts that the given fixtures YAML file was generated. # It takes a fixture name without the <tt>.yml</tt> part. # The parsed YAML tree is passed to a block. def assert_generated_fixtures_for(name) 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 |