cloud_search 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
data/lib/cloud_search/indexer.rb
CHANGED
data/lib/cloud_search/version.rb
CHANGED
@@ -56,6 +56,8 @@ describe CloudSearch::Indexer do
|
|
56
56
|
|
57
57
|
let(:type) { "add" }
|
58
58
|
let(:version) { 1 }
|
59
|
+
let(:url) { "#{CloudSearch.config.document_url}/documents/batch" }
|
60
|
+
let(:json) { [document].to_json }
|
59
61
|
|
60
62
|
it "succeeds" do
|
61
63
|
indexer << document
|
@@ -66,6 +68,12 @@ describe CloudSearch::Indexer do
|
|
66
68
|
expect(message).to match(/^200/)
|
67
69
|
end
|
68
70
|
|
71
|
+
it "sends http headers with json format info" do
|
72
|
+
indexer << document
|
73
|
+
RestClient.should_receive(:post).with(url, kind_of(String), {"Content-Type" => "application/json", "Accept" => "application/json" }).and_return(stub(:code => 1, :length => 10, :body => '{}'))
|
74
|
+
indexer.index
|
75
|
+
end
|
76
|
+
|
69
77
|
context "when the domain id was not configured" do
|
70
78
|
around do |example|
|
71
79
|
domain_id = CloudSearch.config.domain_id
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloud_search
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -177,7 +177,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
177
177
|
version: '0'
|
178
178
|
segments:
|
179
179
|
- 0
|
180
|
-
hash:
|
180
|
+
hash: 3335383959573694951
|
181
181
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
182
182
|
none: false
|
183
183
|
requirements:
|
@@ -186,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
186
|
version: '0'
|
187
187
|
segments:
|
188
188
|
- 0
|
189
|
-
hash:
|
189
|
+
hash: 3335383959573694951
|
190
190
|
requirements: []
|
191
191
|
rubyforge_project:
|
192
192
|
rubygems_version: 1.8.24
|