0
votes

I am trying to make test for model rake test and I got this error,

AdapterNotSpecified: database configuration does not specify adapter

my database.yml spec is:

development:
 adapter: mysql2
 database: adel_development
 encoding: utf8
 pool: 5
 username: root
 timeout: 5000
 socket: /tmp/mysql.sock

production:
 adapter: mysql2
 database: adel_development
 pool: 5
 timeout: 5000

what's going on any help

note: I was using qlite3 and changed to mysql2

1

1 Answers

1
votes

You need to define a test environment in your database.yml file:

development:
  adapter: mysql2
  database: adel_test
  encoding: utf8
  pool: 5
  username: root
  timeout: 5000
  socket: /tmp/mysql.sock

You'll then need to create this database adel_test and to launch rake db:test:prepare