How to configure the schema_search_path in the test environment?

2

When I run the rake spec --trace command I have the error a below. It seems to me that rake does not create the schema I want in the test environment because it does not identify my schema configuration in database.yml. I've been researching and seen that I can do an automated task to create the schema before creating the tables, but I was thinking that this should be a common problem for many people. Why rake is not reading my settings in database.yml from schema_search_path? I believe you must have a correct and easy way to do this. Any ideas

DATABASE.YML

test:
  adapter: postgresql
  encoding: unicode
  database: sist_teste
  schema_search_path: adm_sist
  username: postgres
  password: postgres
  host: localhost

ERROR:

rake spec --trace
** Invoke spec (first_time)
** Invoke spec:prepare (first_time)
** Execute spec:prepare
** Invoke test:prepare (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:abort_if_pending_migrations
** Execute db:test:prepare
** Invoke db:test:load (first_time)
** Invoke db:test:purge (first_time)
** Invoke environment 
** Invoke db:load_config 
** Execute db:test:purge
** Execute db:test:load
** Invoke db:test:load_schema (first_time)
** Invoke db:test:purge 
** Execute db:test:load_schema
** Invoke db:schema:load (first_time)
** Invoke environment 
** Invoke db:load_config 
** Execute db:schema:load
rake aborted!
ActiveRecord::StatementInvalid: PG::InvalidParameterValue: ERROR:  invalid value for parameter "search_path": "adm_sist"
DETAIL:  schema "adm_sist" does not exist
: SET search_path TO adm_sist
    
asked by anonymous 24.11.2014 / 12:41

0 answers