spark_api 1.4.19 → 1.4.20
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 +8 -8
- data/VERSION +1 -1
- data/lib/spark_api/models/concerns/destroyable.rb +13 -0
- data/spec/unit/spark_api/models/concerns/destroyable_spec.rb +24 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Y2FhNTc3MjdmODk2Y2VkZmIwYzQxMjA0MTk4NjdmNGExZGM0MThlOQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OWRiNzkwY2QzNTM5ODM1OWRhOTZmZDZhOTMxNTFjY2U4YmM3ZTc3YQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NWIzYmFmMmNiM2E2NmY1NWRkZTI0MTE1Nzg1OWMwNzcwNjg5ZjU3N2I2Mzlm
|
10
|
+
ZmE5MzE0ODdhYzJjYzQ2M2I4NTkwNDU4ZDVhYzI0NzA5NTEzZjRjMmM2MTc4
|
11
|
+
YWFjZWNhY2RmMzlmZjJjYzQyOTI4MWM3MTM3ZmU4ODIzNDVjNTQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NGIyOTNiYmJiMGYzMGI4ODNkNDcyYzcxZDk0YmI3NjZkNWYwZGM2ZjJlODRm
|
14
|
+
Y2IwNzY5MjlmODc5YzFmMWE4YWIwMDJmNjEwZTE4MzYzZWQ5MDg3MTAzNWM1
|
15
|
+
YzczM2NkMTlhZDAwYWUzNmU5OWVhYjEyZGY0Mjk3ODBmMDNiYzA=
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.4.
|
1
|
+
1.4.20
|
@@ -4,6 +4,19 @@ module SparkApi
|
|
4
4
|
|
5
5
|
module Destroyable
|
6
6
|
|
7
|
+
def self.included(base)
|
8
|
+
base.extend(ClassMethods)
|
9
|
+
end
|
10
|
+
|
11
|
+
module ClassMethods
|
12
|
+
|
13
|
+
def destroy(id, arguments = {})
|
14
|
+
connection.delete("#{path}/#{id}", arguments)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
|
7
20
|
def destroy(arguments = {})
|
8
21
|
self.errors = []
|
9
22
|
begin
|
@@ -14,15 +14,32 @@ describe Concerns::Destroyable, "Destroyable Concern" do
|
|
14
14
|
@model = MyExampleModel.first
|
15
15
|
end
|
16
16
|
|
17
|
-
|
18
|
-
|
17
|
+
describe 'destroyed?' do
|
18
|
+
|
19
|
+
it "should not be destroyed" do
|
20
|
+
@model.destroyed?.should eq(false)
|
21
|
+
end
|
19
22
|
end
|
20
23
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
24
|
+
describe 'destroy' do
|
25
|
+
|
26
|
+
it "should be destroyable" do
|
27
|
+
stub_api_delete("/some/place/20101230223226074201000000")
|
28
|
+
@model = MyExampleModel.first
|
29
|
+
@model.destroy
|
30
|
+
@model.destroyed?.should eq(true)
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
describe 'destroy class method' do
|
36
|
+
|
37
|
+
it "allows you to destroy with only the id" do
|
38
|
+
stub_api_delete("/test/example/20101230223226074201000000")
|
39
|
+
MyExampleModel.destroy('20101230223226074201000000')
|
40
|
+
expect_api_request(:delete, "/test/example/20101230223226074201000000").to have_been_made.once
|
41
|
+
end
|
42
|
+
|
26
43
|
end
|
27
44
|
|
28
45
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spark_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Hornseth
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-02-
|
12
|
+
date: 2018-02-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|