Forum: Ruby on Rails Help with Test

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9eb3f9018980d0ad0feae770b2971d8b?d=identicon&s=25 DBC User (Guest)
on 2007-06-11 17:58
(Received via mailing list)
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.
83ca41657a99b65d99889abe712ba5e2?d=identicon&s=25 Jason Roelofs (Guest)
on 2007-06-11 18:09
(Received via mailing list)
Rails uses a database by default. If you look in config/database.yml,
you'll
see what Rails is trying to connect to.

Jason
9eb3f9018980d0ad0feae770b2971d8b?d=identicon&s=25 DBC User (Guest)
on 2007-06-11 18:30
(Received via mailing list)
On Jun 11, 11:08 am, "Jason Roelofs" <jameskil...@gmail.com> 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.
83ca41657a99b65d99889abe712ba5e2?d=identicon&s=25 Jason Roelofs (Guest)
on 2007-06-11 18:32
(Received via mailing list)
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
9eb3f9018980d0ad0feae770b2971d8b?d=identicon&s=25 DBC User (Guest)
on 2007-06-11 18:35
(Received via mailing list)
On Jun 11, 11:31 am, "Jason Roelofs" <jameskil...@gmail.com> 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.
9eb3f9018980d0ad0feae770b2971d8b?d=identicon&s=25 DBC User (Guest)
on 2007-06-11 20:57
(Received via mailing list)
On Jun 11, 11:34 am, DBC User <dbcu...@gmail.com> 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.
83ca41657a99b65d99889abe712ba5e2?d=identicon&s=25 Jason Roelofs (Guest)
on 2007-06-11 21:39
(Received via mailing list)
Good to hear, now if we could just get it committed into Rails
itself....

Jason
This topic is locked and can not be replied to.