spyke 3.1.1 → 3.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ecf530ac97e19a1bc4501b344422a8ab7bf767fb
4
- data.tar.gz: a7812fed530e51e8ccc07eafb542706cf2fb5738
3
+ metadata.gz: adff1afa43c5209b9b4fcce08ce571b1f99ea941
4
+ data.tar.gz: fd84b6d5943e85f3027ee40bf53672dc66437ac1
5
5
  SHA512:
6
- metadata.gz: 197cabc723a34557564e432a642d38f6ba52fc337aec08d93c6173d8f5577247f54ee36c634f4c03d8611adb262b602287acbfa3d150553cca1ce5ef0b227bc7
7
- data.tar.gz: e40149c8f4a69f387244925c18f774c982eecc95e5cfd97d1440243cca5275391f3b38e9820edb4bc1f69e68f9c49446202f6206361ae526494f637f7279c0a6
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
@@ -69,7 +69,7 @@ module Spyke
69
69
  end
70
70
 
71
71
  def destroy
72
- delete
72
+ self.attributes = delete
73
73
  end
74
74
 
75
75
  def update_attributes(new_attributes)
data/lib/spyke/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Spyke
2
- VERSION = '3.1.1'
2
+ VERSION = '3.1.2'
3
3
  end
@@ -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).destroy
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.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-01 00:00:00.000000000 Z
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.2.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