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 +4 -4
- data/lib/restfully/session.rb +3 -0
- data/lib/restfully/version.rb +1 -1
- data/spec/restfully/session_spec.rb +13 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73515709927905b0a84eb46b987fab13a065438c
|
4
|
+
data.tar.gz: 0c4c6e259ee9fa9f60420c767c7b8e19fe0c02db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6a1937030367bea1598ab4d0a53deb6e67e3122e5a5519b1d65c2b46ded7c19534a5b88c2e395b6e18e2ad6840bb8277babc8c5e3216ce317bd1941755aa756
|
7
|
+
data.tar.gz: 08ea839b73c3e99f2b4d46c1b6720bc8bb8c757f9ce6c0c5fdd3a71a4fe1425e5b2507b0bbae65b85df2f4ac10fc63235e4619e6da9724f391c852b48edd7b0f
|
data/lib/restfully/session.rb
CHANGED
@@ -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
|
data/lib/restfully/version.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2015-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|