|
25 | 25 | end |
26 | 26 |
|
27 | 27 | it "returns collections" do |
28 | | - expect(collections.list.dig('result', 'collections').count).to eq(1) |
| 28 | + expect(collections.list.dig("result", "collections").count).to eq(1) |
29 | 29 | end |
30 | 30 | end |
31 | 31 |
|
|
40 | 40 |
|
41 | 41 | it "returns the collection" do |
42 | 42 | response = collections.get(collection_name: "test_collection") |
43 | | - expect(response.dig('result', 'status')).to eq('green') |
| 43 | + expect(response.dig("result", "status")).to eq("green") |
44 | 44 | end |
45 | 45 | end |
46 | 46 |
|
|
77 | 77 |
|
78 | 78 | it "returns the schema" do |
79 | 79 | response = collections.delete(collection_name: "test_collection") |
80 | | - expect(response.dig('status')).to eq('ok') |
81 | | - expect(response.dig('result')).to eq(true) |
| 80 | + expect(response.dig("status")).to eq("ok") |
| 81 | + expect(response.dig("result")).to eq(true) |
82 | 82 | end |
83 | 83 | end |
84 | 84 |
|
|
98 | 98 | replication_factor: 1 |
99 | 99 | } |
100 | 100 | ) |
101 | | - expect(response.dig('status')).to eq('ok') |
102 | | - expect(response.dig('result')).to eq(true) |
| 101 | + expect(response.dig("status")).to eq("ok") |
| 102 | + expect(response.dig("result")).to eq(true) |
103 | 103 | end |
104 | 104 | end |
105 | 105 |
|
|
116 | 116 | response = collections.update_aliases( |
117 | 117 | actions: [{ |
118 | 118 | create_alias: { |
119 | | - collection_name: 'test_collection', |
120 | | - alias_name: 'alias_test_collection' |
| 119 | + collection_name: "test_collection", |
| 120 | + alias_name: "alias_test_collection" |
121 | 121 | } |
122 | 122 | }] |
123 | 123 | ) |
124 | | - expect(response.dig('status')).to eq('ok') |
125 | | - expect(response.dig('result')).to eq(true) |
| 124 | + expect(response.dig("status")).to eq("ok") |
| 125 | + expect(response.dig("result")).to eq(true) |
126 | 126 | end |
127 | 127 | end |
128 | 128 |
|
|
137 | 137 |
|
138 | 138 | it "returns the schema" do |
139 | 139 | response = collections.aliases(collection_name: "test_collection") |
140 | | - expect(response.dig('result', 'aliases').count).to eq(1) |
| 140 | + expect(response.dig("result", "aliases").count).to eq(1) |
141 | 141 | end |
142 | 142 | end |
143 | 143 |
|
|
156 | 156 | field_name: "description", |
157 | 157 | field_schema: "text" |
158 | 158 | ) |
159 | | - expect(response.dig('status')).to eq('ok') |
160 | | - expect(response.dig('result')).to eq(true) |
| 159 | + expect(response.dig("status")).to eq("ok") |
| 160 | + expect(response.dig("result")).to eq(true) |
161 | 161 | end |
162 | 162 | end |
163 | 163 |
|
|
175 | 175 | collection_name: "test_collection", |
176 | 176 | field_name: "description" |
177 | 177 | ) |
178 | | - expect(response.dig('status')).to eq('ok') |
179 | | - expect(response.dig('result')).to eq(true) |
| 178 | + expect(response.dig("status")).to eq("ok") |
| 179 | + expect(response.dig("result")).to eq(true) |
180 | 180 | end |
181 | 181 | end |
182 | 182 |
|
|
193 | 193 | response = collections.cluster_info( |
194 | 194 | collection_name: "test_collection" |
195 | 195 | ) |
196 | | - expect(response.dig('result', 'peer_id')).to eq(111) |
| 196 | + expect(response.dig("result", "peer_id")).to eq(111) |
197 | 197 | end |
198 | 198 | end |
199 | 199 |
|
|
210 | 210 | response = collections.update_cluster( |
211 | 211 | collection_name: "test_collection", |
212 | 212 | move_shard: { |
213 | | - shard_id: 0, |
214 | | - to_peer_id: 222, |
215 | | - from_peer_id: 111 |
| 213 | + shard_id: 0, |
| 214 | + to_peer_id: 222, |
| 215 | + from_peer_id: 111 |
216 | 216 | } |
217 | 217 | ) |
218 | | - expect(response.dig('status')).to eq('ok') |
219 | | - expect(response.dig('result')).to eq(true) |
| 218 | + expect(response.dig("status")).to eq("ok") |
| 219 | + expect(response.dig("result")).to eq(true) |
220 | 220 | end |
221 | 221 | end |
222 | 222 |
|
|
233 | 233 | response = collections.list_snapshots( |
234 | 234 | collection_name: "test_collection" |
235 | 235 | ) |
236 | | - expect(response.dig('result').count).to eq(2) |
| 236 | + expect(response.dig("result").count).to eq(2) |
237 | 237 | end |
238 | 238 | end |
239 | 239 |
|
|
252 | 252 | response = collections.create_snapshot( |
253 | 253 | collection_name: "test_collection" |
254 | 254 | ) |
255 | | - expect(response.dig('status')).to eq('ok') |
256 | | - expect(response.dig('result', 'name')).to eq("test_collection-6106351684939824381-2023-04-06-20-43-03.snapshot") |
| 255 | + expect(response.dig("status")).to eq("ok") |
| 256 | + expect(response.dig("result", "name")).to eq("test_collection-6106351684939824381-2023-04-06-20-43-03.snapshot") |
257 | 257 | end |
258 | 258 | end |
259 | 259 |
|
|
271 | 271 | collection_name: "test_collection", |
272 | 272 | snapshot_name: "test_collection-6106351684939824381-2023-04-06-20-43-03.snapshot" |
273 | 273 | ) |
274 | | - expect(response.dig('status')).to eq('ok') |
275 | | - expect(response.dig('result')).to eq(true) |
| 274 | + expect(response.dig("status")).to eq("ok") |
| 275 | + expect(response.dig("result")).to eq(true) |
276 | 276 | end |
277 | 277 | end |
278 | 278 |
|
|
283 | 283 | allow_any_instance_of(Faraday::Connection).to receive(:get) |
284 | 284 | .with("collections/test_collection/snapshots/test_collection-6106351684939824381-2023-04-06-20-43-03.snapshot") |
285 | 285 | .and_return(response) |
286 | | - |
287 | | - allow(File).to receive(:open).with("/dir/snapshot.txt", 'wb+').and_return(999) |
| 286 | + |
| 287 | + allow(File).to receive(:open).with("/dir/snapshot.txt", "wb+").and_return(999) |
288 | 288 | end |
289 | 289 |
|
290 | 290 | it "returns the schema" do |
|
311 | 311 | collection_name: "test_collection", |
312 | 312 | filepath: "test_collection-6106351684939824381-2023-04-06-20-43-03.snapshot" |
313 | 313 | ) |
314 | | - expect(response.dig('status')).to eq('ok') |
315 | | - expect(response.dig('result')).to eq(true) |
| 314 | + expect(response.dig("status")).to eq("ok") |
| 315 | + expect(response.dig("result")).to eq(true) |
316 | 316 | end |
317 | 317 | end |
318 | 318 | end |
0 commit comments