aboutsummaryrefslogtreecommitdiffstats
path: root/spec/integration
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2015-04-23 13:52:32 +0100
committerLouise Crow <louise.crow@gmail.com>2015-04-23 13:52:32 +0100
commit836c681b42825b5b5fe310ee2f5c3475a767aea9 (patch)
treee2253318b1fc4ff3c6543e455dd18bee33248ef5 /spec/integration
parentd8a440f15e90d44ab94cd86d87ba65ee32edbe46 (diff)
parentc3ef38e9ff9631f12d4fad12a7d0d35cd3c97d0f (diff)
Merge remote-tracking branch 'nzherald_github/fix-xapian-macron-highlighting' into rails-3-develop
Diffstat (limited to 'spec/integration')
-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 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