diff options
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/migration_test.rb | 4 | ||||
-rw-r--r-- | activerecord/test/cases/tasks/database_tasks_test.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index 2f7859a7be..bd60b64ee2 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -380,7 +380,7 @@ class MigrationTest < ActiveRecord::TestCase old_path = ActiveRecord::Migrator.migrations_paths ActiveRecord::Migrator.migrations_paths = migrations_path - assert_equal current_env, ActiveRecord::InternalMetadata.value_for("environment") + assert_equal current_env, ActiveRecord::InternalMetadata[:environment] original_rails_env = ENV["RAILS_ENV"] original_rack_env = ENV["RACK_ENV"] @@ -391,7 +391,7 @@ class MigrationTest < ActiveRecord::TestCase sleep 1 # mysql by default does not store fractional seconds in the database ActiveRecord::Migrator.up(migrations_path) - assert_equal new_env, ActiveRecord::InternalMetadata.value_for("environment") + assert_equal new_env, ActiveRecord::InternalMetadata[:environment] ensure ActiveRecord::Migrator.migrations_paths = old_path ENV["RAILS_ENV"] = original_rails_env diff --git a/activerecord/test/cases/tasks/database_tasks_test.rb b/activerecord/test/cases/tasks/database_tasks_test.rb index e91a222534..326373791c 100644 --- a/activerecord/test/cases/tasks/database_tasks_test.rb +++ b/activerecord/test/cases/tasks/database_tasks_test.rb @@ -23,7 +23,7 @@ module ActiveRecord ActiveRecord::Migrator.stubs(:current_version).returns(1) protected_environments = ActiveRecord::Base.protected_environments.dup - current_env = ActiveRecord::ConnectionHandling::DEFAULT_ENV.call + current_env = ActiveRecord::Migrator.current_environment assert !protected_environments.include?(current_env) # Assert no error ActiveRecord::Tasks::DatabaseTasks.check_protected_environments! |