fix for review

This commit is contained in:
qdequele 2020-01-29 18:30:21 +01:00
parent 14b5fc4d6c
commit a5b0e468ee
No known key found for this signature in database
GPG key ID: B3F0A000EBF11745
48 changed files with 558 additions and 1216 deletions

View file

@ -1,4 +1,3 @@
#![allow(dead_code)]
use serde_json::Value;
use std::error::Error;
use std::time::Duration;
@ -64,8 +63,8 @@ pub fn enrich_server_with_movies_settings(
"dsc(vote_average)",
],
"rankingDistinct": null,
"attributeIdentifier": "id",
"attributesSearchable": [
"identifier": "id",
"searchableAttributes": [
"title",
"tagline",
"overview",
@ -75,7 +74,7 @@ pub fn enrich_server_with_movies_settings(
"production_companies",
"genres",
],
"attributesDisplayed": [
"displayedAttributes": [
"title",
"director",
"producer",

View file

@ -3,7 +3,6 @@ use async_std::task::block_on;
use http_service::Body;
use serde_json::json;
use serde_json::Value;
use std::convert::Into;
mod common;

View file

@ -636,8 +636,8 @@ fn search_with_settings_basic() {
"dsc(vote_average)"
],
"rankingDistinct": null,
"attributeIdentifier": "id",
"attributesSearchable": [
"identifier": "id",
"searchableAttributes": [
"title",
"tagline",
"overview",
@ -647,7 +647,7 @@ fn search_with_settings_basic() {
"production_companies",
"genres"
],
"attributesDisplayed": [
"displayedAttributes": [
"title",
"director",
"producer",
@ -742,8 +742,8 @@ fn search_with_settings_stop_words() {
"dsc(vote_average)"
],
"rankingDistinct": null,
"attributeIdentifier": "id",
"attributesSearchable": [
"identifier": "id",
"searchableAttributes": [
"title",
"tagline",
"overview",
@ -753,7 +753,7 @@ fn search_with_settings_stop_words() {
"production_companies",
"genres"
],
"attributesDisplayed": [
"displayedAttributes": [
"title",
"director",
"producer",
@ -849,8 +849,8 @@ fn search_with_settings_synonyms() {
"dsc(vote_average)"
],
"rankingDistinct": null,
"attributeIdentifier": "id",
"attributesSearchable": [
"identifier": "id",
"searchableAttributes": [
"title",
"tagline",
"overview",
@ -860,7 +860,7 @@ fn search_with_settings_synonyms() {
"production_companies",
"genres"
],
"attributesDisplayed": [
"displayedAttributes": [
"title",
"director",
"producer",
@ -961,8 +961,8 @@ fn search_with_settings_ranking_rules() {
"dsc(popularity)"
],
"rankingDistinct": null,
"attributeIdentifier": "id",
"attributesSearchable": [
"identifier": "id",
"searchableAttributes": [
"title",
"tagline",
"overview",
@ -972,7 +972,7 @@ fn search_with_settings_ranking_rules() {
"production_companies",
"genres"
],
"attributesDisplayed": [
"displayedAttributes": [
"title",
"director",
"producer",
@ -1052,7 +1052,7 @@ fn search_with_settings_ranking_rules() {
}
#[test]
fn search_with_settings_attributes_searchable() {
fn search_with_settings_searchable_attributes() {
let mut server = common::setup_server().unwrap();
common::enrich_server_with_movies_index(&mut server).unwrap();
@ -1068,8 +1068,8 @@ fn search_with_settings_attributes_searchable() {
"dsc(vote_average)"
],
"rankingDistinct": null,
"attributeIdentifier": "id",
"attributesSearchable": [
"identifier": "id",
"searchableAttributes": [
"tagline",
"overview",
"cast",
@ -1078,7 +1078,7 @@ fn search_with_settings_attributes_searchable() {
"production_companies",
"genres"
],
"attributesDisplayed": [
"displayedAttributes": [
"title",
"director",
"producer",
@ -1158,7 +1158,7 @@ fn search_with_settings_attributes_searchable() {
}
#[test]
fn search_with_settings_attributes_displayed() {
fn search_with_settings_displayed_attributes() {
let mut server = common::setup_server().unwrap();
common::enrich_server_with_movies_index(&mut server).unwrap();
@ -1174,8 +1174,8 @@ fn search_with_settings_attributes_displayed() {
"dsc(vote_average)"
],
"rankingDistinct": null,
"attributeIdentifier": "id",
"attributesSearchable": [
"identifier": "id",
"searchableAttributes": [
"title",
"tagline",
"overview",
@ -1185,7 +1185,7 @@ fn search_with_settings_attributes_displayed() {
"production_companies",
"genres"
],
"attributesDisplayed": [
"displayedAttributes": [
"title",
"tagline",
"id",
@ -1229,7 +1229,7 @@ fn search_with_settings_attributes_displayed() {
}
#[test]
fn search_with_settings_attributes_searchable_2() {
fn search_with_settings_searchable_attributes_2() {
let mut server = common::setup_server().unwrap();
common::enrich_server_with_movies_index(&mut server).unwrap();
@ -1245,8 +1245,8 @@ fn search_with_settings_attributes_searchable_2() {
"dsc(vote_average)"
],
"rankingDistinct": null,
"attributeIdentifier": "id",
"attributesSearchable": [
"identifier": "id",
"searchableAttributes": [
"tagline",
"overview",
"title",
@ -1256,7 +1256,7 @@ fn search_with_settings_attributes_searchable_2() {
"production_companies",
"genres"
],
"attributesDisplayed": [
"displayedAttributes": [
"title",
"tagline",
"id",

View file

@ -50,8 +50,8 @@ fn write_all_and_delete() {
"dsc(rank)",
],
"rankingDistinct": "movie_id",
"attributeIdentifier": "uid",
"attributesSearchable": [
"identifier": "uid",
"searchableAttributes": [
"uid",
"movie_id",
"title",
@ -60,7 +60,7 @@ fn write_all_and_delete() {
"release_date",
"rank",
],
"attributesDisplayed": [
"displayedAttributes": [
"title",
"description",
"poster",
@ -128,9 +128,9 @@ fn write_all_and_delete() {
let json = json!({
"rankingRules": null,
"rankingDistinct": null,
"attributeIdentifier": null,
"attributesSearchable": null,
"attributesDisplayed": null,
"identifier": null,
"searchableAttributes": null,
"displayedAttributes": null,
"stopWords": null,
"synonyms": null,
"indexNewFields": null,
@ -179,8 +179,8 @@ fn write_all_and_update() {
"dsc(rank)",
],
"rankingDistinct": "movie_id",
"attributeIdentifier": "uid",
"attributesSearchable": [
"identifier": "uid",
"searchableAttributes": [
"uid",
"movie_id",
"title",
@ -189,7 +189,7 @@ fn write_all_and_update() {
"release_date",
"rank",
],
"attributesDisplayed": [
"displayedAttributes": [
"title",
"description",
"poster",
@ -244,13 +244,13 @@ fn write_all_and_update() {
"_exact",
"dsc(release_date)",
],
"attributeIdentifier": "uid",
"attributesSearchable": [
"identifier": "uid",
"searchableAttributes": [
"title",
"description",
"uid",
],
"attributesDisplayed": [
"displayedAttributes": [
"title",
"description",
"release_date",
@ -299,13 +299,13 @@ fn write_all_and_update() {
"dsc(release_date)",
],
"rankingDistinct": null,
"attributeIdentifier": "uid",
"attributesSearchable": [
"identifier": "uid",
"searchableAttributes": [
"title",
"description",
"uid",
],
"attributesDisplayed": [
"displayedAttributes": [
"title",
"description",
"release_date",

View file

@ -1,4 +1,3 @@
use std::convert::Into;
use std::time::Duration;
use assert_json_diff::assert_json_eq;
@ -26,7 +25,7 @@ fn write_all_and_delete() {
let body = json!({
"uid": "movies",
"attributeIdentifier": "uid",
"identifier": "uid",
})
.to_string()
.into_bytes();
@ -123,7 +122,7 @@ fn write_all_and_update() {
let body = json!({
"uid": "movies",
"attributeIdentifier": "uid",
"identifier": "uid",
})
.to_string()
.into_bytes();