Грабли портят базу данных разработки

Когда я бегу rake чтобы выполнить определенные / все тесты, он повреждает базу данных разработки.

Я проверил, что дБ для каждой среды отличается.

database.yml

postgre_common_config: &postgre_common_config
  adapter: postgresql
  encoding: unicode
  pool: 5
  username: postgres # if using default PostgreSQL user then the value should be: postgres
  password: postgres
  host: localhost

development:
  database: mag_development
  <<: *postgre_common_config

test:
  database: mag_test
  <<: *postgre_common_config

production:
  database: mag_production
  <<: *postgre_common_config

test_helper.rb

ENV['RAILS_ENV'] = 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'

class ActiveSupport::TestCase
  fixtures :all
end

Это действительно раздражает, так как требуется много времени для подготовки данных для тестирования конкретной функции вручную. Пожалуйста помоги.

0 ответов

Другие вопросы по тегам