diff options
author | Caleb <caleb.tutty@nzherald.co.nz> | 2015-04-20 23:02:46 +1200 |
---|---|---|
committer | Caleb <caleb.tutty@nzherald.co.nz> | 2015-04-20 23:41:48 +1200 |
commit | c3ef38e9ff9631f12d4fad12a7d0d35cd3c97d0f (patch) | |
tree | c2a100215eb4f99e9f6a25c21c7943c14aad2822 /spec/integration | |
parent | 30ac083e66c9ffe1d8de9f641b6a703c37fc0c49 (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 b2994eb31..a91df341f 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 @@ -40,4 +42,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 |