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 5fa87281ece411393cb167f03b1deda014a82593 1 parent cbfcabc
Arun Agrawal authored June 08, 2012
2  railties/lib/rails/generators/rails/plugin_new/templates/Rakefile
@@ -14,7 +14,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
14 14
   rdoc.rdoc_files.include('lib/**/*.rb')
15 15
 end
16 16
 
17  
-<% if full? && !options[:skip_active_record] -%>
  17
+<% if full? && !options[:skip_active_record] && !options[:skip_test_unit] -%>
18 18
 APP_RAKEFILE = File.expand_path("../<%= dummy_path -%>/Rakefile", __FILE__)
19 19
 load 'rails/tasks/engine.rake'
20 20
 <% end %>
8  railties/test/generators/plugin_new_generator_test.rb
@@ -58,6 +58,14 @@ def test_generating_test_files_in_full_mode
58 58
     assert_file "test/integration/navigation_test.rb", /ActionDispatch::IntegrationTest/
59 59
   end
60 60
 
  61
+  def test_generating_test_files_in_full_mode_without_unit_test_files
  62
+    run_generator [destination_root, "-T", "--full"]
  63
+
  64
+    assert_no_directory "test/integration/"
  65
+    assert_no_file "test"
  66
+    assert_no_match(/APP_RAKEFILE/, File.read(File.join(destination_root, "Rakefile")))
  67
+  end
  68
+
61 69
   def test_ensure_that_plugin_options_are_not_passed_to_app_generator
62 70
     FileUtils.cd(Rails.root)
63 71
     assert_no_match(/It works from file!.*It works_from_file/, run_generator([destination_root, "-m", "lib/template.rb"]))

0 notes on commit 5fa8728

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