activeresource 2.2.3 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activeresource might be problematic. Click here for more details.
- data/CHANGELOG +28 -24
- data/Rakefile +1 -1
- data/lib/active_resource/base.rb +5 -3
- data/lib/active_resource/connection.rb +2 -2
- data/lib/active_resource/http_mock.rb +8 -0
- data/lib/active_resource/version.rb +2 -2
- data/test/base/equality_test.rb +9 -0
- data/test/base_test.rb +57 -44
- data/test/debug.log +10 -8042
- data/test/format_test.rb +14 -14
- metadata +9 -7
data/test/format_test.rb
CHANGED
@@ -15,7 +15,7 @@ class FormatTest < Test::Unit::TestCase
|
|
15
15
|
assert_equal 'Accept', header_name
|
16
16
|
|
17
17
|
headers_names = [ActiveResource::Connection::HTTP_FORMAT_HEADER_NAMES[:put], ActiveResource::Connection::HTTP_FORMAT_HEADER_NAMES[:post]]
|
18
|
-
headers_names.each{|
|
18
|
+
headers_names.each{ |name| assert_equal 'Content-Type', name }
|
19
19
|
end
|
20
20
|
|
21
21
|
def test_formats_on_single_element
|
@@ -85,20 +85,20 @@ class FormatTest < Test::Unit::TestCase
|
|
85
85
|
end
|
86
86
|
|
87
87
|
def test_serialization_of_nested_resource
|
88
|
-
|
89
|
-
|
88
|
+
address = { :street => '12345 Street' }
|
89
|
+
person = { :name=> 'Rus', :address => address}
|
90
90
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
91
|
+
[:json, :xml].each do |format|
|
92
|
+
encoded_person = ActiveResource::Formats[format].encode(person)
|
93
|
+
assert_match(/12345 Street/, encoded_person)
|
94
|
+
remote_person = Person.new(person.update({:address => StreetAddress.new(address)}))
|
95
|
+
assert_kind_of StreetAddress, remote_person.address
|
96
|
+
using_format(Person, format) do
|
97
|
+
ActiveResource::HttpMock.respond_to.post "/people.#{format}", {'Content-Type' => ActiveResource::Formats[format].mime_type}, encoded_person, 201, {'Location' => "/people/5.#{format}"}
|
98
|
+
remote_person.save
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
102
|
|
103
103
|
private
|
104
104
|
def using_format(klass, mime_type_reference)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeresource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
@@ -9,7 +9,7 @@ autorequire: active_resource
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-02-01 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - "="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 2.
|
23
|
+
version: 2.3.0
|
24
24
|
version:
|
25
25
|
description: Wraps web resources in model classes that can be manipulated through XML over REST.
|
26
26
|
email: david@loudthinking.com
|
@@ -34,9 +34,11 @@ files:
|
|
34
34
|
- Rakefile
|
35
35
|
- README
|
36
36
|
- CHANGELOG
|
37
|
+
- lib/active_resource
|
37
38
|
- lib/active_resource/base.rb
|
38
39
|
- lib/active_resource/connection.rb
|
39
40
|
- lib/active_resource/custom_methods.rb
|
41
|
+
- lib/active_resource/formats
|
40
42
|
- lib/active_resource/formats/json_format.rb
|
41
43
|
- lib/active_resource/formats/xml_format.rb
|
42
44
|
- lib/active_resource/formats.rb
|
@@ -47,6 +49,7 @@ files:
|
|
47
49
|
- lib/activeresource.rb
|
48
50
|
- test/abstract_unit.rb
|
49
51
|
- test/authorization_test.rb
|
52
|
+
- test/base
|
50
53
|
- test/base/custom_methods_test.rb
|
51
54
|
- test/base/equality_test.rb
|
52
55
|
- test/base/load_test.rb
|
@@ -54,6 +57,7 @@ files:
|
|
54
57
|
- test/base_test.rb
|
55
58
|
- test/connection_test.rb
|
56
59
|
- test/debug.log
|
60
|
+
- test/fixtures
|
57
61
|
- test/fixtures/beast.rb
|
58
62
|
- test/fixtures/customer.rb
|
59
63
|
- test/fixtures/person.rb
|
@@ -62,8 +66,6 @@ files:
|
|
62
66
|
- test/setter_trap.rb
|
63
67
|
has_rdoc: true
|
64
68
|
homepage: http://www.rubyonrails.org
|
65
|
-
licenses: []
|
66
|
-
|
67
69
|
post_install_message:
|
68
70
|
rdoc_options:
|
69
71
|
- --main
|
@@ -85,9 +87,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
87
|
requirements: []
|
86
88
|
|
87
89
|
rubyforge_project: activeresource
|
88
|
-
rubygems_version: 1.3.
|
90
|
+
rubygems_version: 1.3.1
|
89
91
|
signing_key:
|
90
|
-
specification_version:
|
92
|
+
specification_version: 2
|
91
93
|
summary: Think Active Record for web resources.
|
92
94
|
test_files: []
|
93
95
|
|