restfully 1.1.0 → 1.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 76c01493eaf0c7ad7925079ec8f066edf49c9304
4
- data.tar.gz: 9f3a14d5933d3930427763b2d192da89718b7899
3
+ metadata.gz: 73515709927905b0a84eb46b987fab13a065438c
4
+ data.tar.gz: 0c4c6e259ee9fa9f60420c767c7b8e19fe0c02db
5
5
  SHA512:
6
- metadata.gz: e47004cc066f383e4461453ebc093b27b75cbf52e8376eabe6745c8d70ea204eb1898ecf920d3f012fc2c03e039a20a49b4ae474997924a4d397a52639ce9b2b
7
- data.tar.gz: 5711c64d0bd71bbef233f067dbc602f0ab83faf917fe59ce0f4f40b16e921005c122aff71b60f6cc6910f1f0a244900892e3cbd1a1915445f872e703dd1f8d64
6
+ metadata.gz: a6a1937030367bea1598ab4d0a53deb6e67e3122e5a5519b1d65c2b46ded7c19534a5b88c2e395b6e18e2ad6840bb8277babc8c5e3216ce317bd1941755aa756
7
+ data.tar.gz: 08ea839b73c3e99f2b4d46c1b6720bc8bb8c757f9ce6c0c5fdd3a71a4fe1425e5b2507b0bbae65b85df2f4ac10fc63235e4619e6da9724f391c852b48edd7b0f
@@ -190,6 +190,9 @@ module Restfully
190
190
  logger.debug "Building response..."
191
191
  Resource.new(self, response, request).build
192
192
  when 201,202
193
+ logger.debug "Getting description of newly created resource at: #{response.head['Location'].inspect}"
194
+ get response.head['Location'], :head => request.head
195
+ when 301,302
193
196
  logger.debug "Following redirection to: #{response.head['Location'].inspect}"
194
197
  get response.head['Location'], :head => request.head
195
198
  when 204
@@ -1,3 +1,3 @@
1
1
  module Restfully
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -247,6 +247,19 @@ describe Restfully::Session do
247
247
  end
248
248
  end
249
249
 
250
+ [301, 302].each do |status|
251
+ it "should fetch the resource specified in the Location header if status = #{status}" do
252
+ @response.stub!(:code).and_return(status)
253
+ @response.head['Location'] = @uri+"/path"
254
+
255
+ @session.should_receive(:get).
256
+ with(@uri+"/path", :head => @request.head).
257
+ and_return(resource=mock("resource"))
258
+ @session.process(@response, @request).
259
+ should == resource
260
+ end
261
+ end
262
+
250
263
  it "should return a Restfully::Resource if successful" do
251
264
  Restfully::MediaType.register Restfully::MediaType::ApplicationJson
252
265
  body = {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restfully
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyril Rohr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-13 00:00:00.000000000 Z
11
+ date: 2015-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json