locomotivecms_coal 1.6.0.rc1 → 1.6.0.rc2

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 +1 -1
  4. data/Gemfile +0 -4
  5. data/Gemfile.lock +7 -8
  6. data/MIT-LICENSE +1 -1
  7. data/README.md +18 -3
  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 +1 -1
  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 +10 -6
@@ -2,19 +2,21 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: http://localhost:3000/locomotive/api/v3/my_account.json
5
+ uri: http://localhost:3000/locomotive/api/v3/tokens.json
6
6
  body:
7
7
  encoding: UTF-8
8
- string: account%5Bemail%5D=jack%40doe.net&account%5Bname%5D=Jack+Doe&account%5Bpassword%5D=easyone&account%5Bpassword_confirmation%5D=easyone
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:30 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,175 +24,237 @@ http_interactions:
22
24
  headers:
23
25
  Content-Type:
24
26
  - application/json
25
- Etag:
26
- - W/"dce6a314e0a0733cd3d313f6a20efa40"
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
- - 70848878-d96e-4830-b461-8f9036921cbe
35
+ Etag:
36
+ - W/"410e3d6fde24f39257a7cc619b61baa7"
31
37
  X-Runtime:
32
- - '0.486625'
33
- Content-Length:
34
- - '254'
38
+ - '0.004127'
39
+ X-Request-Id:
40
+ - edee538a-e182-4fc2-87d7-2e4bc60c00d6
41
+ Date:
42
+ - Sun, 17 Nov 2019 16:39:30 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: '{"_id":"5650f0a087f6436cbc000000","created_at":"2015-11-21T22:30:56Z","updated_at":"2015-11-21T22:30:56Z","name":"Jack
38
- Doe","email":"jack@doe.net","locale":"en","api_key":"92f2e03b57b3f31f485ecf4d99bc94ea20eee862","super_admin":false,"local_admin":false}'
49
+ string: '{"token":"bzwAyFQzcchf_hgDQhz3"}'
39
50
  http_version:
40
- recorded_at: Sat, 21 Nov 2015 22:30:56 GMT
51
+ recorded_at: Sun, 17 Nov 2019 16:39:30 GMT
41
52
  - request:
42
- method: post
53
+ method: put
43
54
  uri: http://localhost:3000/locomotive/api/v3/my_account.json
44
55
  body:
45
56
  encoding: UTF-8
46
- string: account%5Bname%5D=Wrong+account
57
+ string: account%5Bname%5D=John+Doe&auth_token=bzwAyFQzcchf_hgDQhz3
47
58
  headers:
59
+ User-Agent:
60
+ - Faraday v0.15.4
48
61
  Accept:
49
62
  - application/json
63
+ Accept-Encoding:
64
+ - gzip,deflate
65
+ Date:
66
+ - Sun, 17 Nov 2019 16:39:30 GMT
67
+ X-Locomotive-Account-Email:
68
+ - admin@locomotivecms.com
69
+ X-Locomotive-Account-Token:
70
+ - bzwAyFQzcchf_hgDQhz3
50
71
  Content-Type:
51
72
  - application/x-www-form-urlencoded
52
- Accept-Encoding:
53
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
54
- User-Agent:
55
- - Ruby
56
73
  response:
57
74
  status:
58
- code: 422
59
- message: Unprocessable Entity
75
+ code: 200
76
+ message: OK
60
77
  headers:
61
78
  Content-Type:
62
79
  - application/json
80
+ Transfer-Encoding:
81
+ - chunked
82
+ Connection:
83
+ - keep-alive
84
+ Status:
85
+ - 200 OK
63
86
  Cache-Control:
64
- - no-cache
65
- X-Request-Id:
66
- - 3fab80c5-9da7-4de9-8b9f-5e0ffa3bb1c1
87
+ - max-age=0, private, must-revalidate
88
+ Etag:
89
+ - W/"7f5b02da1aa964d6d9d0be396d5d6fb9"
67
90
  X-Runtime:
68
- - '0.600956'
69
- Content-Length:
70
- - '92'
91
+ - '0.016235'
92
+ X-Request-Id:
93
+ - 7b9c8cd3-5e5e-4bc6-baec-567c194bcec9
94
+ Date:
95
+ - Sun, 17 Nov 2019 16:39:30 GMT
96
+ X-Powered-By:
97
+ - Phusion Passenger 6.0.4
98
+ Server:
99
+ - nginx/1.17.3 + Phusion Passenger 6.0.4
100
+ Content-Encoding:
101
+ - gzip
71
102
  body:
72
103
  encoding: UTF-8
73
- string: '{"error":"Resource invalid","attributes":{"email":["is missing"],"password":["is
74
- missing"]}}'
104
+ string: '{"_id":"5dd1779ba95330a94bf7253c","created_at":"2019-11-17T16:38:51Z","updated_at":"2019-11-17T16:39:30Z","name":"John
105
+ Doe","email":"admin@locomotivecms.com","locale":"en","api_key":"d49cd50f6f0d2b163f48fc73cb249f0244c37074","super_admin":true,"local_admin":true}'
75
106
  http_version:
76
- recorded_at: Sat, 21 Nov 2015 22:30:57 GMT
107
+ recorded_at: Sun, 17 Nov 2019 16:39:30 GMT
77
108
  - request:
78
- method: post
79
- uri: http://localhost:3000/locomotive/api/v3/tokens.json
109
+ method: get
110
+ uri: http://localhost:3000/locomotive/api/v3/my_account.json?auth_token=bzwAyFQzcchf_hgDQhz3
80
111
  body:
81
112
  encoding: UTF-8
82
- string: email=admin%40locomotivecms.com&password=locomotive
113
+ string: ''
83
114
  headers:
115
+ User-Agent:
116
+ - Faraday v0.15.4
84
117
  Accept:
85
118
  - application/json
86
- Content-Type:
87
- - application/x-www-form-urlencoded
88
119
  Accept-Encoding:
89
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
90
- User-Agent:
91
- - Ruby
120
+ - gzip,deflate
121
+ Date:
122
+ - Sun, 17 Nov 2019 16:39:30 GMT
123
+ X-Locomotive-Account-Email:
124
+ - admin@locomotivecms.com
125
+ X-Locomotive-Account-Token:
126
+ - bzwAyFQzcchf_hgDQhz3
92
127
  response:
93
128
  status:
94
- code: 201
95
- message: Created
129
+ code: 200
130
+ message: OK
96
131
  headers:
97
132
  Content-Type:
98
133
  - application/json
99
- Etag:
100
- - W/"120917583ae3f64355d682b690f7cb40"
134
+ Transfer-Encoding:
135
+ - chunked
136
+ Connection:
137
+ - keep-alive
138
+ Status:
139
+ - 200 OK
101
140
  Cache-Control:
102
141
  - max-age=0, private, must-revalidate
103
- X-Request-Id:
104
- - 1101bb4a-c567-4209-95ad-d151951e68d6
142
+ Etag:
143
+ - W/"7f5b02da1aa964d6d9d0be396d5d6fb9"
105
144
  X-Runtime:
106
- - '0.018846'
107
- Content-Length:
108
- - '32'
145
+ - '0.007792'
146
+ X-Request-Id:
147
+ - 2037c4b1-cd3c-4f90-a52b-d7d8ed64ffca
148
+ Date:
149
+ - Sun, 17 Nov 2019 16:39:30 GMT
150
+ X-Powered-By:
151
+ - Phusion Passenger 6.0.4
152
+ Server:
153
+ - nginx/1.17.3 + Phusion Passenger 6.0.4
154
+ Content-Encoding:
155
+ - gzip
109
156
  body:
110
157
  encoding: UTF-8
111
- string: '{"token":"E2aoXzMxkFsLnCcmCcc_"}'
158
+ string: '{"_id":"5dd1779ba95330a94bf7253c","created_at":"2019-11-17T16:38:51Z","updated_at":"2019-11-17T16:39:30Z","name":"John
159
+ Doe","email":"admin@locomotivecms.com","locale":"en","api_key":"d49cd50f6f0d2b163f48fc73cb249f0244c37074","super_admin":true,"local_admin":true}'
112
160
  http_version:
113
- recorded_at: Sat, 21 Nov 2015 22:30:57 GMT
161
+ recorded_at: Sun, 17 Nov 2019 16:39:30 GMT
114
162
  - request:
115
- method: put
163
+ method: post
116
164
  uri: http://localhost:3000/locomotive/api/v3/my_account.json
117
165
  body:
118
166
  encoding: UTF-8
119
- string: account%5Bname%5D=John+Doe&auth_token=E2aoXzMxkFsLnCcmCcc_
167
+ string: account%5Bemail%5D=jack%40doe.net&account%5Bname%5D=Jack+Doe&account%5Bpassword%5D=easyone&account%5Bpassword_confirmation%5D=easyone
120
168
  headers:
169
+ User-Agent:
170
+ - Faraday v0.15.4
121
171
  Accept:
122
172
  - application/json
123
- X-Locomotive-Account-Email:
124
- - admin@locomotivecms.com
125
- X-Locomotive-Account-Token:
126
- - E2aoXzMxkFsLnCcmCcc_
173
+ Accept-Encoding:
174
+ - gzip,deflate
175
+ Date:
176
+ - Sun, 17 Nov 2019 16:39:30 GMT
127
177
  Content-Type:
128
178
  - application/x-www-form-urlencoded
129
- Accept-Encoding:
130
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
131
- User-Agent:
132
- - Ruby
133
179
  response:
134
180
  status:
135
- code: 200
136
- message: OK
181
+ code: 201
182
+ message: Created
137
183
  headers:
138
184
  Content-Type:
139
185
  - application/json
140
- Etag:
141
- - W/"aa5b3af2d3ff7e0d53fd68d1d077876d"
186
+ Content-Length:
187
+ - '254'
188
+ Connection:
189
+ - keep-alive
190
+ Status:
191
+ - 201 Created
142
192
  Cache-Control:
143
193
  - max-age=0, private, must-revalidate
144
- X-Request-Id:
145
- - dc423123-88c7-4cc7-a7f5-e021ab2abe79
194
+ Etag:
195
+ - W/"a6622ed0db1411c79380131ed794f25f"
146
196
  X-Runtime:
147
- - '0.040982'
148
- Content-Length:
149
- - '264'
197
+ - '0.013885'
198
+ X-Request-Id:
199
+ - 4672e3bc-c78d-4dda-936b-717500fc9daf
200
+ Date:
201
+ - Sun, 17 Nov 2019 16:39:30 GMT
202
+ X-Powered-By:
203
+ - Phusion Passenger 6.0.4
204
+ Server:
205
+ - nginx/1.17.3 + Phusion Passenger 6.0.4
150
206
  body:
151
207
  encoding: UTF-8
152
- string: '{"_id":"5650f08c87f6436c94000000","created_at":"2015-11-21T22:30:36Z","updated_at":"2015-11-21T22:30:57Z","name":"John
153
- Doe","email":"admin@locomotivecms.com","locale":"en","api_key":"d49cd50f6f0d2b163f48fc73cb249f0244c37074","super_admin":false,"local_admin":true}'
208
+ string: '{"_id":"5dd177c2a95330aa17f8f8df","created_at":"2019-11-17T16:39:30Z","updated_at":"2019-11-17T16:39:30Z","name":"Jack
209
+ Doe","email":"jack@doe.net","locale":"en","api_key":"b99855e630e7510ee902e0871f213328cfcbc552","super_admin":false,"local_admin":false}'
154
210
  http_version:
155
- recorded_at: Sat, 21 Nov 2015 22:30:57 GMT
211
+ recorded_at: Sun, 17 Nov 2019 16:39:30 GMT
156
212
  - request:
157
- method: get
158
- uri: http://localhost:3000/locomotive/api/v3/my_account.json?auth_token=E2aoXzMxkFsLnCcmCcc_
213
+ method: post
214
+ uri: http://localhost:3000/locomotive/api/v3/my_account.json
159
215
  body:
160
- encoding: US-ASCII
161
- string: ''
216
+ encoding: UTF-8
217
+ string: account%5Bname%5D=Wrong+account
162
218
  headers:
219
+ User-Agent:
220
+ - Faraday v0.15.4
163
221
  Accept:
164
222
  - application/json
165
- X-Locomotive-Account-Email:
166
- - admin@locomotivecms.com
167
- X-Locomotive-Account-Token:
168
- - E2aoXzMxkFsLnCcmCcc_
169
223
  Accept-Encoding:
170
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
171
- User-Agent:
172
- - Ruby
224
+ - gzip,deflate
225
+ Date:
226
+ - Sun, 17 Nov 2019 16:39:30 GMT
227
+ Content-Type:
228
+ - application/x-www-form-urlencoded
173
229
  response:
174
230
  status:
175
- code: 200
176
- message: OK
231
+ code: 422
232
+ message: Unprocessable Entity
177
233
  headers:
178
234
  Content-Type:
179
235
  - application/json
180
- Etag:
181
- - W/"aa5b3af2d3ff7e0d53fd68d1d077876d"
236
+ Content-Length:
237
+ - '92'
238
+ Connection:
239
+ - keep-alive
240
+ Status:
241
+ - 422 Unprocessable Entity
182
242
  Cache-Control:
183
- - max-age=0, private, must-revalidate
184
- X-Request-Id:
185
- - 92138415-2bf7-452a-b04c-d947488d0b71
243
+ - no-cache
186
244
  X-Runtime:
187
- - '0.019667'
188
- Content-Length:
189
- - '264'
245
+ - '0.006917'
246
+ X-Request-Id:
247
+ - 323b1477-94b4-4e06-9da3-48e09f37bbc3
248
+ Date:
249
+ - Sun, 17 Nov 2019 16:39:30 GMT
250
+ X-Powered-By:
251
+ - Phusion Passenger 6.0.4
252
+ Server:
253
+ - nginx/1.17.3 + Phusion Passenger 6.0.4
190
254
  body:
191
255
  encoding: UTF-8
192
- string: '{"_id":"5650f08c87f6436c94000000","created_at":"2015-11-21T22:30:36Z","updated_at":"2015-11-21T22:30:57Z","name":"John
193
- Doe","email":"admin@locomotivecms.com","locale":"en","api_key":"d49cd50f6f0d2b163f48fc73cb249f0244c37074","super_admin":false,"local_admin":true}'
256
+ string: '{"error":"Resource invalid","attributes":{"email":["is missing"],"password":["is
257
+ missing"]}}'
194
258
  http_version:
195
- recorded_at: Sat, 21 Nov 2015 22:30:57 GMT
196
- recorded_with: VCR 2.9.3
259
+ recorded_at: Sun, 17 Nov 2019 16:39:30 GMT
260
+ recorded_with: VCR 4.0.0