cloud_search 0.1.1 → 0.1.2

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.
@@ -28,7 +28,7 @@ module CloudSearch
28
28
  private
29
29
 
30
30
  def headers
31
- {"Content-Type" => "application/json"}
31
+ {"Content-Type" => "application/json", "Accept" => "application/json" }
32
32
  end
33
33
 
34
34
  def documents_json
@@ -1,3 +1,3 @@
1
1
  module CloudSearch
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -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.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: -2319996128587745862
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: -2319996128587745862
189
+ hash: 3335383959573694951
190
190
  requirements: []
191
191
  rubyforge_project:
192
192
  rubygems_version: 1.8.24