|
1 | 1 | # frozen_string_literal: true |
2 | 2 |
|
3 | | -RSpec.describe 'MeiliSearch::Client - Indexes' do |
| 3 | +RSpec.describe 'Meilisearch::Client - Indexes' do |
4 | 4 | describe '#create_index' do |
5 | 5 | context 'without a primary key' do |
6 | 6 | it 'creates an index' do |
|
9 | 9 | task.await |
10 | 10 |
|
11 | 11 | index = client.fetch_index('books') |
12 | | - expect(index).to be_a(MeiliSearch::Index) |
| 12 | + expect(index).to be_a(Meilisearch::Index) |
13 | 13 | expect(index.uid).to eq('books') |
14 | 14 | expect(index.primary_key).to be_nil |
15 | 15 | end |
16 | 16 |
|
17 | 17 | context 'synchronously' do |
18 | 18 | context 'using ! method' do |
19 | | - before { allow(MeiliSearch::Utils).to receive(:soft_deprecate).and_return(nil) } |
| 19 | + before { allow(Meilisearch::Utils).to receive(:soft_deprecate).and_return(nil) } |
20 | 20 |
|
21 | 21 | it 'creates an index' do |
22 | 22 | task = client.create_index!('books') |
|
26 | 26 |
|
27 | 27 | index = client.fetch_index('books') |
28 | 28 |
|
29 | | - expect(index).to be_a(MeiliSearch::Index) |
| 29 | + expect(index).to be_a(Meilisearch::Index) |
30 | 30 | expect(index.uid).to eq('books') |
31 | 31 | expect(index.primary_key).to be_nil |
32 | 32 | end |
33 | 33 |
|
34 | 34 | it 'warns about deprecation' do |
35 | 35 | client.create_index!('books') |
36 | | - expect(MeiliSearch::Utils) |
| 36 | + expect(Meilisearch::Utils) |
37 | 37 | .to have_received(:soft_deprecate) |
38 | 38 | .with('Client#create_index!', a_string_including('books')) |
39 | 39 | end |
|
48 | 48 |
|
49 | 49 | index = client.fetch_index('books') |
50 | 50 |
|
51 | | - expect(index).to be_a(MeiliSearch::Index) |
| 51 | + expect(index).to be_a(Meilisearch::Index) |
52 | 52 | expect(index.uid).to eq('books') |
53 | 53 | expect(index.primary_key).to be_nil |
54 | 54 | end |
|
64 | 64 | task.await |
65 | 65 |
|
66 | 66 | index = client.fetch_index('books') |
67 | | - expect(index).to be_a(MeiliSearch::Index) |
| 67 | + expect(index).to be_a(Meilisearch::Index) |
68 | 68 | expect(index.uid).to eq('books') |
69 | 69 | expect(index.primary_key).to eq('reference_code') |
70 | 70 | expect(index.fetch_primary_key).to eq('reference_code') |
|
78 | 78 |
|
79 | 79 | index = client.fetch_index('books') |
80 | 80 |
|
81 | | - expect(index).to be_a(MeiliSearch::Index) |
| 81 | + expect(index).to be_a(Meilisearch::Index) |
82 | 82 | expect(index.uid).to eq('books') |
83 | 83 | expect(index.primary_key).to eq('reference_code') |
84 | 84 | expect(index.fetch_primary_key).to eq('reference_code') |
|
91 | 91 | task.await |
92 | 92 |
|
93 | 93 | index = client.fetch_index('books') |
94 | | - expect(index).to be_a(MeiliSearch::Index) |
| 94 | + expect(index).to be_a(Meilisearch::Index) |
95 | 95 | expect(index.uid).to eq('books') |
96 | 96 | expect(index.primary_key).to eq('reference_code') |
97 | 97 | expect(index.fetch_primary_key).to eq('reference_code') |
|
110 | 110 | task.await |
111 | 111 |
|
112 | 112 | index = client.fetch_index('books') |
113 | | - expect(index).to be_a(MeiliSearch::Index) |
| 113 | + expect(index).to be_a(Meilisearch::Index) |
114 | 114 | expect(index.uid).to eq('books') |
115 | 115 | expect(index.primary_key).to eq('reference_code') |
116 | 116 | expect(index.fetch_primary_key).to eq('reference_code') |
|
141 | 141 | end |
142 | 142 |
|
143 | 143 | describe '#indexes' do |
144 | | - it 'returns MeiliSearch::Index objects' do |
| 144 | + it 'returns Meilisearch::Index objects' do |
145 | 145 | client.create_index('books').await |
146 | 146 |
|
147 | 147 | index = client.indexes['results'].first |
148 | 148 |
|
149 | | - expect(index).to be_a(MeiliSearch::Index) |
| 149 | + expect(index).to be_a(Meilisearch::Index) |
150 | 150 | end |
151 | 151 |
|
152 | 152 | it 'gets a list of indexes' do |
|
201 | 201 |
|
202 | 202 | fetched_index = client.fetch_index('books') |
203 | 203 |
|
204 | | - expect(fetched_index).to be_a(MeiliSearch::Index) |
| 204 | + expect(fetched_index).to be_a(Meilisearch::Index) |
205 | 205 | expect(fetched_index.uid).to eq('books') |
206 | 206 | expect(fetched_index.primary_key).to eq('reference_code') |
207 | 207 | expect(fetched_index.fetch_primary_key).to eq('reference_code') |
|
230 | 230 | # this index is in memory, without metadata from server |
231 | 231 | index = client.index('books') |
232 | 232 |
|
233 | | - expect(index).to be_a(MeiliSearch::Index) |
| 233 | + expect(index).to be_a(Meilisearch::Index) |
234 | 234 | expect(index.uid).to eq('books') |
235 | 235 | expect(index.primary_key).to be_nil |
236 | 236 |
|
|
0 commit comments