graphiti_spec_helpers 1.0.beta.4 → 1.0.beta.6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6413f4a6d9110c189532d164c337d4ac3123f2e
|
4
|
+
data.tar.gz: f9d61cdd38667932d05c5a47b8a38c8038e0cd65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91c77a4d540c6eb91d471ba019aa47c8ec2fb38db46efe176011f26b9ba2656b24624e8ec9a5e463b4b920c16182d30675b34fc758a49c74700497afc98cbf5e
|
7
|
+
data.tar.gz: 5fd41ad23bcbba86233d6c48a87969c9bd429d71c0cc0977c9ef4344d3d440c3d4075600c2cbdfe4a27128a7640ae49b47da0085d4fc187cb4e521aafa568cdd
|
@@ -57,5 +57,15 @@ module GraphitiSpecHelpers
|
|
57
57
|
"Tried to find sideload, but the payload did not contain 'included'! Payload was:\n\n#{JSON.pretty_generate(@payload)}"
|
58
58
|
end
|
59
59
|
end
|
60
|
+
|
61
|
+
class NoMeta < Base
|
62
|
+
def initialize(payload)
|
63
|
+
@payload = payload
|
64
|
+
end
|
65
|
+
|
66
|
+
def message
|
67
|
+
"Tried to find metadata, but the payload did not contain 'meta'! Payload was:\n\n#{JSON.pretty_generate(@payload)}"
|
68
|
+
end
|
69
|
+
end
|
60
70
|
end
|
61
71
|
end
|
@@ -37,6 +37,10 @@ module GraphitiSpecHelpers
|
|
37
37
|
@jsonapi_errors ||= ErrorsProxy.new(json['errors'] || [])
|
38
38
|
end
|
39
39
|
|
40
|
+
def jsonapi_meta
|
41
|
+
@jsonapi_errors = json['meta'] || raise(Errors::NoMeta.new(json))
|
42
|
+
end
|
43
|
+
|
40
44
|
def jsonapi_headers
|
41
45
|
{
|
42
46
|
'CONTENT_TYPE' => 'application/vnd.api+json'
|
@@ -63,8 +67,12 @@ module GraphitiSpecHelpers
|
|
63
67
|
delete url, headers: jsonapi_headers
|
64
68
|
end
|
65
69
|
|
66
|
-
def
|
67
|
-
Graphiti::Types[:datetime][:read][value]
|
70
|
+
def json_datetime(value)
|
71
|
+
Graphiti::Types[:datetime][:read][value].as_json
|
72
|
+
end
|
73
|
+
|
74
|
+
def json_date(value)
|
75
|
+
Graphiti::Types[:date][:read][value].as_json
|
68
76
|
end
|
69
77
|
|
70
78
|
# @api private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphiti_spec_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.beta.
|
4
|
+
version: 1.0.beta.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Richmond
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphiti
|