list_command.rs 680 B

123456789101112131415161718192021222324252627
  1. mod common;
  2. use common::*;
  3. const COLLECTION: &str = "Search";
  4. #[test]
  5. fn should_list_all_words() {
  6. let bucket = "suggest_nearest";
  7. let title = "Sweet Teriyaki Beef Skewers";
  8. let dest = Dest::col_buc(COLLECTION, bucket);
  9. let ingest_channel = ingest_start();
  10. ingest_channel
  11. .push(PushRequest::new(dest.clone().obj("1"), title))
  12. .unwrap();
  13. consolidate();
  14. let search_channel = search_start();
  15. match search_channel.list(ListRequest::new(dest.clone())) {
  16. Ok(object_ids) => assert_eq!(object_ids, vec!["beef", "skewers", "sweet", "teriyaki"]),
  17. Err(_) => unreachable!(),
  18. }
  19. flush_bucket(COLLECTION, bucket);
  20. }