meilisearch-ruby
meilisearch-ruby copied to clipboard
Make tests aware that keys does not require a description to be created
Some tests are affected if some Key leaks from other contexts, breaking some unrelated tests, like this:
3) MeiliSearch::Client - Keys When a client uses default key roles succeeds to get settings when using private key
Failure/Error: let(:admin_key) { client.keys['results'].find { |k| k['description'].start_with? 'Default Admin' } }
NoMethodError:
undefined method `start_with?' for nil:NilClass
let(:admin_key) { client.keys['results'].find { |k| k['description'].start_with? 'Default Admin' } }
- The idea is to make the usage of the description of the key optional.
Some possible changes (not required):
- We could remove the tests which rely on the order of the keys in the server and create keys when needed.
- We could also, make the keys disposable after each test (like a database_cleaner hook).