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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +1 -1
- data/Gemfile +0 -4
- data/Gemfile.lock +7 -8
- data/MIT-LICENSE +1 -1
- data/README.md +18 -3
- data/lib/locomotive/coal/client.rb +8 -0
- data/lib/locomotive/coal/resources/accounts.rb +33 -0
- data/lib/locomotive/coal/resources/concerns/request.rb +19 -1
- data/lib/locomotive/coal/version.rb +1 -1
- data/lib/locomotive/coal.rb +1 -0
- data/locomotivecms_coal.gemspec +1 -1
- data/spec/fixtures/coal_cassettes/accounts.yml +214 -0
- data/spec/fixtures/coal_cassettes/client.yml +277 -163
- data/spec/fixtures/coal_cassettes/content_assets.yml +144 -445
- data/spec/fixtures/coal_cassettes/content_entries.yml +963 -1647
- data/spec/fixtures/coal_cassettes/content_types.yml +387 -209
- data/spec/fixtures/coal_cassettes/current_site.yml +89 -49
- data/spec/fixtures/coal_cassettes/memberships.yml +143 -77
- data/spec/fixtures/coal_cassettes/my_account.yml +163 -99
- data/spec/fixtures/coal_cassettes/pages.yml +177 -99
- data/spec/fixtures/coal_cassettes/sections.yml +121 -78
- data/spec/fixtures/coal_cassettes/sites.yml +108 -141
- data/spec/fixtures/coal_cassettes/snippets.yml +140 -76
- data/spec/fixtures/coal_cassettes/theme_assets.yml +142 -254
- data/spec/fixtures/coal_cassettes/token.yml +64 -43
- data/spec/fixtures/coal_cassettes/translations.yml +140 -76
- data/spec/fixtures/coal_cassettes/version.yml +54 -30
- data/spec/integration/resources/accounts_spec.rb +38 -0
- data/spec/integration/resources/sections_spec.rb +1 -1
- data/spec/integration/resources/token_spec.rb +1 -1
- metadata +10 -6
@@ -2,81 +2,102 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: http://
|
5
|
+
uri: http://acme.example.local:3000/tokens.json
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string:
|
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:
|
21
|
-
message:
|
22
|
+
code: 404
|
23
|
+
message: Not Found
|
22
24
|
headers:
|
23
25
|
Content-Type:
|
24
|
-
-
|
25
|
-
|
26
|
-
-
|
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.
|
33
|
-
|
34
|
-
- '
|
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:
|
51
|
+
string: Content of the 404 page
|
38
52
|
http_version:
|
39
|
-
recorded_at:
|
53
|
+
recorded_at: Sun, 17 Nov 2019 16:39:30 GMT
|
40
54
|
- request:
|
41
55
|
method: post
|
42
|
-
uri: http://
|
56
|
+
uri: http://localhost:3000/locomotive/api/v3/tokens.json
|
43
57
|
body:
|
44
58
|
encoding: UTF-8
|
45
|
-
string: email=admin%40locomotivecms.com
|
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:
|
58
|
-
message:
|
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
|
77
|
+
- application/json
|
78
|
+
Content-Length:
|
79
|
+
- '32'
|
80
|
+
Connection:
|
81
|
+
- keep-alive
|
82
|
+
Status:
|
83
|
+
- 201 Created
|
68
84
|
Cache-Control:
|
69
|
-
-
|
70
|
-
|
71
|
-
-
|
85
|
+
- max-age=0, private, must-revalidate
|
86
|
+
Etag:
|
87
|
+
- W/"410e3d6fde24f39257a7cc619b61baa7"
|
72
88
|
X-Runtime:
|
73
|
-
- '0.
|
74
|
-
|
75
|
-
-
|
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:
|
82
|
-
recorded_with: VCR
|
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
|
-
|
26
|
-
-
|
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
|
-
|
30
|
-
-
|
35
|
+
Etag:
|
36
|
+
- W/"410e3d6fde24f39257a7cc619b61baa7"
|
31
37
|
X-Runtime:
|
32
|
-
- '0.
|
33
|
-
|
34
|
-
-
|
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":"
|
49
|
+
string: '{"token":"bzwAyFQzcchf_hgDQhz3"}'
|
38
50
|
http_version:
|
39
|
-
recorded_at:
|
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=
|
54
|
+
uri: http://localhost:3000/locomotive/sample/api/v3/translations.json?auth_token=bzwAyFQzcchf_hgDQhz3
|
43
55
|
body:
|
44
|
-
encoding:
|
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
|
-
-
|
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
|
-
|
65
|
-
-
|
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
|
-
|
69
|
-
-
|
86
|
+
Etag:
|
87
|
+
- W/"4f53cda18c2baa0c0354bb5f9a3ecbe5"
|
70
88
|
X-Runtime:
|
71
|
-
- '0.
|
72
|
-
|
73
|
-
-
|
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:
|
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=
|
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
|
-
-
|
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
|
-
|
106
|
-
-
|
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
|
-
|
110
|
-
-
|
139
|
+
Etag:
|
140
|
+
- W/"5bfd76a49f28515ffbd139c7830379b5"
|
111
141
|
X-Runtime:
|
112
|
-
- '0.
|
113
|
-
|
114
|
-
-
|
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":"
|
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:
|
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/
|
159
|
+
uri: http://localhost:3000/locomotive/sample/api/v3/translations/5dd177bca95330aa17f8f8dc.json
|
124
160
|
body:
|
125
161
|
encoding: UTF-8
|
126
|
-
string: auth_token=
|
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
|
-
-
|
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
|
-
|
148
|
-
-
|
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
|
-
|
152
|
-
-
|
193
|
+
Etag:
|
194
|
+
- W/"a9dd42b07c0ce97f7ab2c0db135a913b"
|
153
195
|
X-Runtime:
|
154
|
-
- '0.
|
155
|
-
|
156
|
-
-
|
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":"
|
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:
|
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/
|
215
|
+
uri: http://localhost:3000/locomotive/sample/api/v3/translations/5dd177bca95330aa17f8f8dc.json?auth_token=bzwAyFQzcchf_hgDQhz3
|
166
216
|
body:
|
167
|
-
encoding:
|
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
|
-
-
|
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
|
-
|
188
|
-
-
|
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
|
-
|
192
|
-
-
|
247
|
+
Etag:
|
248
|
+
- W/"a9dd42b07c0ce97f7ab2c0db135a913b"
|
193
249
|
X-Runtime:
|
194
|
-
- '0.
|
195
|
-
|
196
|
-
-
|
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":"
|
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:
|
203
|
-
recorded_with: VCR
|
266
|
+
recorded_at: Sun, 17 Nov 2019 16:39:25 GMT
|
267
|
+
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
|
-
|
26
|
-
-
|
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
|
-
|
30
|
-
-
|
35
|
+
Etag:
|
36
|
+
- W/"410e3d6fde24f39257a7cc619b61baa7"
|
31
37
|
X-Runtime:
|
32
|
-
- '0.
|
33
|
-
|
34
|
-
-
|
38
|
+
- '0.004813'
|
39
|
+
X-Request-Id:
|
40
|
+
- 4dbdd6ff-8e32-494e-a364-3c8f05ed4619
|
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":"
|
49
|
+
string: '{"token":"bzwAyFQzcchf_hgDQhz3"}'
|
38
50
|
http_version:
|
39
|
-
recorded_at:
|
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/version.json?auth_token=
|
54
|
+
uri: http://localhost:3000/locomotive/sample/api/v3/version.json?auth_token=bzwAyFQzcchf_hgDQhz3&email=admin@locomotivecms.com&token=bzwAyFQzcchf_hgDQhz3
|
43
55
|
body:
|
44
|
-
encoding:
|
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
|
-
-
|
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,19 +75,29 @@ http_interactions:
|
|
61
75
|
headers:
|
62
76
|
Content-Type:
|
63
77
|
- application/json
|
64
|
-
|
65
|
-
-
|
78
|
+
Content-Length:
|
79
|
+
- '22'
|
80
|
+
Connection:
|
81
|
+
- keep-alive
|
82
|
+
Status:
|
83
|
+
- 200 OK
|
66
84
|
Cache-Control:
|
67
85
|
- max-age=0, private, must-revalidate
|
68
|
-
|
69
|
-
-
|
86
|
+
Etag:
|
87
|
+
- W/"f981a5a7069dbbda33875006acb1b026"
|
70
88
|
X-Runtime:
|
71
|
-
- '0.
|
72
|
-
|
73
|
-
-
|
89
|
+
- '0.006873'
|
90
|
+
X-Request-Id:
|
91
|
+
- 5a103059-2a24-401f-94ca-49c2e1c657a9
|
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
|
-
string: '{"engine":"
|
100
|
+
string: '{"engine":"4.0.0.rc0"}'
|
77
101
|
http_version:
|
78
|
-
recorded_at:
|
79
|
-
recorded_with: VCR
|
102
|
+
recorded_at: Sun, 17 Nov 2019 16:39:24 GMT
|
103
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Locomotive::Coal::Resources::Accounts, order: :defined do
|
4
|
+
|
5
|
+
before { VCR.insert_cassette 'accounts', record: :new_episodes }
|
6
|
+
after { VCR.eject_cassette }
|
7
|
+
|
8
|
+
let(:uri) { TEST_API_V3_URI }
|
9
|
+
let(:credentials) { { email: TEST_API_EMAIL, token: api_token } }
|
10
|
+
let(:accounts) { described_class.new(uri, credentials) }
|
11
|
+
|
12
|
+
describe '#all' do
|
13
|
+
|
14
|
+
subject { accounts.all }
|
15
|
+
it { expect(subject.size).to be > 0 }
|
16
|
+
|
17
|
+
describe 'first account' do
|
18
|
+
subject { accounts.all }
|
19
|
+
it { expect(subject.to_a.map { |a| a.name }).to include('New Admin', 'John Doe') }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
describe '#create' do
|
24
|
+
subject { create_account }
|
25
|
+
it { expect(subject._id).not_to eq nil }
|
26
|
+
end
|
27
|
+
|
28
|
+
describe '#destroy' do
|
29
|
+
let(:new_account) { accounts.all.find { |a| a.email == 'jane@doe.net' } || create_account }
|
30
|
+
subject { accounts.destroy(new_account._id) }
|
31
|
+
it { expect(subject._id).not_to eq nil }
|
32
|
+
end
|
33
|
+
|
34
|
+
def create_account
|
35
|
+
accounts.create(name: 'Jane', email: 'jane@doe.net', password: 'easyone', password_confirmation: 'easyone')
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
@@ -14,7 +14,7 @@ describe Locomotive::Coal::Resources::Token do
|
|
14
14
|
subject { token.get }
|
15
15
|
|
16
16
|
context 'uri not pointing to a Locomotive engine' do
|
17
|
-
let(:uri) { URI('http://acme.example.
|
17
|
+
let(:uri) { URI('http://acme.example.local:3000') }
|
18
18
|
let(:credentials) { TEST_API_CREDENTIALS }
|
19
19
|
it { expect { subject }.to raise_error Locomotive::Coal::UnknownResourceError }
|
20
20
|
end
|