public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Added tests to show that 2d372d7 breaks old generator behavior (#545 
state:resolved)
josh (author)
Fri Jul 11 10:09:25 -0700 2008
commit  c00baf496ef40d09962aabcb63d6d319cb8a0584
tree    203102125f42826c9cf9da04f64ebd35233661ec
parent  f522a89d6447da306778b67353adaf679c26bbd1
...
17
18
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
...
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
0
@@ -17,4 +17,23 @@ class RailsControllerGeneratorTest < GeneratorTestCase
0
     assert_generated_functional_test_for "admin::products"
0
     assert_generated_helper_for "admin::products"
0
   end
0
+
0
+  def test_controller_generates_namespaced_and_not_namespaced_controllers
0
+      run_generator('controller', %w(products))
0
+
0
+      # We have to require the generated helper to show the problem because
0
+      # the test helpers just check for generated files and contents but
0
+      # do not actually load them. But they have to be loaded (as in a real environment)
0
+      # to make the second generator run fail
0
+      require "#{RAILS_ROOT}/app/helpers/products_helper"
0
+
0
+      assert_nothing_raised do
0
+        begin
0
+          run_generator('controller', %w(admin::products))
0
+        ensure
0
+          # cleanup
0
+          Object.send(:remove_const, :ProductsHelper)
0
+        end
0
+      end
0
+  end
0
 end

Comments