Skip to content
This repository
Browse code

We should not include engine.rake file into rake

if we are passing -T which is skip_test_unit

See issue #6673 for more details.

I saw that we are not creating dummy app even if 
we do skip_test_unit. 

Fixes #6673
  • Loading branch information...
commit 8b1d475f9667e9ecc7478e8a01de912cca2a4497 1 parent fa352c4
Arun Agrawal authored June 08, 2012
2  railties/lib/rails/generators/rails/plugin_new/templates/Rakefile
@@ -20,7 +20,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
20 20
   rdoc.rdoc_files.include('lib/**/*.rb')
21 21
 end
22 22
 
23  
-<% if full? && !options[:skip_active_record] -%>
  23
+<% if full? && !options[:skip_active_record] && !options[:skip_test_unit] -%>
24 24
 APP_RAKEFILE = File.expand_path("../<%= dummy_path -%>/Rakefile", __FILE__)
25 25
 load 'rails/tasks/engine.rake'
26 26
 <% end %>
8  railties/test/generators/plugin_new_generator_test.rb
@@ -57,6 +57,14 @@ def test_generating_test_files_in_full_mode
57 57
     assert_file "test/integration/navigation_test.rb", /ActionDispatch::IntegrationTest/
58 58
   end
59 59
 
  60
+  def test_generating_test_files_in_full_mode_without_unit_test_files
  61
+    run_generator [destination_root, "-T", "--full"]
  62
+
  63
+    assert_no_directory "test/integration/"
  64
+    assert_no_file "test"
  65
+    assert_no_match(/APP_RAKEFILE/, File.read(File.join(destination_root, "Rakefile")))
  66
+  end
  67
+
60 68
   def test_ensure_that_plugin_options_are_not_passed_to_app_generator
61 69
     FileUtils.cd(Rails.root)
62 70
     assert_no_match(/It works from file!.*It works_from_file/, run_generator([destination_root, "-m", "lib/template.rb"]))

0 notes on commit 8b1d475

Please sign in to comment.
Something went wrong with that request. Please try again.