candlepin/candlepin — pull request #316 by jmrodri (2013-07-09 20:16:46+00:00)
Title: make deleted consumers call more predictable

the deleted_consumer spec test would fail on occasion. Best guess is that the
first item in the returned list doesn't necessarily have to be the latest
because the query doesn't sort the list at all. I added a descending
sort order on created date which is the date the deleted consumer record was
created. By doing a descending sort we ensure that the first record is
always the latest deleted consumer. Made a minor tweak to the spec test to
look at the length of the list on the variable instead of making a second
call to the API. And we were erroneously checking that we only got one
record back which isn't always the case.