Skip active record properly in 'plugin new' generator

This commit is contained in:
Piotr Sarnacki 2010-11-02 14:07:58 +01:00
parent 57fae9b2c7
commit b6497d3b5a
2 changed files with 2 additions and 1 deletions

View File

@ -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

View File

@ -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