Skip to content

Commit

Permalink
Make the tests easier to read and maintain (#64)
Browse files Browse the repository at this point in the history
* Add forgotten tests

* Simplify GET tests for Settings

* Add attribtuesForFaceting in tests

* Simplify UPDATE tests for Settings

* Rename wrong variables
  • Loading branch information
curquiza authored Oct 8, 2020
1 parent 0bcbdb4 commit 7f3c1a4
Show file tree
Hide file tree
Showing 3 changed files with 173 additions and 560 deletions.
4 changes: 4 additions & 0 deletions Sources/MeiliSearch/Model/Setting.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ public struct Setting: Codable, Equatable {
/// Optional distinct attribute set for a given `Index`.
public let distinctAttribute: String?

/// List of attributes used for the faceting
public let attributesForFaceting: [String]

}

extension Setting {
Expand All @@ -39,6 +42,7 @@ extension Setting {
stopWords = (try? values?.decodeIfPresent([String].self, forKey: .stopWords)) ?? []
synonyms = (try? values?.decodeIfPresent([String: [String]].self, forKey: .synonyms)) ?? [:]
distinctAttribute = try? values?.decodeIfPresent(String.self, forKey: .distinctAttribute)
attributesForFaceting = (try? values?.decodeIfPresent([String].self, forKey: .attributesForFaceting)) ?? []
}

}
Loading

0 comments on commit 7f3c1a4

Please sign in to comment.