|
71 | 71 | subject.set(index: ExampleIndex, entity: item2)
|
72 | 72 | subject.set(index: ExampleIndex, entity: item5)
|
73 | 73 | index_item1 = subject.get(index: ExampleIndex, id: item1.id)
|
74 |
| - expect(index_item1[:_source][:id]).to eq item1.id |
75 |
| - expect(index_item1[:_source][:name]).to eq item1.name |
76 |
| - expect(index_item1[:_source][:timestamp]).to eq item1.timestamp |
77 |
| - expect(index_item1[:_source][:number]).to eq item1.number |
| 74 | + expect(index_item1[:id]).to eq item1.id |
| 75 | + expect(index_item1[:name]).to eq item1.name |
| 76 | + expect(index_item1[:timestamp]).to eq item1.timestamp |
| 77 | + expect(index_item1[:number]).to eq item1.number |
78 | 78 | index_item2 = subject.get(index: ExampleIndex, id: item2.id)
|
79 |
| - expect(index_item2[:_source][:id]).to eq item2.id |
80 |
| - expect(index_item2[:_source][:name]).to eq item2.name |
81 |
| - expect(index_item2[:_source][:timestamp]).to eq item2.timestamp |
82 |
| - expect(index_item2[:_source][:number]).to eq item2.number |
| 79 | + expect(index_item2[:id]).to eq item2.id |
| 80 | + expect(index_item2[:name]).to eq item2.name |
| 81 | + expect(index_item2[:timestamp]).to eq item2.timestamp |
| 82 | + expect(index_item2[:number]).to eq item2.number |
83 | 83 | subject.drop(index: ExampleIndex, id: item1.id)
|
84 | 84 | expect(subject.get(index: ExampleIndex, id: item1.id)).to be_nil
|
85 | 85 | end
|
|
92 | 92 | subject.set(index: ExampleIndex, entity: item1)
|
93 | 93 | subject.set(index: ExampleIndex, entity: item1.tap { |i| i.timestamp += 100 }, op_type: 'create')
|
94 | 94 | index_item1 = subject.get(index: ExampleIndex, id: item1.id)
|
95 |
| - expect(index_item1[:_source][:id]).to eq item1.id |
96 |
| - expect(index_item1[:_source][:name]).to eq item1.name |
97 |
| - expect(index_item1[:_source][:timestamp]).to eq original_timestamp |
98 |
| - expect(index_item1[:_source][:number]).to eq item1.number |
| 95 | + expect(index_item1[:id]).to eq item1.id |
| 96 | + expect(index_item1[:name]).to eq item1.name |
| 97 | + expect(index_item1[:timestamp]).to eq original_timestamp |
| 98 | + expect(index_item1[:number]).to eq item1.number |
99 | 99 | end
|
100 | 100 | end
|
101 | 101 |
|
|
0 commit comments