grails.gorm.tests.QueryAfterPropertyChangeSpec.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grails-datastore-gorm-tck Show documentation
Show all versions of grails-datastore-gorm-tck Show documentation
GORM - Grails Data Access Framework
package grails.gorm.tests
/**
* @author graemerocher
*/
class QueryAfterPropertyChangeSpec extends GormDatastoreSpec {
void "Test that an entity is de-indexed after a change to an indexed property"() {
given:
def person = new Person(firstName:"Homer", lastName:"Simpson").save(flush:true)
when:
session.clear()
person = Person.findByFirstName("Homer")
then:
person != null
when:
person.firstName = "Marge"
person.save(flush:true)
session.clear()
person = Person.findByFirstName("Homer")
then:
Person.findByFirstName("Marge") != null
person == null
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy