diff options
author | Caleb <caleb.tutty@nzherald.co.nz> | 2015-04-20 23:02:46 +1200 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2015-05-28 12:54:52 +0100 |
commit | e5b7bbb72d8f2f0a0c04e84778b19b431051d9b3 (patch) | |
tree | dcfa615bc334673f66a38bd4d730b0e43b2cdd85 /spec/integration | |
parent | 8a831333d28bc4bb33631c8a31934c2313ddc912 (diff) |
Fix encoding issue with searching for macrons
Correct indentation to be consistent
Diffstat (limited to 'spec/integration')
-rw-r--r-- | spec/integration/xapian_search_highlighting_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/integration/xapian_search_highlighting_spec.rb b/spec/integration/xapian_search_highlighting_spec.rb index 65a34cf91..c0834a2c1 100644 --- a/spec/integration/xapian_search_highlighting_spec.rb +++ b/spec/integration/xapian_search_highlighting_spec.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe 'highlighting search results' do @@ -36,4 +38,13 @@ describe 'highlighting search results' do highlight_matches(phrase, matches).should == '<mark>boring</mark>' end + it 'handles macrons correctly' do + phrase = 'Māori' + + search = ActsAsXapian::Search.new([PublicBody], phrase, :limit => 1) + matches = search.words_to_highlight(:regex => true, :include_original => true) + + highlight_matches(phrase, matches).should == '<mark>Māori</mark>' + end + end |