spec/integration/riak/protobuffs_backends_spec.rb in riak-client-1.1.1 vs spec/integration/riak/protobuffs_backends_spec.rb in riak-client-1.2.0
- old
+ new
@@ -28,9 +28,23 @@
results.should have_key 'max_score'
results.should have_key 'num_found'
results['docs'].should include({"id" => "munchausen-605"})
end
end
+
+ if "".respond_to?(:encoding) # Ruby 1.9 and later only
+ describe "searching fulltext indexes (1.2 and later)", :version => '>= 1.2.0' do
+ include_context "search corpus setup"
+
+ it 'should return documents with UTF-8 fields (GH #75)' do
+ utf8 = Encoding.find('UTF-8')
+ results = @backend.search 'search_test', 'fearless elephant rushed'
+ results['docs'].each do |d|
+ d.each {|(k,v)| k.encoding.should == utf8; v.encoding.should == utf8 }
+ end
+ end
+ end
+ end
end
end
end
end