ripplr 0.0.8.beta → 0.0.9.beta
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ripplr/indexers/ripple.rb +1 -1
- data/lib/ripplr/version.rb +1 -1
- data/spec/ripplr/indexers/ripple_spec.rb +3 -3
- metadata +1 -1
@@ -6,7 +6,7 @@ module Ripplr
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def self.search(klass, query, options={})
|
9
|
-
results = ::Ripple.client.search(klass.bucket.name, query)["response"]["docs"]
|
9
|
+
results = ::Ripple.client.search(klass.bucket.name, query, options)["response"]["docs"]
|
10
10
|
results.map{|result| klass.find(result["id"])}.reject{|obj| obj.nil?}
|
11
11
|
end
|
12
12
|
end
|
data/lib/ripplr/version.rb
CHANGED
@@ -11,7 +11,7 @@ describe Ripplr::Indexers::Ripple do
|
|
11
11
|
describe "#search" do
|
12
12
|
context "when no documents match" do
|
13
13
|
Given (:results) { {"response" => {"docs" => []} } }
|
14
|
-
Given { Ripple.client.should_receive(:search).with('people', 'query string').and_return results }
|
14
|
+
Given { Ripple.client.should_receive(:search).with('people', 'query string', {}).and_return results }
|
15
15
|
When(:result) { Ripplr::Indexers::Ripple.search Person, 'query string' }
|
16
16
|
Then { result.should be_empty }
|
17
17
|
end
|
@@ -19,7 +19,7 @@ describe Ripplr::Indexers::Ripple do
|
|
19
19
|
context "when one document matches" do
|
20
20
|
Given (:results) { {"response" => {"docs" => [ { "id" => "12345"} ]} } }
|
21
21
|
Given { Person.should_receive(:find).with("12345").and_return "yo dawg" }
|
22
|
-
Given { Ripple.client.should_receive(:search).with('people', 'query string').and_return results }
|
22
|
+
Given { Ripple.client.should_receive(:search).with('people', 'query string', {}).and_return results }
|
23
23
|
When(:result) { Ripplr::Indexers::Ripple.search Person, 'query string' }
|
24
24
|
Then { result.first.should == "yo dawg" }
|
25
25
|
end
|
@@ -27,7 +27,7 @@ describe Ripplr::Indexers::Ripple do
|
|
27
27
|
context "when one document matches but it doesnt exist" do
|
28
28
|
Given (:results) { {"response" => {"docs" => [ { "id" => "12345"} ]} } }
|
29
29
|
Given { Person.should_receive(:find).with("12345").and_return nil }
|
30
|
-
Given { Ripple.client.should_receive(:search).with('people', 'query string').and_return results }
|
30
|
+
Given { Ripple.client.should_receive(:search).with('people', 'query string', {}).and_return results }
|
31
31
|
When(:result) { Ripplr::Indexers::Ripple.search Person, 'query string' }
|
32
32
|
Then { result.should be_empty }
|
33
33
|
end
|