Skip to content

Commit

Permalink
add test for no rows satisfying filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Venisa Correia committed Sep 8, 2016
1 parent 53fffd5 commit baf6b86
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,14 @@ class JobsServletSpec extends Specification {
GroovyTestUtils.compareJson(result, expectedResponse, JsonSortStrategy.SORT_BOTH)
}

def "jobs endpoint returns an empty list when none of the JobRows satisfy the filter"() {
when: "We send a request to the /jobs endpoint with a valid filters parameter"
String result = makeRequest("/jobs", [filters : ["userId-eq[pikachu]"]])

then: "We only get the job payload that satisfies the filter"
GroovyTestUtils.compareJson(result, "{\"jobs\":[]}", JsonSortStrategy.SORT_BOTH)
}

String makeRequest(String target) {
makeRequest(target, [:])
}
Expand Down

0 comments on commit baf6b86

Please sign in to comment.