graphiti 1.0.rc.4 → 1.0.rc.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/graphiti/templates/create_request_spec.rb.erb +1 -1
- data/lib/generators/graphiti/templates/destroy_request_spec.rb.erb +4 -2
- data/lib/generators/graphiti/templates/index_request_spec.rb.erb +1 -1
- data/lib/generators/graphiti/templates/update_request_spec.rb.erb +1 -1
- data/lib/graphiti/resource/remote.rb +7 -4
- data/lib/graphiti/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f89eebade02c792ad48a2f33c4de7eef5cc052eb
|
4
|
+
data.tar.gz: fef7fc51084562eb3e9724cd4c1419f881c086f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10e2be2bd2c6b1e80db16cf8022f446b5842eaa994f43af6688bea6816ab9a909168658fc0cd827b32c64615fa0fefbbb7f669d5df69f3ef651b25500aedf5a5
|
7
|
+
data.tar.gz: 22c268a669e839102ba34708fe666c2bf9b4efd519ab35e387f90fc748bf1211b1b6fc721180ee344052561d2c3a4dddd33a8af8991d87f44031e5c2ff76dfe7
|
@@ -21,8 +21,8 @@ RSpec.describe "<%= type %>#create", type: :request do
|
|
21
21
|
expect(<%= resource_class %>).to receive(:build).and_call_original
|
22
22
|
expect {
|
23
23
|
make_request
|
24
|
+
expect(response.status).to eq(201), response.body
|
24
25
|
}.to change { <%= model_class %>.count }.by(1)
|
25
|
-
expect(response.status).to eq(201)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -10,10 +10,12 @@ RSpec.describe "<%= type %>#destroy", type: :request do
|
|
10
10
|
|
11
11
|
it 'updates the resource' do
|
12
12
|
expect(<%= resource_class %>).to receive(:find).and_call_original
|
13
|
-
expect {
|
13
|
+
expect {
|
14
|
+
make_request
|
15
|
+
expect(response.status).to eq(200), response.body
|
16
|
+
}.to change { <%= model_class %>.count }.by(-1)
|
14
17
|
expect { <%= var %>.reload }
|
15
18
|
.to raise_error(ActiveRecord::RecordNotFound)
|
16
|
-
expect(response.status).to eq(200)
|
17
19
|
expect(json).to eq('meta' => {})
|
18
20
|
end
|
19
21
|
end
|
@@ -14,7 +14,7 @@ RSpec.describe "<%= type %>#index", type: :request do
|
|
14
14
|
it 'works' do
|
15
15
|
expect(<%= resource_class %>).to receive(:all).and_call_original
|
16
16
|
make_request
|
17
|
-
expect(response.status).to eq(200)
|
17
|
+
expect(response.status).to eq(200), response.body
|
18
18
|
expect(d.map(&:jsonapi_type).uniq).to match_array(['<%= type %>'])
|
19
19
|
expect(d.map(&:id)).to match_array([<%= var %>1.id, <%= var %>2.id])
|
20
20
|
end
|
@@ -25,8 +25,8 @@ RSpec.describe "<%= type %>#update", type: :request do
|
|
25
25
|
expect(<%= resource_class %>).to receive(:find).and_call_original
|
26
26
|
expect {
|
27
27
|
make_request
|
28
|
+
expect(response.status).to eq(200), response.body
|
28
29
|
}.to change { <%= var %>.reload.attributes }
|
29
|
-
expect(response.status).to eq(200)
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -33,10 +33,13 @@ module Graphiti
|
|
33
33
|
|
34
34
|
# Forward all headers
|
35
35
|
def request_headers
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
36
|
+
{}.tap do |headers|
|
37
|
+
if defined?(Rails) && context
|
38
|
+
raw = context.request.headers.to_h
|
39
|
+
if auth = raw['Authorization']
|
40
|
+
headers['Authorization'] = auth
|
41
|
+
end
|
42
|
+
end
|
40
43
|
end
|
41
44
|
end
|
42
45
|
|
data/lib/graphiti/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphiti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.rc.
|
4
|
+
version: 1.0.rc.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Richmond
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jsonapi-serializable
|