Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class DetachedCriteriaSpec extends GrailsDataTckSpec {
when: 'A detached criteria instance is created and the list method used with the max parameter'
def criteria = new DetachedCriteria(Person)
criteria.with {
eq('lastName', 'Simpson')
eq 'lastName', 'Simpson'
}
def results = criteria.list(max: 2)

Expand All @@ -45,7 +45,7 @@ class DetachedCriteriaSpec extends GrailsDataTckSpec {
when: 'A detached criteria instance is created and the list method used with the max parameter'
criteria = new DetachedCriteria(Person)
criteria.with {
eq('lastName', 'Simpson')
eq 'lastName', 'Simpson'
}
results = criteria.list(offset: 2, max: 4)

Expand All @@ -63,7 +63,7 @@ class DetachedCriteriaSpec extends GrailsDataTckSpec {
when: 'A detached criteria instance is created that uses a property projection'
def criteria = new DetachedCriteria(Person)
criteria.with {
eq('lastName', 'Simpson')
eq 'lastName', 'Simpson'
}
criteria = criteria.property('firstName')

Expand All @@ -75,7 +75,7 @@ class DetachedCriteriaSpec extends GrailsDataTckSpec {
when: 'A detached criteria instance is created that uses a property projection using property missing'
criteria = new DetachedCriteria(Person)
criteria.with {
eq('lastName', 'Simpson')
eq 'lastName', 'Simpson'
}
criteria = criteria.firstName

Expand All @@ -93,7 +93,7 @@ class DetachedCriteriaSpec extends GrailsDataTckSpec {
when: 'A detached criteria instance is created matching the last name'
def criteria = new DetachedCriteria(Person)
criteria.with {
eq('lastName', 'Simpson')
eq 'lastName', 'Simpson'
}

then: 'The count method returns the right results'
Expand All @@ -106,7 +106,7 @@ class DetachedCriteriaSpec extends GrailsDataTckSpec {

when: 'A detached criteria is created that deletes all matching records'
def criteria = new DetachedCriteria(Person).build {
eq('lastName', 'Simpson')
eq 'lastName', 'Simpson'
}
int total = criteria.updateAll(lastName: 'Bloggs')
then: 'The number of deletions is correct'
Expand All @@ -122,7 +122,7 @@ class DetachedCriteriaSpec extends GrailsDataTckSpec {

when: 'A detached criteria is created that deletes all matching records'
def criteria = new DetachedCriteria(Person).build {
eq('lastName', 'Simpson')
eq 'lastName', 'Simpson'
}
int total = criteria.deleteAll()

Expand All @@ -137,7 +137,7 @@ class DetachedCriteriaSpec extends GrailsDataTckSpec {

when: 'A detached criteria is created that matches the last name and then iterated over'
def criteria = new DetachedCriteria(Person).build {
eq('lastName', 'Simpson')
eq 'lastName', 'Simpson'
}
int total = 0
criteria.each {
Expand All @@ -155,7 +155,7 @@ class DetachedCriteriaSpec extends GrailsDataTckSpec {
when: 'A detached criteria instance is created matching the last name'
def criteria = new DetachedCriteria(Person)
criteria.with {
eq('lastName', 'Simpson')
eq 'lastName', 'Simpson'
}

def result = criteria.findByFirstNameLike('B%')
Expand All @@ -172,11 +172,11 @@ class DetachedCriteriaSpec extends GrailsDataTckSpec {
when: 'A detached criteria instance is created matching the last name'
def criteria = new DetachedCriteria(Person)
criteria.with {
eq('lastName', 'Simpson')
eq 'lastName', 'Simpson'
}

def result = criteria.get {
like('firstName', 'B%')
like 'firstName', 'B%'
}
then: 'The list method returns the right results'
result != null
Expand All @@ -190,11 +190,11 @@ class DetachedCriteriaSpec extends GrailsDataTckSpec {
when: 'A detached criteria instance is created matching the last name'
def criteria = new DetachedCriteria(Person)
criteria.with {
eq('lastName', 'Simpson')
eq 'lastName', 'Simpson'
}

def results = criteria.list {
like('firstName', 'B%')
like 'firstName', 'B%'
}
then: 'The list method returns the right results'
results.size() == 1
Expand All @@ -215,11 +215,11 @@ class DetachedCriteriaSpec extends GrailsDataTckSpec {
when: 'A detached criteria instance is created matching the last name and count is called with additional criteria'
def criteria = new DetachedCriteria(Person)
criteria.with {
eq('lastName', 'Simpson')
eq 'lastName', 'Simpson'
}

def result = criteria.count {
like('firstName', 'B%')
like 'firstName', 'B%'
}
then: 'The count method returns the right results'
result == 1
Expand All @@ -233,7 +233,7 @@ class DetachedCriteriaSpec extends GrailsDataTckSpec {
when: 'A detached criteria instance is created matching the last name'
def criteria = new DetachedCriteria(Person)
criteria.with {
eq('lastName', 'Simpson')
eq 'lastName', 'Simpson'
}

def result = criteria.count()
Expand All @@ -249,7 +249,7 @@ class DetachedCriteriaSpec extends GrailsDataTckSpec {
when: 'A detached criteria instance is created matching the last name'
def criteria = new DetachedCriteria(Person)
criteria.with {
eq('lastName', 'Simpson')
eq 'lastName', 'Simpson'
}

def results = criteria.list()
Expand All @@ -265,7 +265,7 @@ class DetachedCriteriaSpec extends GrailsDataTckSpec {
when: 'A detached criteria instance is created matching the last name'
def criteria = new DetachedCriteria(Person)
criteria = criteria.build {
eq('lastName', 'Simpson')
eq 'lastName', 'Simpson'
}

def results = criteria.list(max: 2)
Expand Down
Loading