locomotivecms_coal 1.0.0.pre.alpha.3 → 1.0.0.pre.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +7 -7
  3. data/README.md +60 -3
  4. data/lib/locomotive/coal/client.rb +10 -3
  5. data/lib/locomotive/coal/error.rb +4 -3
  6. data/lib/locomotive/coal/resources/concerns/request.rb +3 -3
  7. data/lib/locomotive/coal/resources/content_entries.rb +9 -0
  8. data/lib/locomotive/coal/resources/current_site.rb +25 -0
  9. data/lib/locomotive/coal/resources/memberships.rb +13 -0
  10. data/lib/locomotive/coal/resources/pages.rb +1 -1
  11. data/lib/locomotive/coal/resources/snippets.rb +8 -0
  12. data/lib/locomotive/coal/version.rb +1 -1
  13. data/lib/locomotive/coal.rb +3 -0
  14. data/locomotivecms_coal.gemspec +2 -2
  15. data/spec/fixtures/coal_cassettes/client.yml +117 -160
  16. data/spec/fixtures/coal_cassettes/content_assets.yml +47 -71
  17. data/spec/fixtures/coal_cassettes/content_entries.yml +510 -388
  18. data/spec/fixtures/coal_cassettes/content_types.yml +128 -196
  19. data/spec/fixtures/coal_cassettes/current_site.yml +124 -0
  20. data/spec/fixtures/coal_cassettes/memberships.yml +203 -0
  21. data/spec/fixtures/coal_cassettes/my_account.yml +40 -62
  22. data/spec/fixtures/coal_cassettes/pages.yml +82 -108
  23. data/spec/fixtures/coal_cassettes/sites.yml +43 -59
  24. data/spec/fixtures/coal_cassettes/snippets.yml +48 -70
  25. data/spec/fixtures/coal_cassettes/theme_assets.yml +46 -70
  26. data/spec/fixtures/coal_cassettes/token.yml +25 -31
  27. data/spec/fixtures/coal_cassettes/translations.yml +46 -70
  28. data/spec/fixtures/coal_cassettes/version.yml +18 -28
  29. data/spec/integration/resources/content_entries_spec.rb +11 -0
  30. data/spec/integration/resources/current_site_spec.rb +22 -0
  31. data/spec/integration/resources/memberships_spec.rb +39 -0
  32. metadata +16 -6
@@ -22,40 +22,34 @@ http_interactions:
22
22
  headers:
23
23
  Content-Type:
24
24
  - application/json
25
- Content-Length:
26
- - '32'
27
25
  Etag:
28
- - W/"6ba0e226b40adfde2d656d9027a1335f"
26
+ - W/"157eb61d395f237526d11950bbc5a1fa"
29
27
  Cache-Control:
30
28
  - max-age=0, private, must-revalidate
31
29
  X-Request-Id:
32
- - a1ad5536-7d7d-4bb9-a59c-d0a5bfe109dd
30
+ - 0a24b038-1f4d-4d63-9112-adebdb5637aa
33
31
  X-Runtime:
34
- - '0.016693'
35
- Connection:
36
- - keep-alive
37
- Server:
38
- - thin
32
+ - '0.015947'
33
+ Content-Length:
34
+ - '32'
39
35
  body:
40
36
  encoding: UTF-8
41
- string: '{"token":"Z9s7W_-BXyGQsDPFsorr"}'
37
+ string: '{"token":"v6XDp282UyPDeM6DgA-S"}'
42
38
  http_version:
43
- recorded_at: Mon, 04 May 2015 13:51:29 GMT
39
+ recorded_at: Wed, 29 Jul 2015 15:36:34 GMT
44
40
  - request:
45
41
  method: get
46
- uri: http://localhost:3000/locomotive/sample/api/v3/content_assets.json
42
+ uri: http://localhost:3000/locomotive/sample/api/v3/content_assets.json?auth_token=v6XDp282UyPDeM6DgA-S
47
43
  body:
48
- encoding: UTF-8
49
- string: auth_token=Z9s7W_-BXyGQsDPFsorr
44
+ encoding: US-ASCII
45
+ string: ''
50
46
  headers:
51
47
  Accept:
52
48
  - application/json
53
49
  X-Locomotive-Account-Email:
54
50
  - admin@locomotivecms.com
55
51
  X-Locomotive-Account-Token:
56
- - Z9s7W_-BXyGQsDPFsorr
57
- Content-Type:
58
- - application/x-www-form-urlencoded
52
+ - v6XDp282UyPDeM6DgA-S
59
53
  Accept-Encoding:
60
54
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
61
55
  User-Agent:
@@ -67,25 +61,21 @@ http_interactions:
67
61
  headers:
68
62
  Content-Type:
69
63
  - application/json
70
- Content-Length:
71
- - '2'
72
64
  Etag:
73
65
  - W/"d751713988987e9331980363e24189ce"
74
66
  Cache-Control:
75
67
  - max-age=0, private, must-revalidate
76
68
  X-Request-Id:
77
- - ba05d709-5caf-43f7-b3c7-078d8dcc3fb2
69
+ - 53ad7b7b-05db-4158-87e5-d0346b394f5c
78
70
  X-Runtime:
79
- - '0.029323'
80
- Connection:
81
- - keep-alive
82
- Server:
83
- - thin
71
+ - '0.075728'
72
+ Content-Length:
73
+ - '2'
84
74
  body:
85
75
  encoding: UTF-8
86
76
  string: "[]"
87
77
  http_version:
88
- recorded_at: Mon, 04 May 2015 13:51:29 GMT
78
+ recorded_at: Wed, 29 Jul 2015 15:36:34 GMT
89
79
  - request:
90
80
  method: post
91
81
  uri: http://localhost:3000/locomotive/sample/api/v3/content_assets.json
@@ -265,7 +255,7 @@ http_interactions:
265
255
  zZ/uVbu+4Zd1Nr1kLn00AZ7VJ/B8t/Du50zkuv4fvgGYnNqyFZUAAAAASUVO
266
256
  RK5CYIINCi0tLS0tLS0tLS0tLS1SdWJ5TXVsdGlwYXJ0UG9zdA0KQ29udGVu
267
257
  dC1EaXNwb3NpdGlvbjogZm9ybS1kYXRhOyBuYW1lPSJhdXRoX3Rva2VuIg0K
268
- DQpaOXM3V18tQlh5R1FzRFBGc29ycg0KLS0tLS0tLS0tLS0tLVJ1YnlNdWx0
258
+ DQp2NlhEcDI4MlV5UERlTTZEZ0EtUw0KLS0tLS0tLS0tLS0tLVJ1YnlNdWx0
269
259
  aXBhcnRQb3N0LS0NCg0K
270
260
  headers:
271
261
  Accept:
@@ -273,7 +263,7 @@ http_interactions:
273
263
  X-Locomotive-Account-Email:
274
264
  - admin@locomotivecms.com
275
265
  X-Locomotive-Account-Token:
276
- - Z9s7W_-BXyGQsDPFsorr
266
+ - v6XDp282UyPDeM6DgA-S
277
267
  Content-Type:
278
268
  - multipart/form-data; boundary=-----------RubyMultipartPost
279
269
  Content-Length:
@@ -289,28 +279,24 @@ http_interactions:
289
279
  headers:
290
280
  Content-Type:
291
281
  - application/json
292
- Content-Length:
293
- - '859'
294
282
  Etag:
295
- - W/"231018b349a0edea025e73d379a45d14"
283
+ - W/"488767597fd7f732946635d7ddfcf183"
296
284
  Cache-Control:
297
285
  - max-age=0, private, must-revalidate
298
286
  X-Request-Id:
299
- - b500accf-9d19-4b53-ba20-f0e03042ffed
287
+ - 76e0eae3-d74f-498d-961e-5fb893464694
300
288
  X-Runtime:
301
- - '0.048120'
302
- Connection:
303
- - keep-alive
304
- Server:
305
- - thin
289
+ - '0.181597'
290
+ Content-Length:
291
+ - '905'
306
292
  body:
307
293
  encoding: UTF-8
308
- string: '{"_id":"5547796164696432512f0300","created_at":"2015-05-04T13:51:29Z","updated_at":"2015-05-04T13:51:29Z","content_type":"image","width":50,"height":64,"vignette_url":"/sites/554779596469644d44050000/assets/5547796164696432512f0300/rails.png","alternative_vignette_url":"/images/dynamic/W1siZmYiLCIvVXNlcnMvZGlkaWVyL0RvY3VtZW50cy9Mb2NvbW90aXZlQ01TL2VuZ2luZS9zcGVjL2R1bW15L3B1YmxpYy9zaXRlcy81NTQ3Nzk1OTY0Njk2NDRkNDQwNTAwMDAvYXNzZXRzLzU1NDc3OTYxNjQ2OTY0MzI1MTJmMDMwMC9yYWlscy5wbmciXSxbInAiLCJ0aHVtYiIsIjE5MHgxMjBcdTAwM2UiLHsiZm9ybWF0IjoicG5nIiwiZnJhbWUiOjB9XSxbInAiLCJlbmNvZGUiLCJwbmciXV0/rails.png?sha=e49b3e0b7af32cb5","filename":"rails.png","short_name":"rails.png","extname":"png","full_filename":"rails.png","content_type_text":"image","with_thumbnail":true,"raw_size":7485,"url":"/sites/554779596469644d44050000/assets/5547796164696432512f0300/rails.png"}'
294
+ string: '{"_id":"55b8f302446964641a000002","created_at":"2015-07-29T15:36:34Z","updated_at":"2015-07-29T15:36:34Z","content_type":"image","width":50,"height":64,"vignette_url":"/sites/55b8f2ea4469646440000006/assets/55b8f302446964641a000002/rails.png","alternative_vignette_url":"/images/dynamic/W1siZmYiLCIvVXNlcnMvZGlkaWVyL0RvY3VtZW50cy9Mb2NvbW90aXZlQ01TL2VuZ2luZS9zcGVjL2R1bW15L3B1YmxpYy9zaXRlcy81NWI4ZjJlYTQ0Njk2NDY0NDAwMDAwMDYvYXNzZXRzLzU1YjhmMzAyNDQ2OTY0NjQxYTAwMDAwMi9yYWlscy5wbmciXSxbInAiLCJ0aHVtYiIsIjE5MHgxMjBcdTAwM2UiLHsiZm9ybWF0IjoicG5nIiwiZnJhbWUiOjB9XSxbInAiLCJlbmNvZGUiLCJwbmciXV0/rails.png?sha=c20906156dde3ed1","checksum":"933d32a3720db54b73003ba10a876eec","filename":"rails.png","short_name":"rails.png","extname":"png","full_filename":"rails.png","content_type_text":"image","with_thumbnail":true,"raw_size":7485,"url":"/sites/55b8f2ea4469646440000006/assets/55b8f302446964641a000002/rails.png"}'
309
295
  http_version:
310
- recorded_at: Mon, 04 May 2015 13:51:29 GMT
296
+ recorded_at: Wed, 29 Jul 2015 15:36:34 GMT
311
297
  - request:
312
298
  method: put
313
- uri: http://localhost:3000/locomotive/sample/api/v3/content_assets/5547796164696432512f0300.json
299
+ uri: http://localhost:3000/locomotive/sample/api/v3/content_assets/55b8f302446964641a000002.json
314
300
  body:
315
301
  encoding: ASCII-8BIT
316
302
  string: !binary |-
@@ -504,15 +490,15 @@ http_interactions:
504
490
  QAAEQAAEQAAEQAAEQAAEQAAEQAAEQAAEQAAEQAAEQAAEQAAEQAAEQAAEQAAE
505
491
  QAAEQMArAv8PisPwG9GP5SUAAAAASUVORK5CYIINCi0tLS0tLS0tLS0tLS1S
506
492
  dWJ5TXVsdGlwYXJ0UG9zdA0KQ29udGVudC1EaXNwb3NpdGlvbjogZm9ybS1k
507
- YXRhOyBuYW1lPSJhdXRoX3Rva2VuIg0KDQpaOXM3V18tQlh5R1FzRFBGc29y
508
- cg0KLS0tLS0tLS0tLS0tLVJ1YnlNdWx0aXBhcnRQb3N0LS0NCg0K
493
+ YXRhOyBuYW1lPSJhdXRoX3Rva2VuIg0KDQp2NlhEcDI4MlV5UERlTTZEZ0Et
494
+ Uw0KLS0tLS0tLS0tLS0tLVJ1YnlNdWx0aXBhcnRQb3N0LS0NCg0K
509
495
  headers:
510
496
  Accept:
511
497
  - application/json
512
498
  X-Locomotive-Account-Email:
513
499
  - admin@locomotivecms.com
514
500
  X-Locomotive-Account-Token:
515
- - Z9s7W_-BXyGQsDPFsorr
501
+ - v6XDp282UyPDeM6DgA-S
516
502
  Content-Type:
517
503
  - multipart/form-data; boundary=-----------RubyMultipartPost
518
504
  Content-Length:
@@ -528,40 +514,34 @@ http_interactions:
528
514
  headers:
529
515
  Content-Type:
530
516
  - application/json
531
- Content-Length:
532
- - '1104'
533
517
  Etag:
534
- - W/"56a40a31405ae64b74a1a3671b70cbaf"
518
+ - W/"57e0a3ff25647460212d40840fba5369"
535
519
  Cache-Control:
536
520
  - max-age=0, private, must-revalidate
537
521
  X-Request-Id:
538
- - 82415555-6f67-4955-bd51-49b614b7cd67
522
+ - 4b5ff1d7-038c-42c3-b924-4becdd59f84c
539
523
  X-Runtime:
540
- - '0.059595'
541
- Connection:
542
- - keep-alive
543
- Server:
544
- - thin
524
+ - '0.057554'
525
+ Content-Length:
526
+ - '1150'
545
527
  body:
546
528
  encoding: UTF-8
547
- string: '{"_id":"5547796164696432512f0300","created_at":"2015-05-04T13:51:29Z","updated_at":"2015-05-04T13:51:29Z","content_type":"image","width":256,"height":256,"vignette_url":"/images/dynamic/W1siZmYiLCIvVXNlcnMvZGlkaWVyL0RvY3VtZW50cy9Mb2NvbW90aXZlQ01TL2VuZ2luZS9zcGVjL2R1bW15L3B1YmxpYy9zaXRlcy81NTQ3Nzk1OTY0Njk2NDRkNDQwNTAwMDAvYXNzZXRzLzU1NDc3OTYxNjQ2OTY0MzI1MTJmMDMwMC9sb2NvbW90aXZlLnBuZyJdLFsicCIsInRodW1iIiwiODV4ODUjIl1d/locomotive.png?sha=607b1f8bdeca095c","alternative_vignette_url":"/images/dynamic/W1siZmYiLCIvVXNlcnMvZGlkaWVyL0RvY3VtZW50cy9Mb2NvbW90aXZlQ01TL2VuZ2luZS9zcGVjL2R1bW15L3B1YmxpYy9zaXRlcy81NTQ3Nzk1OTY0Njk2NDRkNDQwNTAwMDAvYXNzZXRzLzU1NDc3OTYxNjQ2OTY0MzI1MTJmMDMwMC9sb2NvbW90aXZlLnBuZyJdLFsicCIsInRodW1iIiwiMTkweDEyMFx1MDAzZSIseyJmb3JtYXQiOiJwbmciLCJmcmFtZSI6MH1dLFsicCIsImVuY29kZSIsInBuZyJdXQ/locomotive.png?sha=15e9157bc0afc21f","filename":"locomotive.png","short_name":"locomotive.png","extname":"png","full_filename":"locomotive.png","content_type_text":"image","with_thumbnail":true,"raw_size":8269,"url":"/sites/554779596469644d44050000/assets/5547796164696432512f0300/locomotive.png"}'
529
+ string: '{"_id":"55b8f302446964641a000002","created_at":"2015-07-29T15:36:34Z","updated_at":"2015-07-29T15:36:34Z","content_type":"image","width":256,"height":256,"vignette_url":"/images/dynamic/W1siZmYiLCIvVXNlcnMvZGlkaWVyL0RvY3VtZW50cy9Mb2NvbW90aXZlQ01TL2VuZ2luZS9zcGVjL2R1bW15L3B1YmxpYy9zaXRlcy81NWI4ZjJlYTQ0Njk2NDY0NDAwMDAwMDYvYXNzZXRzLzU1YjhmMzAyNDQ2OTY0NjQxYTAwMDAwMi9sb2NvbW90aXZlLnBuZyJdLFsicCIsInRodW1iIiwiODV4ODUjIl1d/locomotive.png?sha=15bfc6427f00c02d","alternative_vignette_url":"/images/dynamic/W1siZmYiLCIvVXNlcnMvZGlkaWVyL0RvY3VtZW50cy9Mb2NvbW90aXZlQ01TL2VuZ2luZS9zcGVjL2R1bW15L3B1YmxpYy9zaXRlcy81NWI4ZjJlYTQ0Njk2NDY0NDAwMDAwMDYvYXNzZXRzLzU1YjhmMzAyNDQ2OTY0NjQxYTAwMDAwMi9sb2NvbW90aXZlLnBuZyJdLFsicCIsInRodW1iIiwiMTkweDEyMFx1MDAzZSIseyJmb3JtYXQiOiJwbmciLCJmcmFtZSI6MH1dLFsicCIsImVuY29kZSIsInBuZyJdXQ/locomotive.png?sha=f18377134a32ae05","checksum":"933d32a3720db54b73003ba10a876eec","filename":"locomotive.png","short_name":"locomotive.png","extname":"png","full_filename":"locomotive.png","content_type_text":"image","with_thumbnail":true,"raw_size":8269,"url":"/sites/55b8f2ea4469646440000006/assets/55b8f302446964641a000002/locomotive.png"}'
548
530
  http_version:
549
- recorded_at: Mon, 04 May 2015 13:51:29 GMT
531
+ recorded_at: Wed, 29 Jul 2015 15:36:34 GMT
550
532
  - request:
551
533
  method: delete
552
- uri: http://localhost:3000/locomotive/sample/api/v3/content_assets/5547796164696432512f0300.json
534
+ uri: http://localhost:3000/locomotive/sample/api/v3/content_assets/55b8f302446964641a000002.json?auth_token=v6XDp282UyPDeM6DgA-S
553
535
  body:
554
- encoding: UTF-8
555
- string: auth_token=Z9s7W_-BXyGQsDPFsorr
536
+ encoding: US-ASCII
537
+ string: ''
556
538
  headers:
557
539
  Accept:
558
540
  - application/json
559
541
  X-Locomotive-Account-Email:
560
542
  - admin@locomotivecms.com
561
543
  X-Locomotive-Account-Token:
562
- - Z9s7W_-BXyGQsDPFsorr
563
- Content-Type:
564
- - application/x-www-form-urlencoded
544
+ - v6XDp282UyPDeM6DgA-S
565
545
  Accept-Encoding:
566
546
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
567
547
  User-Agent:
@@ -573,23 +553,19 @@ http_interactions:
573
553
  headers:
574
554
  Content-Type:
575
555
  - application/json
576
- Content-Length:
577
- - '1103'
578
556
  Etag:
579
- - W/"0fdbb4cd0d78131447c5c15f4f09581d"
557
+ - W/"b0bd7641a724e8a8501e609ed151a1f4"
580
558
  Cache-Control:
581
559
  - max-age=0, private, must-revalidate
582
560
  X-Request-Id:
583
- - 9706967a-f9ac-4283-a449-d95b5766bd15
561
+ - a3eb9386-82dc-4122-b0c5-8aa28187ebe1
584
562
  X-Runtime:
585
- - '0.054904'
586
- Connection:
587
- - keep-alive
588
- Server:
589
- - thin
563
+ - '0.052364'
564
+ Content-Length:
565
+ - '1149'
590
566
  body:
591
567
  encoding: UTF-8
592
- string: '{"_id":"5547796164696432512f0300","created_at":"2015-05-04T13:51:29Z","updated_at":"2015-05-04T13:51:29Z","content_type":"image","width":256,"height":256,"vignette_url":"/images/dynamic/W1siZmYiLCIvVXNlcnMvZGlkaWVyL0RvY3VtZW50cy9Mb2NvbW90aXZlQ01TL2VuZ2luZS9zcGVjL2R1bW15L3B1YmxpYy9zaXRlcy81NTQ3Nzk1OTY0Njk2NDRkNDQwNTAwMDAvYXNzZXRzLzU1NDc3OTYxNjQ2OTY0MzI1MTJmMDMwMC9sb2NvbW90aXZlLnBuZyJdLFsicCIsInRodW1iIiwiODV4ODUjIl1d/locomotive.png?sha=607b1f8bdeca095c","alternative_vignette_url":"/images/dynamic/W1siZmYiLCIvVXNlcnMvZGlkaWVyL0RvY3VtZW50cy9Mb2NvbW90aXZlQ01TL2VuZ2luZS9zcGVjL2R1bW15L3B1YmxpYy9zaXRlcy81NTQ3Nzk1OTY0Njk2NDRkNDQwNTAwMDAvYXNzZXRzLzU1NDc3OTYxNjQ2OTY0MzI1MTJmMDMwMC9sb2NvbW90aXZlLnBuZyJdLFsicCIsInRodW1iIiwiMTkweDEyMFx1MDAzZSIseyJmb3JtYXQiOiJwbmciLCJmcmFtZSI6MH1dLFsicCIsImVuY29kZSIsInBuZyJdXQ/locomotive.png?sha=15e9157bc0afc21f","filename":"locomotive.png","short_name":"locomotive.png","extname":null,"full_filename":"locomotive.png","content_type_text":"image","with_thumbnail":true,"raw_size":8269,"url":"/sites/554779596469644d44050000/assets/5547796164696432512f0300/locomotive.png"}'
568
+ string: '{"_id":"55b8f302446964641a000002","created_at":"2015-07-29T15:36:34Z","updated_at":"2015-07-29T15:36:34Z","content_type":"image","width":256,"height":256,"vignette_url":"/images/dynamic/W1siZmYiLCIvVXNlcnMvZGlkaWVyL0RvY3VtZW50cy9Mb2NvbW90aXZlQ01TL2VuZ2luZS9zcGVjL2R1bW15L3B1YmxpYy9zaXRlcy81NWI4ZjJlYTQ0Njk2NDY0NDAwMDAwMDYvYXNzZXRzLzU1YjhmMzAyNDQ2OTY0NjQxYTAwMDAwMi9sb2NvbW90aXZlLnBuZyJdLFsicCIsInRodW1iIiwiODV4ODUjIl1d/locomotive.png?sha=15bfc6427f00c02d","alternative_vignette_url":"/images/dynamic/W1siZmYiLCIvVXNlcnMvZGlkaWVyL0RvY3VtZW50cy9Mb2NvbW90aXZlQ01TL2VuZ2luZS9zcGVjL2R1bW15L3B1YmxpYy9zaXRlcy81NWI4ZjJlYTQ0Njk2NDY0NDAwMDAwMDYvYXNzZXRzLzU1YjhmMzAyNDQ2OTY0NjQxYTAwMDAwMi9sb2NvbW90aXZlLnBuZyJdLFsicCIsInRodW1iIiwiMTkweDEyMFx1MDAzZSIseyJmb3JtYXQiOiJwbmciLCJmcmFtZSI6MH1dLFsicCIsImVuY29kZSIsInBuZyJdXQ/locomotive.png?sha=f18377134a32ae05","checksum":"933d32a3720db54b73003ba10a876eec","filename":"locomotive.png","short_name":"locomotive.png","extname":null,"full_filename":"locomotive.png","content_type_text":"image","with_thumbnail":true,"raw_size":8269,"url":"/sites/55b8f2ea4469646440000006/assets/55b8f302446964641a000002/locomotive.png"}'
593
569
  http_version:
594
- recorded_at: Mon, 04 May 2015 13:51:29 GMT
570
+ recorded_at: Wed, 29 Jul 2015 15:36:34 GMT
595
571
  recorded_with: VCR 2.9.3