Forum: Ruby on Rails Writing test cases for mysql errors

Posted by Sumit Srivastava (Guest)
on 2012-12-07 07:03
(Received via mailing list)
Hi,

I just encountered a MySql error for ambiguous columns. I fixed it but I
need to write test cases for such happenings to avoid any such instance 
in
future.

Regards,
Sumit
Posted by Colin Law (Guest)
on 2012-12-07 10:31
(Received via mailing list)
On 7 December 2012 06:02, Sumit Srivastava
<sumit.theinvincible@gmail.com> wrote:
> Hi,
>
> I just encountered a MySql error for ambiguous columns. I fixed it but I
> need to write test cases for such happenings to avoid any such instance in
> future.

You question is, ironically, ambiguous.  Can you give us a specific
example of the problem you want to test for.

Colin
Posted by sumit srivastava (Guest)
on 2012-12-07 11:17
(Received via mailing list)
On 7 December 2012 14:59, Colin Law <clanlaw@googlemail.com> wrote:

> example of the problem you want to test for.
>

I joined two tables. I missed to specify the table name for some columns 
in
the controller. I am using Jquery dataTables. This error arises only 
when
one searches for something on this table and then tries to sort it using
some specific column. So, if this column doesn't have table name 
specified
with it in the controller, it throws error.

Seems improbable to write a universal test case for this. Its more like 
a
syntactical error.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.