Added spec for the getDocuments function