fix(node): Do not push the node to the index

This commit is contained in:
Pixelastic 2016-06-28 15:42:14 +02:00
parent 40f326aa68
commit 7a52a36aee
2 changed files with 12 additions and 0 deletions

View File

@ -152,6 +152,7 @@ class AlgoliaSearchRecordExtractor
items = []
raw_items.each do |raw_item|
nokogiri_node = raw_item[:node]
raw_item.delete(:node)
item = shared_attributes.merge(raw_item)
item = custom_hook_each(item, nokogiri_node)

View File

@ -350,6 +350,17 @@ describe(AlgoliaSearchRecordExtractor) do
expect(actual[0][:name]).to eq 'foo'
end
it 'should not expose the HTML node' do
# Given
input = fixture_only_paragraphs
# When
actual = input.extract
# Then
expect(actual[0][:node]).to eq nil
end
it 'should get a complete record' do
# Given
input = fixture_page