spyke 3.1.1 → 3.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.
- checksums.yaml +4 -4
- data/lib/spyke/attribute_assignment.rb +1 -1
- data/lib/spyke/orm.rb +1 -1
- data/lib/spyke/version.rb +1 -1
- data/test/custom_request_test.rb +7 -0
- data/test/orm_test.rb +4 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adff1afa43c5209b9b4fcce08ce571b1f99ea941
|
4
|
+
data.tar.gz: fd84b6d5943e85f3027ee40bf53672dc66437ac1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 478fb7e8b4aaa1de4d77dbd68d759b506f5fc449a6a4d6144f5268bebcf760c66344f2a3cb07fb1f355d4249424e70da49a670643b19761e887cde7b8f001888
|
7
|
+
data.tar.gz: 33280b45a9d91d9b0f7ef8c667e9ebd760fe02cdbbaaed54296ab17cf2683cf03b20d8ab69408d8c3600babea79ee2b81f62f3d39c109a2e6e9a981f77d57bc1
|
@@ -13,7 +13,7 @@ module Spyke
|
|
13
13
|
module ClassMethods
|
14
14
|
# By adding instance methods via an included module,
|
15
15
|
# they become overridable with "super".
|
16
|
-
# http://thepugautomatic.com/2013/dsom/
|
16
|
+
# http://thepugautomatic.com/2013/07/dsom/
|
17
17
|
def attributes(*names)
|
18
18
|
unless @spyke_instance_method_container
|
19
19
|
@spyke_instance_method_container = Module.new
|
data/lib/spyke/orm.rb
CHANGED
data/lib/spyke/version.rb
CHANGED
data/test/custom_request_test.rb
CHANGED
@@ -55,6 +55,13 @@ module Spyke
|
|
55
55
|
assert_requested endpoint
|
56
56
|
end
|
57
57
|
|
58
|
+
def test_custom_put_in_context_of_association
|
59
|
+
endpoint = stub_request(:put, 'http://sushi.com/recipes/1/groups/2/draft')
|
60
|
+
recipe = Recipe.new(id: 1)
|
61
|
+
recipe.groups.build(id: 2).put(:draft)
|
62
|
+
assert_requested endpoint
|
63
|
+
end
|
64
|
+
|
58
65
|
def test_multiple_apis
|
59
66
|
endpoint = stub_request(:get, 'http://sashimi.com/other_recipes')
|
60
67
|
OtherRecipe.all.to_a
|
data/test/orm_test.rb
CHANGED
@@ -129,8 +129,10 @@ module Spyke
|
|
129
129
|
end
|
130
130
|
|
131
131
|
def test_destroy
|
132
|
-
endpoint = stub_request(:delete, 'http://sushi.com/recipes/1')
|
133
|
-
Recipe.new(id: 1)
|
132
|
+
endpoint = stub_request(:delete, 'http://sushi.com/recipes/1').to_return_json(result: { id: 1, deleted: true })
|
133
|
+
recipe = Recipe.new(id: 1)
|
134
|
+
recipe.destroy
|
135
|
+
assert recipe.deleted
|
134
136
|
assert_requested endpoint
|
135
137
|
end
|
136
138
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spyke
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Balvig
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -319,7 +319,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
319
319
|
version: '0'
|
320
320
|
requirements: []
|
321
321
|
rubyforge_project:
|
322
|
-
rubygems_version: 2.
|
322
|
+
rubygems_version: 2.4.3
|
323
323
|
signing_key:
|
324
324
|
specification_version: 4
|
325
325
|
summary: Interact with REST services in an ActiveRecord-like manner
|