Grails Testing hickups

Posted by egervari on Stack Overflow See other posts from Stack Overflow or by egervari
Published on 2010-05-20T04:19:00Z Indexed on 2010/05/20 4:20 UTC
Read the original article Hit count: 368

Filed under:
|

I have two testing questions. Both are probably easily answered. The first is that I wrote this unit test in Grails:

void testCount() {
    mockDomain(UserAccount)

    new UserAccount(firstName: "Ken").save()
    new UserAccount(firstName: "Bob").save()
    new UserAccount(firstName: "Dave").save()

    assertEquals(3, UserAccount.count())
}

For some reason, I get 0 returned back. Did I forget to do something?

The second question is for those who use IDEA. What should I be running - IDEA's junit tests, or grails targets? I have two options.

Also, why does IDEA say that my tests pass and it provides a green light even though the test above actually fails? This will really drive me nuts if I have to check the test reports in html every time I run my tests.....

Help?

© Stack Overflow or respective owner

Related posts about grails

Related posts about testing