-
Notifications
You must be signed in to change notification settings - Fork 0
/
utopian_solrizer_spec.rb
35 lines (28 loc) · 1.15 KB
/
utopian_solrizer_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
require 'spec_helper'
describe UtopianSolrizer do
@@solr_options = { read_timeout: 120, open_timeout: 120, url: 'http://localhost:8983/solr/utopian' }
it "has solrize_post" do
post = UtopianRuby::UtopianRubyAPI.get_post_obj('yuxi','utopian-api-ruby-client')
response = UtopianSolrizer.solrize_post(post, @@solr_options)
expect(response['responseHeader']['status']).to eq(0)
end
it "has query" do
params = { :q => "*:*" }
response = UtopianSolrizer.query(@@solr_options, params)
expect(response['responseHeader']['status']).to eq(0)
#response["response"]["docs"].each do |d|
# puts d["id"]
# puts d["author"]
#end
end
it "has exist method" do
id = '0'
expect(UtopianSolrizer.exist(@@solr_options, id)).to eq(false)
end
it "has solrize_posts_by_criterias method" do
expect(UtopianSolrizer.solrize_posts_by_criterias({"limit":1,"type":"development"}, @@solr_options, nil)).to be >= 0
end
it "has solrize_posts_within_minutes method" do
expect(UtopianSolrizer.solrize_posts_within_minutes({"limit":1,"status":"reviewed","type":"development"}, @@solr_options, nil, 60*2)).to be >= 0
end
end