aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2010-11-02 14:07:58 +0100
committerPiotr Sarnacki <drogus@gmail.com>2010-11-02 17:14:52 +0100
commitb6497d3b5a84ca5e7e15700419ddf44c096c57a2 (patch)
treeff1c076ceb415db9481db7660b93d239fa034505 /railties
parent57fae9b2c7d193ec16baf38a8797588fb466db49 (diff)
downloadrails-b6497d3b5a84ca5e7e15700419ddf44c096c57a2.tar.gz
rails-b6497d3b5a84ca5e7e15700419ddf44c096c57a2.tar.bz2
rails-b6497d3b5a84ca5e7e15700419ddf44c096c57a2.zip
Skip active record properly in 'plugin new' generator
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/generators/rails/plugin_new/templates/test/test_helper.rb2
-rw-r--r--railties/test/generators/plugin_new_generator_test.rb1
2 files changed, 2 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/rails/plugin_new/templates/test/test_helper.rb b/railties/lib/rails/generators/rails/plugin_new/templates/test/test_helper.rb
index b42e45d544..dbcaf6b92f 100644
--- a/railties/lib/rails/generators/rails/plugin_new/templates/test/test_helper.rb
+++ b/railties/lib/rails/generators/rails/plugin_new/templates/test/test_helper.rb
@@ -6,7 +6,7 @@ require "rails/test_help"
Rails.backtrace_cleaner.remove_silencers!
-<% if full? -%>
+<% if full? && !options[:skip_active_record] -%>
# Run any available migration from application
ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
# and from engine
diff --git a/railties/test/generators/plugin_new_generator_test.rb b/railties/test/generators/plugin_new_generator_test.rb
index aebd954215..20c0d0a9bf 100644
--- a/railties/test/generators/plugin_new_generator_test.rb
+++ b/railties/test/generators/plugin_new_generator_test.rb
@@ -59,6 +59,7 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase
def test_ensure_that_skip_active_record_option_is_passed_to_app_generator
run_generator [destination_root, "--skip_active_record"]
assert_no_file "test/dummy/config/database.yml"
+ assert_no_match /ActiveRecord/, File.read(File.join(destination_root, "test/test_helper.rb"))
end
def test_ensure_that_database_option_is_passed_to_app_generator