zendesk_api 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -7,7 +7,7 @@ GIT
7
7
  PATH
8
8
  remote: .
9
9
  specs:
10
- zendesk_api (0.3.6)
10
+ zendesk_api (0.3.7)
11
11
  faraday (>= 0.8.0)
12
12
  faraday_middleware (>= 0.8.7)
13
13
  hashie (>= 1.2)
@@ -30,7 +30,7 @@ module ZendeskAPI
30
30
 
31
31
  @app.call(env).on_complete do
32
32
  if cached && env[:status] == 304 # not modified
33
- env[:body] = cached[:body]
33
+ env.merge!(:body => cached[:body], :response_headers => cached[:response_headers])
34
34
  elsif env[:status] == 200 && env[:response_headers]["Etag"] # modified and cacheable
35
35
  @cache.write(cache_key(env), env)
36
36
  end
@@ -1,3 +1,3 @@
1
1
  module ZendeskAPI
2
- VERSION = "0.3.6"
2
+ VERSION = "0.3.7"
3
3
  end
@@ -9,9 +9,12 @@ describe ZendeskAPI::Middleware::Request::EtagCache do
9
9
  response.status.should == 200
10
10
  response.body.should == {"x"=>1}
11
11
 
12
+ headers = response.headers
13
+
12
14
  stub_request(:get, %r{blergh}).to_return(:status => 304, :headers => {"Etag" => "x"})
13
15
  response = client.connection.get("blergh")
14
16
  response.status.should == 304
15
17
  response.body.should == {"x"=>1}
18
+ response.headers.should == headers
16
19
  end
17
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zendesk_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-05-21 00:00:00.000000000 Z
13
+ date: 2013-05-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bump