|
4 | 4 | def reset_indexes |
5 | 5 | [Book, Color, Product].each do |klass| |
6 | 6 | klass.delete_all |
7 | | - klass.clear_index! |
| 7 | + klass.clear_index!(true) |
8 | 8 | end |
9 | 9 | end |
10 | 10 |
|
11 | | - before { reset_indexes } |
12 | | - |
13 | | - let!(:palm_pixi_plus) { Product.create!(name: 'palm pixi plus', href: 'ebay', tags: ['terrible']) } |
14 | | - let!(:steve_jobs) { Book.create! name: 'Steve Jobs', author: 'Walter Isaacson' } |
15 | | - let!(:blue) { Color.create!(name: 'blue', short_name: 'blu', hex: 0x0000FF) } |
16 | | - let!(:black) { Color.create!(name: 'black', short_name: 'bla', hex: 0x000000) } |
17 | | - |
18 | 11 | before do |
| 12 | + reset_indexes |
| 13 | + |
| 14 | + Product.create! name: 'palm pixi plus', href: 'ebay', tags: ['terrible'] |
19 | 15 | Product.create! name: 'lg vortex', href: 'ebay', tags: ['decent'] |
20 | 16 | Product.create! name: 'palmpre', href: 'ebay', tags: ['discontinued', 'worst phone ever'] |
21 | 17 | Product.reindex! |
22 | 18 |
|
| 19 | + Color.create! name: 'blue', short_name: 'blu', hex: 0x0000FF |
| 20 | + Color.create! name: 'black', short_name: 'bla', hex: 0x000000 |
23 | 21 | Color.create! name: 'green', short_name: 'gre', hex: 0x00FF00 |
| 22 | + |
| 23 | + Book.create! name: 'Steve Jobs', author: 'Walter Isaacson' |
24 | 24 | Book.create! name: 'Moby Dick', author: 'Herman Melville' |
25 | 25 | end |
26 | 26 |
|
| 27 | + let!(:palm_pixi_plus) { Product.find_by name: 'palm pixi plus' } |
| 28 | + let!(:steve_jobs) { Book.find_by name: 'Steve Jobs' } |
| 29 | + let!(:blue) { Color.find_by name: 'blue' } |
| 30 | + let!(:black) { Color.find_by name: 'black' } |
| 31 | + |
27 | 32 | context 'with class keys' do |
28 | 33 | it 'returns ORM records' do |
29 | 34 | results = MeiliSearch::Rails.multi_search( |
@@ -96,7 +101,7 @@ def reset_indexes |
96 | 101 | end |
97 | 102 |
|
98 | 103 | context 'with pagination' do |
99 | | - it 'it properly paginates each search' do |
| 104 | + it 'properly paginates each search' do |
100 | 105 | MeiliSearch::Rails.configuration[:pagination_backend] = :kaminari |
101 | 106 |
|
102 | 107 | results = MeiliSearch::Rails.multi_search( |
|
0 commit comments