Permalink
Browse files

fix sporadic failing test

Person.list().first() might return not only Person instances, subclasses (e.g. Employee) are also returned causing the assertions to fail.
  • Loading branch information...
1 parent ee4c40b commit 4645863423521703c7b7943356148e05ad3b19ec @sarmbruster committed Mar 26, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 test/unit/grails/plugin/formfields/DomainClassPropertyAccessorSpec.groovy
@@ -214,7 +214,7 @@ class DomainClassPropertyAccessorSpec extends Specification {
@Issue('https://github.com/robfletcher/grails-fields/issues/38')
void "label keys for '#property' are '#labels'"() {
given:
- def bean = beanType.list().first()
+ def bean = beanType.list().find { it.class == beanType}
def propertyAccessor = factory.accessorFor(bean, property)
expect:

0 comments on commit 4645863

Please sign in to comment.