ripplr 1.0.1.rc → 1.0.2.rc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +1 -1
- 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
data/Gemfile.lock
CHANGED
@@ -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, options)["
|
9
|
+
results = ::Ripple.client.search(klass.bucket.name, query, options)["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
@@ -10,14 +10,14 @@ describe Ripplr::Indexers::Ripple do
|
|
10
10
|
|
11
11
|
describe "#search" do
|
12
12
|
context "when no documents match" do
|
13
|
-
Given (:results) { {"
|
13
|
+
Given (:results) { {"docs" => []} }
|
14
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
|
18
18
|
|
19
19
|
context "when one document matches" do
|
20
|
-
Given (:results) { {"
|
20
|
+
Given (:results) { {"docs" => [ { "id" => "12345"} ]} }
|
21
21
|
Given { Person.should_receive(:find).with("12345").and_return "yo dawg" }
|
22
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' }
|
@@ -25,7 +25,7 @@ describe Ripplr::Indexers::Ripple do
|
|
25
25
|
end
|
26
26
|
|
27
27
|
context "when one document matches but it doesnt exist" do
|
28
|
-
Given (:results) { {"
|
28
|
+
Given (:results) { {"docs" => [ { "id" => "12345"} ]} }
|
29
29
|
Given { Person.should_receive(:find).with("12345").and_return nil }
|
30
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' }
|