I want rake test: units to successfully run tests in a prepared test database while my development database is down. Rails is currently trying to create a test database from a development database. Is it possible?
I got into a situation where prod / dev databases are disconnected from the host, but for unit tests I use sqlite in the memory database.
EDIT for my exact actions: Note. I am using Rails 2.3
My test database is configured like this: config / database.yml:
test: adapter: sqlite3 database: 'sqlite3_unittest_file.dat' pool: 5 timeout: 5000
When I run rake db:test:load
, the test database (which is just a file) is generated correctly in the rails-root directory. And when I run rake test:units
, everything works.
Now, if I edited database.yml
to set my DEV database name so that something is wrong (for example, 'sdlkfj'), rake test:units
could not instantly complain:
Access denied for user 'sdlkfj'@'myhostnsmae' (using password: YES)
When I run this assembly "really", I run it on a system where the assembly is not allowed to speak in the field during the assembly process. Therefore, this attempt to talk to the developer base and instantly croak is killing me and seems wrong.
source share