diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-04-05 14:49:06 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-04-05 14:49:06 -0700 |
commit | 91efe3958a7618db4030dd6ee5d8693145fb7b94 (patch) | |
tree | d0a54aae66db97b515738a1ab67e01b367dead18 /activerecord | |
parent | 2ac97df55230cdadce008a6b8993de52056779bb (diff) | |
parent | 01034d3be0d7c8c09b551ac612c4b18f86086dc5 (diff) | |
download | rails-91efe3958a7618db4030dd6ee5d8693145fb7b94.tar.gz rails-91efe3958a7618db4030dd6ee5d8693145fb7b94.tar.bz2 rails-91efe3958a7618db4030dd6ee5d8693145fb7b94.zip |
Merge branch 'railstest'
* railstest:
do not blow away the test database on every run
just check pending migrations in the current environment
check pending migrations against the test db
only match the default task
test no longer makes sense after requiring all test files
switch the testing tests to use rake
a test file can be provided to rake, e.g.:
switch to Rails::TestTask
default task should also be in the test env
ensure the schema checking is done in the dev connection
Revert "Update Rake tasks to call `rails test` instead"
Revert "Warning removed unused variable task_name"
apps that depend on active record should load fixtures
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index 78afed5e91..93bbeea5a3 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -166,7 +166,7 @@ db_namespace = namespace :db do end # desc "Raises an error if there are pending migrations" - task :abort_if_pending_migrations => [:environment, :load_config] do + task :abort_if_pending_migrations => :environment do pending_migrations = ActiveRecord::Migrator.open(ActiveRecord::Migrator.migrations_paths).pending_migrations if pending_migrations.any? @@ -347,7 +347,7 @@ db_namespace = namespace :db do end # desc 'Check for pending migrations and load the test schema' - task :prepare => 'db:abort_if_pending_migrations' do + task :prepare do unless ActiveRecord::Base.configurations.blank? db_namespace['test:load'].invoke end @@ -383,5 +383,5 @@ namespace :railties do end end -task 'test:prepare' => 'db:test:prepare' +task 'test:prepare' => ['db:test:prepare', 'db:test:load_schema', 'db:abort_if_pending_migrations'] |