aboutsummaryrefslogtreecommitdiffstats
path: root/spec/integration
diff options
context:
space:
mode:
Diffstat (limited to 'spec/integration')
-rw-r--r--spec/integration/admin_public_body_edit_spec.rb2
-rw-r--r--spec/integration/download_request_spec.rb3
-rw-r--r--spec/integration/xapian_search_highlighting_spec.rb15
3 files changed, 18 insertions, 2 deletions
diff --git a/spec/integration/admin_public_body_edit_spec.rb b/spec/integration/admin_public_body_edit_spec.rb
index aeec3e65a..21011b172 100644
--- a/spec/integration/admin_public_body_edit_spec.rb
+++ b/spec/integration/admin_public_body_edit_spec.rb
@@ -39,7 +39,7 @@ describe 'Editing a Public Body' do
end
end
- it 'can add a translation for multiple locales', :focus => true do
+ it 'can add a translation for multiple locales' do
@admin.visit edit_admin_body_path(@body)
@admin.fill_in 'public_body_name__en', :with => 'New Quango EN'
@admin.click_button 'Save'
diff --git a/spec/integration/download_request_spec.rb b/spec/integration/download_request_spec.rb
index 48b42b11d..c73b85866 100644
--- a/spec/integration/download_request_spec.rb
+++ b/spec/integration/download_request_spec.rb
@@ -143,7 +143,8 @@ describe 'when making a zipfile available' do
it "should update the contents of the zipfile when the request changes" do
- info_request = FactoryGirl.create(:info_request_with_incoming)
+ info_request = FactoryGirl.create(:info_request_with_incoming,
+ :title => 'Example Title')
request_owner = login(info_request.user)
inspect_zip_download(request_owner, info_request) do |zip|
zip.count.should == 1 # just the message
diff --git a/spec/integration/xapian_search_highlighting_spec.rb b/spec/integration/xapian_search_highlighting_spec.rb
index 65a34cf91..a91df341f 100644
--- a/spec/integration/xapian_search_highlighting_spec.rb
+++ b/spec/integration/xapian_search_highlighting_spec.rb
@@ -1,8 +1,14 @@
+# encoding: utf-8
+
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe 'highlighting search results' do
include HighlightHelper
+ before do
+ get_fixtures_xapian_index
+ end
+
it 'ignores stopwords' do
phrase = 'department of humpadinking'
search = ActsAsXapian::Search.new([PublicBody], phrase, :limit => 1)
@@ -36,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