# Help with Test

**URL:** <https://www.ruby-forum.com/t/help-with-test/106529>\
**Category:** Rails\
**Created:** [June 11, 2007, 5:58pm UTC](https://www.ruby-forum.com/t/help-with-test/106529 "2007-06-11T17:58:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![DBC\_User](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@DBC\_User](https://www.ruby-forum.com/u/DBC_User)\
**Post date:** [June 11, 2007, 5:58pm UTC](https://www.ruby-forum.com/t/help-with-test/106529/1 "2007-06-11T17:58:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DBC\_User](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@DBC\_User](https://www.ruby-forum.com/u/DBC_User)\
**Post date:** [June 11, 2007, 6:09pm UTC](https://www.ruby-forum.com/t/help-with-test/106529/2 "2007-06-11T18:09:46Z")

</div>

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

Jason

---

<div class="post-metadata">

**Author:** ![DBC\_User](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@DBC\_User](https://www.ruby-forum.com/u/DBC_User)\
**Post date:** [June 11, 2007, 6:30pm UTC](https://www.ruby-forum.com/t/help-with-test/106529/3 "2007-06-11T18:30:50Z")

</div>

On Jun 11, 11:08 am, “Jason R.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > 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.- Hide quoted text -
> 
> - Show quoted text -

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.

---

<div class="post-metadata">

**Author:** ![DBC\_User](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@DBC\_User](https://www.ruby-forum.com/u/DBC_User)\
**Post date:** [June 11, 2007, 6:32pm UTC](https://www.ruby-forum.com/t/help-with-test/106529/4 "2007-06-11T18:32:50Z")

</div>

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](http://dev.rubyonrails.org/ticket/7949)

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

Jason

---

<div class="post-metadata">

**Author:** ![DBC\_User](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@DBC\_User](https://www.ruby-forum.com/u/DBC_User)\
**Post date:** [June 11, 2007, 6:35pm UTC](https://www.ruby-forum.com/t/help-with-test/106529/5 "2007-06-11T18:35:51Z")

</div>

On Jun 11, 11:31 am, “Jason R.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > 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.- Hide quoted text -
> 
> - Show quoted text -  
> Excellent. Thanks for the info, thats what i was looking for.

---

<div class="post-metadata">

**Author:** ![DBC\_User](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@DBC\_User](https://www.ruby-forum.com/u/DBC_User)\
**Post date:** [June 11, 2007, 9:39pm UTC](https://www.ruby-forum.com/t/help-with-test/106529/6 "2007-06-11T21:39:27Z")

</div>

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

Jason

---

<div class="post-metadata">

**Author:** ![DBC\_User](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@DBC\_User](https://www.ruby-forum.com/u/DBC_User)\
**Post date:** [June 11, 2007, 8:57pm UTC](https://www.ruby-forum.com/t/help-with-test/106529/7 "2007-06-11T20:57:14Z")

</div>

On Jun 11, 11:34 am, DBC User [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > 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.- Hide quoted text -
> 
> > - Show quoted text -
> 
> Excellent. Thanks for the info, thats what i was looking for.- Hide quoted text -
> 
> - Show quoted text -

Yes I applied the patch is working excellent.  
Thanks.
