locomotivecms_coal 1.6.0.beta1 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +2 -3
  4. data/Gemfile +1 -6
  5. data/Gemfile.lock +54 -59
  6. data/MIT-LICENSE +1 -1
  7. data/README.md +20 -5
  8. data/lib/locomotive/coal/client.rb +8 -0
  9. data/lib/locomotive/coal/resources/accounts.rb +33 -0
  10. data/lib/locomotive/coal/resources/concerns/request.rb +19 -1
  11. data/lib/locomotive/coal/version.rb +1 -1
  12. data/lib/locomotive/coal.rb +1 -0
  13. data/locomotivecms_coal.gemspec +5 -6
  14. data/spec/fixtures/coal_cassettes/accounts.yml +214 -0
  15. data/spec/fixtures/coal_cassettes/client.yml +277 -163
  16. data/spec/fixtures/coal_cassettes/content_assets.yml +144 -445
  17. data/spec/fixtures/coal_cassettes/content_entries.yml +963 -1647
  18. data/spec/fixtures/coal_cassettes/content_types.yml +387 -209
  19. data/spec/fixtures/coal_cassettes/current_site.yml +89 -49
  20. data/spec/fixtures/coal_cassettes/memberships.yml +143 -77
  21. data/spec/fixtures/coal_cassettes/my_account.yml +163 -99
  22. data/spec/fixtures/coal_cassettes/pages.yml +177 -99
  23. data/spec/fixtures/coal_cassettes/sections.yml +121 -78
  24. data/spec/fixtures/coal_cassettes/sites.yml +108 -141
  25. data/spec/fixtures/coal_cassettes/snippets.yml +140 -76
  26. data/spec/fixtures/coal_cassettes/theme_assets.yml +142 -254
  27. data/spec/fixtures/coal_cassettes/token.yml +64 -43
  28. data/spec/fixtures/coal_cassettes/translations.yml +140 -76
  29. data/spec/fixtures/coal_cassettes/version.yml +54 -30
  30. data/spec/integration/resources/accounts_spec.rb +38 -0
  31. data/spec/integration/resources/sections_spec.rb +1 -1
  32. data/spec/integration/resources/token_spec.rb +1 -1
  33. metadata +20 -30
@@ -2,81 +2,102 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: http://localhost:3000/locomotive/api/v3/tokens.json
5
+ uri: http://acme.example.local:3000/tokens.json
6
6
  body:
7
7
  encoding: UTF-8
8
- string: api_key=d49cd50f6f0d2b163f48fc73cb249f0244c37074&email=admin%40locomotivecms.com
8
+ string: email=admin%40locomotivecms.com&password=locomotive
9
9
  headers:
10
+ User-Agent:
11
+ - Faraday v0.15.4
10
12
  Accept:
11
13
  - application/json
14
+ Accept-Encoding:
15
+ - gzip,deflate
16
+ Date:
17
+ - Sun, 17 Nov 2019 16:39:25 GMT
12
18
  Content-Type:
13
19
  - application/x-www-form-urlencoded
14
- Accept-Encoding:
15
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
- User-Agent:
17
- - Ruby
18
20
  response:
19
21
  status:
20
- code: 201
21
- message: Created
22
+ code: 404
23
+ message: Not Found
22
24
  headers:
23
25
  Content-Type:
24
- - application/json
25
- Etag:
26
- - W/"120917583ae3f64355d682b690f7cb40"
26
+ - text/html
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Connection:
30
+ - keep-alive
31
+ Status:
32
+ - 404 Not Found
27
33
  Cache-Control:
28
34
  - max-age=0, private, must-revalidate
29
- X-Request-Id:
30
- - 93c7092a-9fe1-4f90-a513-e008ea455ee2
31
35
  X-Runtime:
32
- - '0.018246'
33
- Content-Length:
34
- - '32'
36
+ - '0.018269'
37
+ X-Request-Id:
38
+ - '084896b4-63cc-4ceb-bc66-5c9923a9c346'
39
+ Date:
40
+ - Sun, 17 Nov 2019 16:39:30 GMT
41
+ Set-Cookie:
42
+ - steam-locale=en; path=/; max-age=31556952
43
+ X-Powered-By:
44
+ - Phusion Passenger 6.0.4
45
+ Server:
46
+ - nginx/1.17.3 + Phusion Passenger 6.0.4
47
+ Content-Encoding:
48
+ - gzip
35
49
  body:
36
50
  encoding: UTF-8
37
- string: '{"token":"E2aoXzMxkFsLnCcmCcc_"}'
51
+ string: Content of the 404 page
38
52
  http_version:
39
- recorded_at: Sat, 21 Nov 2015 22:31:02 GMT
53
+ recorded_at: Sun, 17 Nov 2019 16:39:30 GMT
40
54
  - request:
41
55
  method: post
42
- uri: http://acme.example.com:3000/tokens.json
56
+ uri: http://localhost:3000/locomotive/api/v3/tokens.json
43
57
  body:
44
58
  encoding: UTF-8
45
- string: email=admin%40locomotivecms.com&password=locomotive
59
+ string: api_key=d49cd50f6f0d2b163f48fc73cb249f0244c37074&email=admin%40locomotivecms.com
46
60
  headers:
61
+ User-Agent:
62
+ - Faraday v0.15.4
47
63
  Accept:
48
64
  - application/json
65
+ Accept-Encoding:
66
+ - gzip,deflate
67
+ Date:
68
+ - Sun, 17 Nov 2019 16:39:30 GMT
49
69
  Content-Type:
50
70
  - application/x-www-form-urlencoded
51
- Accept-Encoding:
52
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
53
- User-Agent:
54
- - Ruby
55
71
  response:
56
72
  status:
57
- code: 404
58
- message: Not Found
73
+ code: 201
74
+ message: Created
59
75
  headers:
60
- X-Frame-Options:
61
- - SAMEORIGIN
62
- X-Xss-Protection:
63
- - 1; mode=block
64
- X-Content-Type-Options:
65
- - nosniff
66
76
  Content-Type:
67
- - application/json; charset=utf-8
77
+ - application/json
78
+ Content-Length:
79
+ - '32'
80
+ Connection:
81
+ - keep-alive
82
+ Status:
83
+ - 201 Created
68
84
  Cache-Control:
69
- - no-cache
70
- X-Request-Id:
71
- - 14ab882f-7a7b-418a-a176-12bd1c9353d0
85
+ - max-age=0, private, must-revalidate
86
+ Etag:
87
+ - W/"410e3d6fde24f39257a7cc619b61baa7"
72
88
  X-Runtime:
73
- - '0.110531'
74
- Transfer-Encoding:
75
- - chunked
89
+ - '0.006916'
90
+ X-Request-Id:
91
+ - 1a38e024-0f9e-4efc-8344-9d4440248367
92
+ Date:
93
+ - Sun, 17 Nov 2019 16:39:30 GMT
94
+ X-Powered-By:
95
+ - Phusion Passenger 6.0.4
96
+ Server:
97
+ - nginx/1.17.3 + Phusion Passenger 6.0.4
76
98
  body:
77
99
  encoding: UTF-8
78
- string: |
79
- {"error":"no site found"}
100
+ string: '{"token":"bzwAyFQzcchf_hgDQhz3"}'
80
101
  http_version:
81
- recorded_at: Sat, 21 Nov 2015 22:31:03 GMT
82
- recorded_with: VCR 2.9.3
102
+ recorded_at: Sun, 17 Nov 2019 16:39:30 GMT
103
+ recorded_with: VCR 4.0.0
@@ -7,14 +7,16 @@ http_interactions:
7
7
  encoding: UTF-8
8
8
  string: email=admin%40locomotivecms.com&password=locomotive
9
9
  headers:
10
+ User-Agent:
11
+ - Faraday v0.15.4
10
12
  Accept:
11
13
  - application/json
14
+ Accept-Encoding:
15
+ - gzip,deflate
16
+ Date:
17
+ - Sun, 17 Nov 2019 16:39:24 GMT
12
18
  Content-Type:
13
19
  - application/x-www-form-urlencoded
14
- Accept-Encoding:
15
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
- User-Agent:
17
- - Ruby
18
20
  response:
19
21
  status:
20
22
  code: 201
@@ -22,38 +24,50 @@ http_interactions:
22
24
  headers:
23
25
  Content-Type:
24
26
  - application/json
25
- Etag:
26
- - W/"120917583ae3f64355d682b690f7cb40"
27
+ Content-Length:
28
+ - '32'
29
+ Connection:
30
+ - keep-alive
31
+ Status:
32
+ - 201 Created
27
33
  Cache-Control:
28
34
  - max-age=0, private, must-revalidate
29
- X-Request-Id:
30
- - 0d8afb02-0aed-4ed7-bb23-6c4020d43c7d
35
+ Etag:
36
+ - W/"410e3d6fde24f39257a7cc619b61baa7"
31
37
  X-Runtime:
32
- - '0.015846'
33
- Content-Length:
34
- - '32'
38
+ - '0.046028'
39
+ X-Request-Id:
40
+ - b43b120f-7852-4a87-9255-14c10c40a187
41
+ Date:
42
+ - Sun, 17 Nov 2019 16:39:24 GMT
43
+ X-Powered-By:
44
+ - Phusion Passenger 6.0.4
45
+ Server:
46
+ - nginx/1.17.3 + Phusion Passenger 6.0.4
35
47
  body:
36
48
  encoding: UTF-8
37
- string: '{"token":"E2aoXzMxkFsLnCcmCcc_"}'
49
+ string: '{"token":"bzwAyFQzcchf_hgDQhz3"}'
38
50
  http_version:
39
- recorded_at: Sat, 21 Nov 2015 22:30:57 GMT
51
+ recorded_at: Sun, 17 Nov 2019 16:39:24 GMT
40
52
  - request:
41
53
  method: get
42
- uri: http://localhost:3000/locomotive/sample/api/v3/translations.json?auth_token=E2aoXzMxkFsLnCcmCcc_
54
+ uri: http://localhost:3000/locomotive/sample/api/v3/translations.json?auth_token=bzwAyFQzcchf_hgDQhz3
43
55
  body:
44
- encoding: US-ASCII
56
+ encoding: UTF-8
45
57
  string: ''
46
58
  headers:
59
+ User-Agent:
60
+ - Faraday v0.15.4
47
61
  Accept:
48
62
  - application/json
63
+ Accept-Encoding:
64
+ - gzip,deflate
65
+ Date:
66
+ - Sun, 17 Nov 2019 16:39:24 GMT
49
67
  X-Locomotive-Account-Email:
50
68
  - admin@locomotivecms.com
51
69
  X-Locomotive-Account-Token:
52
- - E2aoXzMxkFsLnCcmCcc_
53
- Accept-Encoding:
54
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
55
- User-Agent:
56
- - Ruby
70
+ - bzwAyFQzcchf_hgDQhz3
57
71
  response:
58
72
  status:
59
73
  code: 200
@@ -61,40 +75,52 @@ http_interactions:
61
75
  headers:
62
76
  Content-Type:
63
77
  - application/json
64
- Etag:
65
- - W/"d751713988987e9331980363e24189ce"
78
+ Content-Length:
79
+ - '2'
80
+ Connection:
81
+ - keep-alive
82
+ Status:
83
+ - 200 OK
66
84
  Cache-Control:
67
85
  - max-age=0, private, must-revalidate
68
- X-Request-Id:
69
- - a6ddd5a8-c121-4956-b909-79eb0f8077dd
86
+ Etag:
87
+ - W/"4f53cda18c2baa0c0354bb5f9a3ecbe5"
70
88
  X-Runtime:
71
- - '0.039425'
72
- Content-Length:
73
- - '2'
89
+ - '0.020489'
90
+ X-Request-Id:
91
+ - 71718111-0b80-49a5-992a-720d90628b05
92
+ Date:
93
+ - Sun, 17 Nov 2019 16:39:24 GMT
94
+ X-Powered-By:
95
+ - Phusion Passenger 6.0.4
96
+ Server:
97
+ - nginx/1.17.3 + Phusion Passenger 6.0.4
74
98
  body:
75
99
  encoding: UTF-8
76
100
  string: "[]"
77
101
  http_version:
78
- recorded_at: Sat, 21 Nov 2015 22:30:58 GMT
102
+ recorded_at: Sun, 17 Nov 2019 16:39:24 GMT
79
103
  - request:
80
104
  method: post
81
105
  uri: http://localhost:3000/locomotive/sample/api/v3/translations.json
82
106
  body:
83
107
  encoding: UTF-8
84
- string: auth_token=E2aoXzMxkFsLnCcmCcc_&translation%5Bkey%5D=hello&translation%5Bvalues%5D%5Ben%5D=Hello+world&translation%5Bvalues%5D%5Bfr%5D=Bonjour+le+monde
108
+ string: auth_token=bzwAyFQzcchf_hgDQhz3&translation%5Bkey%5D=hello&translation%5Bvalues%5D%5Ben%5D=Hello+world&translation%5Bvalues%5D%5Bfr%5D=Bonjour+le+monde
85
109
  headers:
110
+ User-Agent:
111
+ - Faraday v0.15.4
86
112
  Accept:
87
113
  - application/json
114
+ Accept-Encoding:
115
+ - gzip,deflate
116
+ Date:
117
+ - Sun, 17 Nov 2019 16:39:24 GMT
88
118
  X-Locomotive-Account-Email:
89
119
  - admin@locomotivecms.com
90
120
  X-Locomotive-Account-Token:
91
- - E2aoXzMxkFsLnCcmCcc_
121
+ - bzwAyFQzcchf_hgDQhz3
92
122
  Content-Type:
93
123
  - application/x-www-form-urlencoded
94
- Accept-Encoding:
95
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
96
- User-Agent:
97
- - Ruby
98
124
  response:
99
125
  status:
100
126
  code: 201
@@ -102,41 +128,53 @@ http_interactions:
102
128
  headers:
103
129
  Content-Type:
104
130
  - application/json
105
- Etag:
106
- - W/"e12c448b863d0d73edecffe2625f35c2"
131
+ Content-Length:
132
+ - '174'
133
+ Connection:
134
+ - keep-alive
135
+ Status:
136
+ - 201 Created
107
137
  Cache-Control:
108
138
  - max-age=0, private, must-revalidate
109
- X-Request-Id:
110
- - a8d07bd2-dc1b-4281-8910-db7bbb5391b4
139
+ Etag:
140
+ - W/"5bfd76a49f28515ffbd139c7830379b5"
111
141
  X-Runtime:
112
- - '0.038517'
113
- Content-Length:
114
- - '174'
142
+ - '0.025324'
143
+ X-Request-Id:
144
+ - 03d43a3f-161d-47ab-a40c-d12bae3a944a
145
+ Date:
146
+ - Sun, 17 Nov 2019 16:39:24 GMT
147
+ X-Powered-By:
148
+ - Phusion Passenger 6.0.4
149
+ Server:
150
+ - nginx/1.17.3 + Phusion Passenger 6.0.4
115
151
  body:
116
152
  encoding: UTF-8
117
- string: '{"_id":"5650f0a287f6436cbc000002","created_at":"2015-11-21T22:30:58Z","updated_at":"2015-11-21T22:30:58Z","key":"hello","values":{"en":"Hello
153
+ string: '{"_id":"5dd177bca95330aa17f8f8dc","created_at":"2019-11-17T16:39:24Z","updated_at":"2019-11-17T16:39:24Z","key":"hello","values":{"en":"Hello
118
154
  world","fr":"Bonjour le monde"}}'
119
155
  http_version:
120
- recorded_at: Sat, 21 Nov 2015 22:30:58 GMT
156
+ recorded_at: Sun, 17 Nov 2019 16:39:24 GMT
121
157
  - request:
122
158
  method: put
123
- uri: http://localhost:3000/locomotive/sample/api/v3/translations/5650f0a287f6436cbc000002.json
159
+ uri: http://localhost:3000/locomotive/sample/api/v3/translations/5dd177bca95330aa17f8f8dc.json
124
160
  body:
125
161
  encoding: UTF-8
126
- string: auth_token=E2aoXzMxkFsLnCcmCcc_&translation%5Bvalues%5D%5Ben%5D=Hello+world%21&translation%5Bvalues%5D%5Bfr%5D=Bonjour+le+monde%21
162
+ string: auth_token=bzwAyFQzcchf_hgDQhz3&translation%5Bvalues%5D%5Ben%5D=Hello+world%21&translation%5Bvalues%5D%5Bfr%5D=Bonjour+le+monde%21
127
163
  headers:
164
+ User-Agent:
165
+ - Faraday v0.15.4
128
166
  Accept:
129
167
  - application/json
168
+ Accept-Encoding:
169
+ - gzip,deflate
170
+ Date:
171
+ - Sun, 17 Nov 2019 16:39:24 GMT
130
172
  X-Locomotive-Account-Email:
131
173
  - admin@locomotivecms.com
132
174
  X-Locomotive-Account-Token:
133
- - E2aoXzMxkFsLnCcmCcc_
175
+ - bzwAyFQzcchf_hgDQhz3
134
176
  Content-Type:
135
177
  - application/x-www-form-urlencoded
136
- Accept-Encoding:
137
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
138
- User-Agent:
139
- - Ruby
140
178
  response:
141
179
  status:
142
180
  code: 200
@@ -144,39 +182,53 @@ http_interactions:
144
182
  headers:
145
183
  Content-Type:
146
184
  - application/json
147
- Etag:
148
- - W/"6d40d07a511948d32eb20b44dd228610"
185
+ Transfer-Encoding:
186
+ - chunked
187
+ Connection:
188
+ - keep-alive
189
+ Status:
190
+ - 200 OK
149
191
  Cache-Control:
150
192
  - max-age=0, private, must-revalidate
151
- X-Request-Id:
152
- - 65e5ecda-6d24-42dd-bc34-06207c895e23
193
+ Etag:
194
+ - W/"a9dd42b07c0ce97f7ab2c0db135a913b"
153
195
  X-Runtime:
154
- - '0.032844'
155
- Content-Length:
156
- - '176'
196
+ - '0.022567'
197
+ X-Request-Id:
198
+ - 01b1fcbd-6883-4426-8bfd-01a1061e6bcf
199
+ Date:
200
+ - Sun, 17 Nov 2019 16:39:24 GMT
201
+ X-Powered-By:
202
+ - Phusion Passenger 6.0.4
203
+ Server:
204
+ - nginx/1.17.3 + Phusion Passenger 6.0.4
205
+ Content-Encoding:
206
+ - gzip
157
207
  body:
158
208
  encoding: UTF-8
159
- string: '{"_id":"5650f0a287f6436cbc000002","created_at":"2015-11-21T22:30:58Z","updated_at":"2015-11-21T22:30:58Z","key":"hello","values":{"en":"Hello
209
+ string: '{"_id":"5dd177bca95330aa17f8f8dc","created_at":"2019-11-17T16:39:24Z","updated_at":"2019-11-17T16:39:24Z","key":"hello","values":{"en":"Hello
160
210
  world!","fr":"Bonjour le monde!"}}'
161
211
  http_version:
162
- recorded_at: Sat, 21 Nov 2015 22:30:58 GMT
212
+ recorded_at: Sun, 17 Nov 2019 16:39:24 GMT
163
213
  - request:
164
214
  method: delete
165
- uri: http://localhost:3000/locomotive/sample/api/v3/translations/5650f0a287f6436cbc000002.json?auth_token=E2aoXzMxkFsLnCcmCcc_
215
+ uri: http://localhost:3000/locomotive/sample/api/v3/translations/5dd177bca95330aa17f8f8dc.json?auth_token=bzwAyFQzcchf_hgDQhz3
166
216
  body:
167
- encoding: US-ASCII
217
+ encoding: UTF-8
168
218
  string: ''
169
219
  headers:
220
+ User-Agent:
221
+ - Faraday v0.15.4
170
222
  Accept:
171
223
  - application/json
224
+ Accept-Encoding:
225
+ - gzip,deflate
226
+ Date:
227
+ - Sun, 17 Nov 2019 16:39:25 GMT
172
228
  X-Locomotive-Account-Email:
173
229
  - admin@locomotivecms.com
174
230
  X-Locomotive-Account-Token:
175
- - E2aoXzMxkFsLnCcmCcc_
176
- Accept-Encoding:
177
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
178
- User-Agent:
179
- - Ruby
231
+ - bzwAyFQzcchf_hgDQhz3
180
232
  response:
181
233
  status:
182
234
  code: 200
@@ -184,20 +236,32 @@ http_interactions:
184
236
  headers:
185
237
  Content-Type:
186
238
  - application/json
187
- Etag:
188
- - W/"6d40d07a511948d32eb20b44dd228610"
239
+ Transfer-Encoding:
240
+ - chunked
241
+ Connection:
242
+ - keep-alive
243
+ Status:
244
+ - 200 OK
189
245
  Cache-Control:
190
246
  - max-age=0, private, must-revalidate
191
- X-Request-Id:
192
- - 586cf345-c1ec-4ae6-8f02-249eea3a1e43
247
+ Etag:
248
+ - W/"a9dd42b07c0ce97f7ab2c0db135a913b"
193
249
  X-Runtime:
194
- - '0.041395'
195
- Content-Length:
196
- - '176'
250
+ - '0.021255'
251
+ X-Request-Id:
252
+ - be0d0c2b-b57c-4577-bd7e-2ebcdca4bbbd
253
+ Date:
254
+ - Sun, 17 Nov 2019 16:39:25 GMT
255
+ X-Powered-By:
256
+ - Phusion Passenger 6.0.4
257
+ Server:
258
+ - nginx/1.17.3 + Phusion Passenger 6.0.4
259
+ Content-Encoding:
260
+ - gzip
197
261
  body:
198
262
  encoding: UTF-8
199
- string: '{"_id":"5650f0a287f6436cbc000002","created_at":"2015-11-21T22:30:58Z","updated_at":"2015-11-21T22:30:58Z","key":"hello","values":{"en":"Hello
263
+ string: '{"_id":"5dd177bca95330aa17f8f8dc","created_at":"2019-11-17T16:39:24Z","updated_at":"2019-11-17T16:39:24Z","key":"hello","values":{"en":"Hello
200
264
  world!","fr":"Bonjour le monde!"}}'
201
265
  http_version:
202
- recorded_at: Sat, 21 Nov 2015 22:30:58 GMT
203
- recorded_with: VCR 2.9.3
266
+ recorded_at: Sun, 17 Nov 2019 16:39:25 GMT
267
+ recorded_with: VCR 4.0.0