ripplr 1.0.1.rc → 1.0.2.rc

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ripplr (1.0.0.rc)
4
+ ripplr (1.0.1.rc)
5
5
  ripple (>= 0.9.5)
6
6
 
7
7
  GEM
@@ -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)["response"]["docs"]
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
@@ -1,3 +1,3 @@
1
1
  module Ripplr
2
- VERSION = "1.0.1.rc"
2
+ VERSION = "1.0.2.rc"
3
3
  end
@@ -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) { {"response" => {"docs" => []} } }
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) { {"response" => {"docs" => [ { "id" => "12345"} ]} } }
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) { {"response" => {"docs" => [ { "id" => "12345"} ]} } }
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' }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ripplr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1.rc
4
+ version: 1.0.2.rc
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors: