test(integration): Make sure we can search for math symbols

This commit is contained in:
Pixelastic 2018-03-01 18:38:40 +01:00
parent 2d2598cc46
commit 79320b8f5d
3 changed files with 27 additions and 4 deletions

View File

@ -16,21 +16,38 @@ describe('pushed index') do
context 'by default' do
let(:distinct) { nil }
it { should eq 21 }
it { should eq 22 }
end
context 'with distinct:true' do
let(:distinct) { true }
it { should eq 21 }
it { should eq 22 }
end
context 'with distinct:false' do
let(:distinct) { false }
it { should eq 52 }
it { should eq 53 }
end
end
# https://github.com/algolia/jekyll-algolia/issues/49
describe 'attributesToSnippet' do
# https://github.com/algolia/jekyll-algolia/issues/49
subject { @index.get_settings['attributesToSnippet'] }
it { should eq ['content:10'] }
end
# https://github.com/algolia/jekyll-algolia/issues/45
describe 'UTF-8 search' do
subject { @index.search(keyword)['hits'][0]['title'] }
context '∀' do
let(:keyword) { '∀' }
it { should eq 'Math symbols' }
end
context 'λ' do
let(:keyword) { 'λ' }
it { should eq 'Math symbols' }
end
context '→' do
let(:keyword) { '→' }
it { should eq 'Math symbols' }
end
end
end

View File

@ -12,6 +12,7 @@ algolia:
- excluded_dir/*.html
settings:
attributesToSnippet: ['content:10']
separatorsToIndex: '∀λ→'
# Jekyll 3.0 extracted the secondary features into their own plugins
plugins:

5
spec/site/math.md Normal file
View File

@ -0,0 +1,5 @@
---
title: Math symbols
---
This is a math text, with symbols like ∀, λ, →