|
44 | 44 | Color => { q: 'bl' } |
45 | 45 | ) |
46 | 46 |
|
47 | | - expect(results).to contain_exactly( |
48 | | - steve_jobs, palm_pixi_plus, blue, black |
| 47 | + expect(results.to_h).to match( |
| 48 | + Book => [steve_jobs], |
| 49 | + Product => [palm_pixi_plus], |
| 50 | + Color => contain_exactly(blue, black) |
49 | 51 | ) |
50 | 52 | end |
51 | 53 | end |
|
69 | 71 | 'colors' => { q: 'bl', index_uid: Color.index.uid } |
70 | 72 | ) |
71 | 73 |
|
72 | | - expect(results).to contain_exactly( |
73 | | - a_hash_including('author' => 'Walter Isaacson', 'name' => 'Steve Jobs'), |
74 | | - a_hash_including('name' => 'palm pixi plus'), |
75 | | - a_hash_including('name' => 'blue', 'short_name' => 'blu'), |
76 | | - a_hash_including('name' => 'black', 'short_name' => 'bla') |
| 74 | + expect(results.to_h).to match( |
| 75 | + 'books' => [a_hash_including('author' => 'Walter Isaacson', 'name' => 'Steve Jobs')], |
| 76 | + 'products' => [a_hash_including('name' => 'palm pixi plus')], |
| 77 | + 'colors' => contain_exactly( |
| 78 | + a_hash_including('name' => 'blue', 'short_name' => 'blu'), |
| 79 | + a_hash_including('name' => 'black', 'short_name' => 'bla') |
| 80 | + ) |
77 | 81 | ) |
78 | 82 | end |
79 | 83 |
|
|
86 | 90 | 'nature_colors' => { q: 'green', index_uid: index_uid } |
87 | 91 | ) |
88 | 92 |
|
89 | | - expect(results).to contain_exactly( |
90 | | - a_hash_including('name' => 'blue', 'short_name' => 'blu'), |
91 | | - a_hash_including('name' => 'black', 'short_name' => 'bla'), |
92 | | - a_hash_including('name' => 'green', 'short_name' => 'gre') |
| 93 | + expect(results.to_h).to match( |
| 94 | + 'bright_colors' => [a_hash_including('name' => 'blue', 'short_name' => 'blu')], |
| 95 | + 'dark_colors' => [a_hash_including('name' => 'black', 'short_name' => 'bla')], |
| 96 | + 'nature_colors' => [a_hash_including('name' => 'green', 'short_name' => 'gre')] |
93 | 97 | ) |
94 | 98 | end |
95 | 99 |
|
|
101 | 105 | 'colors' => { q: 'bl', index_uid: Color.index.uid, class_name: 'Color' } |
102 | 106 | ) |
103 | 107 |
|
104 | | - expect(results).to contain_exactly( |
105 | | - steve_jobs, palm_pixi_plus, blue, black |
| 108 | + expect(results.to_h).to match( |
| 109 | + 'books' => [steve_jobs], |
| 110 | + 'products' => [palm_pixi_plus], |
| 111 | + 'colors' => contain_exactly(blue, black) |
106 | 112 | ) |
107 | 113 | end |
108 | 114 | end |
|
117 | 123 | Color.index.uid => { q: 'bl' } |
118 | 124 | ) |
119 | 125 |
|
120 | | - expect(results).to contain_exactly( |
121 | | - a_hash_including('author' => 'Walter Isaacson', 'name' => 'Steve Jobs'), |
122 | | - a_hash_including('name' => 'palm pixi plus'), |
123 | | - a_hash_including('name' => 'blue', 'short_name' => 'blu'), |
124 | | - a_hash_including('name' => 'black', 'short_name' => 'bla') |
| 126 | + expect(results.to_h).to match( |
| 127 | + Book.index.uid => [a_hash_including('author' => 'Walter Isaacson', 'name' => 'Steve Jobs')], |
| 128 | + Product.index.uid.to_sym => [a_hash_including('name' => 'palm pixi plus')], |
| 129 | + Color.index.uid => contain_exactly( |
| 130 | + a_hash_including('name' => 'blue', 'short_name' => 'blu'), |
| 131 | + a_hash_including('name' => 'black', 'short_name' => 'bla') |
| 132 | + ) |
125 | 133 | ) |
126 | 134 | end |
127 | 135 |
|
|
133 | 141 | Color.index.uid => { q: 'bl', class_name: 'Color' } |
134 | 142 | ) |
135 | 143 |
|
136 | | - expect(results).to contain_exactly( |
137 | | - steve_jobs, palm_pixi_plus, blue, black |
| 144 | + expect(results.to_h).to match( |
| 145 | + Book.index.uid => [steve_jobs], |
| 146 | + Product.index.uid.to_sym => [palm_pixi_plus], |
| 147 | + Color.index.uid => contain_exactly(blue, black) |
138 | 148 | ) |
139 | 149 | end |
140 | 150 |
|
|
158 | 168 | Color.index.uid => { q: 'bl' } |
159 | 169 | ) |
160 | 170 |
|
161 | | - expect(results).to contain_exactly( |
162 | | - steve_jobs, palm_pixi_plus, |
163 | | - a_hash_including('name' => 'blue', 'short_name' => 'blu'), |
164 | | - a_hash_including('name' => 'black', 'short_name' => 'bla') |
| 171 | + expect(results.to_h).to match( |
| 172 | + Book => [steve_jobs], |
| 173 | + Product.index_uid => [palm_pixi_plus], |
| 174 | + Color.index.uid => contain_exactly( |
| 175 | + a_hash_including('name' => 'blue', 'short_name' => 'blu'), |
| 176 | + a_hash_including('name' => 'black', 'short_name' => 'bla') |
| 177 | + ) |
165 | 178 | ) |
166 | 179 | end |
167 | 180 | end |
|
176 | 189 | Color.index.uid => { q: 'bl', page: 1, 'hitsPerPage' => '1' } |
177 | 190 | ) |
178 | 191 |
|
179 | | - expect(results).to contain_exactly( |
180 | | - steve_jobs, palm_pixi_plus, |
181 | | - a_hash_including('name' => 'black', 'short_name' => 'bla') |
| 192 | + expect(results.to_h).to match( |
| 193 | + Book => [steve_jobs], |
| 194 | + Product => [palm_pixi_plus], |
| 195 | + Color.index_uid => contain_exactly( |
| 196 | + a_hash_including('name' => 'black', 'short_name' => 'bla') |
| 197 | + ) |
182 | 198 | ) |
183 | 199 |
|
184 | 200 | MeiliSearch::Rails.configuration[:pagination_backend] = nil |
|
0 commit comments