This test comes back true but I don't see anything in your method that sorts the elements by completion date. They are added to the tasks array as they are created so they'll be sorted that way by default but if they were reordered at some point completed_tasks won't put them back in order.