It is quite easy to prepare test environment the same as the development one. Just use Bootstrap. class BootstrappedTests extends GroovyTestCase { void testBootstrap() { new BootStrap().init(null) assert MyDomain.count() == 5 // Perform your tests here } }
Month: June 2008
Custom iterative tag in Grails with named variable
I will show you how to create an iterative Grails tag that can contain another tag. The inner tag will use variable of the iterative tag. So, we are going to implement a tag that creates n links ‘/show/1’, ‘/show/2’, etc. with description ‘Article number 1’, ‘Article number 2’ etc.: First of all, there is… Continue reading Custom iterative tag in Grails with named variable