Changeset 860
- Timestamp:
- Aug 30, 2010, 3:13:30 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/BootStrap.groovy
r858 r860 115 115 116 116 // If in development mode and no studies are present, add example studies 117 if (Study.count() == 0 ) { // && grails.util.GrailsUtil.environment == GrailsApplication.ENV_DEVELOPMENT) {117 if (Study.count() == 0 && grails.util.GrailsUtil.environment != GrailsApplication.ENV_TEST) { 118 118 // check if special file is present in project directory 119 119 if ((new File(System.properties['user.dir']+"/.skip-studies").exists())) { -
trunk/test/integration/gscf/SampleTests.groovy
r817 r860 291 291 } 292 292 293 /** 294 * Test whether it's indeed not possible to add two yet-to-be-saved samples with the same name to a yet-to-be-saved study 295 */ 296 void testSampleUniqueNameConstraintAtValidate() { 297 def sample = Sample.findByName(testSampleName) 298 assert sample 299 300 def study = sample.parent 301 assert study 302 303 def sample1 = new Sample( 304 name: testSampleName + "-double", 305 template: sample.template, 306 parentEvent: sample.parentEvent 307 ) 308 309 def sample2 = new Sample( 310 name: testSampleName + "-double", 311 template: sample.template, 312 parentEvent: sample.parentEvent 313 ) 314 315 // Add the sample to the retrieved parent study 316 study.addToSamples(sample1) 317 study.addToSamples(sample2) 318 319 // At this point, the sample should not validate or save, because there is already a sample with that name in the study 320 assert !sample1.validate() 321 assert !sample1.save(flush:true) 322 323 assert !sample2.validate() 324 assert !sample2.save(flush:true) 325 } 326 293 327 void testFindViaSamplingEvent() { 294 328 // Try to retrieve the sampling event by using the time...
Note: See TracChangeset
for help on using the changeset viewer.