aboutsummaryrefslogtreecommitdiffstats
path: root/spec/integration/xapian_search_highlighting_spec.rb
diff options
context:
space:
mode:
authorCaleb <caleb.tutty@nzherald.co.nz>2015-04-20 23:02:46 +1200
committerLouise Crow <louise.crow@gmail.com>2015-06-04 15:48:44 +0100
commit51a532f797d942dfc5e83537ca1c9f4217bd757a (patch)
treea3ba9d8349cab6d7c8e9c996bccac3139c9e88da /spec/integration/xapian_search_highlighting_spec.rb
parentb772e92f89e96b831ed5c69dc35b339a6b52f2cb (diff)
Fix encoding issue with searching for macrons
Correct indentation to be consistent
Diffstat (limited to 'spec/integration/xapian_search_highlighting_spec.rb')
-rw-r--r--spec/integration/xapian_search_highlighting_spec.rb11
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