adapter-elasticsearch 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +0 -4
- data/lib/adapter/elasticsearch/version.rb +1 -1
- data/spec/elasticsearch_spec.rb +17 -0
- metadata +3 -3
data/README.md
CHANGED
data/spec/elasticsearch_spec.rb
CHANGED
@@ -15,4 +15,21 @@ describe Adapter::ElasticSearch do
|
|
15
15
|
let(:adapter) { @adapter }
|
16
16
|
|
17
17
|
it_should_behave_like 'an elasticsearch adapter'
|
18
|
+
|
19
|
+
describe "#write" do
|
20
|
+
context "with parent" do
|
21
|
+
let(:adapter) { Adapter[:elasticsearch].new(@client, {:type => 'document', :parent => :library}) }
|
22
|
+
|
23
|
+
it "sets parent parameter" do
|
24
|
+
params = {'foo' => 'bar', 'library' => '2'}
|
25
|
+
@client.should_receive(:add).with('document', '123', params, :parent => '2')
|
26
|
+
adapter.write('123', params)
|
27
|
+
end
|
28
|
+
|
29
|
+
it "does not set parent on non-hash values" do
|
30
|
+
@client.should_receive(:add).with('document', '123', {'_value' => '456'}, {})
|
31
|
+
adapter.write('123', '456')
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
18
35
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adapter-elasticsearch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jonathan Hoyt
|