Help with Test

Hi,

I created a rails project named 'Hi'. I didn't do anything in it except 1. Rails Hi 2. Ruby script/generate controller hi

thats it.

Now I went to Test\funcational folder and run the Hi_controller_test.rb and I am getting 2 MySql Error even though I am not using MySql in this project at all.

Could some one tell me what am I doing wrong?

Thanks.

Rails uses a database by default. If you look in config/database.yml, you’ll see what Rails is trying to connect to.

Jason

Thanks and yes I did find the database.yml where when I entered valid database information it worked. But my question is, what if I am writing a program which doesn't use database at all, how can I exclude the mysql from my testing instead of creating a dummy database.

You need to hack Rails itself. I submitted a patch that allows doing this by just removing database.yml:

http://dev.rubyonrails.org/ticket/7949

though as it’s yet to be accepted you’ll have to apply the patch yourself.

Jason

Excellent. Thanks for the info, thats what i was looking for.

Yes I applied the patch is working excellent. Thanks.

Good to hear, now if we could just get it committed into Rails itself…

Jason