contentful 2.16.0 → 2.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +3 -0
  3. data/lib/contentful/version.rb +1 -1
  4. metadata +3 -370
  5. data/.gitignore +0 -7
  6. data/.rspec +0 -1
  7. data/.rubocop.yml +0 -31
  8. data/.rubocop_todo.yml +0 -35
  9. data/.travis.yml +0 -15
  10. data/.yardopts +0 -4
  11. data/Gemfile +0 -9
  12. data/Guardfile +0 -24
  13. data/RELEASE.md +0 -8
  14. data/Rakefile +0 -33
  15. data/contentful.gemspec +0 -44
  16. data/examples/custom_classes.rb +0 -39
  17. data/examples/example_queries.rb +0 -26
  18. data/examples/raise_errors.rb +0 -20
  19. data/examples/raw_mode.rb +0 -14
  20. data/spec/array_spec.rb +0 -187
  21. data/spec/asset_spec.rb +0 -220
  22. data/spec/auto_includes_spec.rb +0 -12
  23. data/spec/client_class_spec.rb +0 -86
  24. data/spec/client_configuration_spec.rb +0 -394
  25. data/spec/content_type_spec.rb +0 -49
  26. data/spec/deleted_asset_spec.rb +0 -38
  27. data/spec/deleted_entry_spec.rb +0 -38
  28. data/spec/entry_spec.rb +0 -815
  29. data/spec/error_class_spec.rb +0 -327
  30. data/spec/error_requests_spec.rb +0 -87
  31. data/spec/field_spec.rb +0 -95
  32. data/spec/file_spec.rb +0 -33
  33. data/spec/fixtures/json_responses/400_details_errors_object.json +0 -14
  34. data/spec/fixtures/json_responses/400_details_errors_string.json +0 -12
  35. data/spec/fixtures/json_responses/400_details_string.json +0 -8
  36. data/spec/fixtures/json_responses/403_reasons.json +0 -13
  37. data/spec/fixtures/json_responses/404_details_string.json +0 -8
  38. data/spec/fixtures/json_responses/404_id.json +0 -11
  39. data/spec/fixtures/json_responses/404_sys_type.json +0 -12
  40. data/spec/fixtures/json_responses/404_type.json +0 -10
  41. data/spec/fixtures/json_responses/content_type.json +0 -83
  42. data/spec/fixtures/json_responses/default_400.json +0 -7
  43. data/spec/fixtures/json_responses/default_401.json +0 -7
  44. data/spec/fixtures/json_responses/default_403.json +0 -7
  45. data/spec/fixtures/json_responses/default_404.json +0 -7
  46. data/spec/fixtures/json_responses/default_429.json +0 -7
  47. data/spec/fixtures/json_responses/default_500.json +0 -7
  48. data/spec/fixtures/json_responses/default_502.json +0 -7
  49. data/spec/fixtures/json_responses/default_503.json +0 -7
  50. data/spec/fixtures/json_responses/includes.json +0 -111
  51. data/spec/fixtures/json_responses/link_array.json +0 -43
  52. data/spec/fixtures/json_responses/not_found.json +0 -13
  53. data/spec/fixtures/json_responses/nyancat.json +0 -48
  54. data/spec/fixtures/json_responses/other_error.json +0 -9
  55. data/spec/fixtures/json_responses/other_error_no_details.json +0 -8
  56. data/spec/fixtures/json_responses/other_error_no_message.json +0 -8
  57. data/spec/fixtures/json_responses/other_error_no_request_id.json +0 -8
  58. data/spec/fixtures/json_responses/other_error_nothing.json +0 -6
  59. data/spec/fixtures/json_responses/self_link.json +0 -82
  60. data/spec/fixtures/json_responses/unparsable.json +0 -13
  61. data/spec/fixtures/vcr_cassettes/array.yml +0 -288
  62. data/spec/fixtures/vcr_cassettes/array/marshal_custom_classes.yml +0 -159
  63. data/spec/fixtures/vcr_cassettes/array/marshal_unpublished.yml +0 -315
  64. data/spec/fixtures/vcr_cassettes/array/nested_resources.yml +0 -159
  65. data/spec/fixtures/vcr_cassettes/arrayField.yml +0 -87
  66. data/spec/fixtures/vcr_cassettes/array_page_1.yml +0 -106
  67. data/spec/fixtures/vcr_cassettes/array_page_2.yml +0 -73
  68. data/spec/fixtures/vcr_cassettes/asset.yml +0 -96
  69. data/spec/fixtures/vcr_cassettes/asset/select_empty_array.yml +0 -104
  70. data/spec/fixtures/vcr_cassettes/asset/select_no_sys.yml +0 -119
  71. data/spec/fixtures/vcr_cassettes/asset/select_one_field.yml +0 -97
  72. data/spec/fixtures/vcr_cassettes/asset/select_only_sys.yml +0 -88
  73. data/spec/fixtures/vcr_cassettes/asset/with_tags.yml +0 -138
  74. data/spec/fixtures/vcr_cassettes/assets/issues_129.yml +0 -90
  75. data/spec/fixtures/vcr_cassettes/assets/issues_jekyll_46.yml +0 -115
  76. data/spec/fixtures/vcr_cassettes/bad_request.yml +0 -76
  77. data/spec/fixtures/vcr_cassettes/content_type.yml +0 -147
  78. data/spec/fixtures/vcr_cassettes/entries.yml +0 -561
  79. data/spec/fixtures/vcr_cassettes/entries/empty_fields.yml +0 -246
  80. data/spec/fixtures/vcr_cassettes/entries/issue_117.yml +0 -201
  81. data/spec/fixtures/vcr_cassettes/entries/issue_125.yml +0 -198
  82. data/spec/fixtures/vcr_cassettes/entries/rich_text.yml +0 -1707
  83. data/spec/fixtures/vcr_cassettes/entries/rich_text_hydration_issue.yml +0 -460
  84. data/spec/fixtures/vcr_cassettes/entries/rich_text_nested_fields.yml +0 -653
  85. data/spec/fixtures/vcr_cassettes/entries/rich_text_unresolved_relationships.yml +0 -983
  86. data/spec/fixtures/vcr_cassettes/entries/unresolvable_assets.yml +0 -89
  87. data/spec/fixtures/vcr_cassettes/entries/unresolvable_filter.yml +0 -159
  88. data/spec/fixtures/vcr_cassettes/entries/unresolvable_filter_deeply_nested.yml +0 -167
  89. data/spec/fixtures/vcr_cassettes/entry.yml +0 -102
  90. data/spec/fixtures/vcr_cassettes/entry/custom_resource.yml +0 -168
  91. data/spec/fixtures/vcr_cassettes/entry/include_resolution.yml +0 -101
  92. data/spec/fixtures/vcr_cassettes/entry/include_resolution_uniques.yml +0 -81
  93. data/spec/fixtures/vcr_cassettes/entry/json_objects.yml +0 -88
  94. data/spec/fixtures/vcr_cassettes/entry/json_objects_client.yml +0 -86
  95. data/spec/fixtures/vcr_cassettes/entry/marshal_138.yml +0 -159
  96. data/spec/fixtures/vcr_cassettes/entry/marshal_unpublished.yml +0 -303
  97. data/spec/fixtures/vcr_cassettes/entry/marshall.yml +0 -293
  98. data/spec/fixtures/vcr_cassettes/entry/raw.yml +0 -201
  99. data/spec/fixtures/vcr_cassettes/entry/search_link_to_asset.yml +0 -81
  100. data/spec/fixtures/vcr_cassettes/entry/search_link_to_entry.yml +0 -81
  101. data/spec/fixtures/vcr_cassettes/entry/search_link_to_entry_with_custom_query.yml +0 -115
  102. data/spec/fixtures/vcr_cassettes/entry/select_empty_array.yml +0 -111
  103. data/spec/fixtures/vcr_cassettes/entry/select_no_sys.yml +0 -102
  104. data/spec/fixtures/vcr_cassettes/entry/select_one_field.yml +0 -76
  105. data/spec/fixtures/vcr_cassettes/entry/select_one_field_proper.yml +0 -114
  106. data/spec/fixtures/vcr_cassettes/entry/select_only_sys.yml +0 -111
  107. data/spec/fixtures/vcr_cassettes/entry/with_tags.yml +0 -238
  108. data/spec/fixtures/vcr_cassettes/entry_cache.yml +0 -288
  109. data/spec/fixtures/vcr_cassettes/entry_locales.yml +0 -104
  110. data/spec/fixtures/vcr_cassettes/field.yml +0 -147
  111. data/spec/fixtures/vcr_cassettes/human.yml +0 -118
  112. data/spec/fixtures/vcr_cassettes/linkField.yml +0 -83
  113. data/spec/fixtures/vcr_cassettes/locale.yml +0 -83
  114. data/spec/fixtures/vcr_cassettes/locale_from_environment.yml +0 -121
  115. data/spec/fixtures/vcr_cassettes/location.yml +0 -193
  116. data/spec/fixtures/vcr_cassettes/multi_locale_array_reference.yml +0 -196
  117. data/spec/fixtures/vcr_cassettes/multi_locale_reference.yml +0 -214
  118. data/spec/fixtures/vcr_cassettes/not_found.yml +0 -76
  119. data/spec/fixtures/vcr_cassettes/nyancat.yml +0 -102
  120. data/spec/fixtures/vcr_cassettes/query_array_1.yml +0 -89
  121. data/spec/fixtures/vcr_cassettes/query_array_2.yml +0 -89
  122. data/spec/fixtures/vcr_cassettes/ratelimit.yml +0 -64
  123. data/spec/fixtures/vcr_cassettes/ratelimit_retry.yml +0 -294
  124. data/spec/fixtures/vcr_cassettes/reloaded_entry.yml +0 -102
  125. data/spec/fixtures/vcr_cassettes/space.yml +0 -83
  126. data/spec/fixtures/vcr_cassettes/sync_deleted_asset.yml +0 -174
  127. data/spec/fixtures/vcr_cassettes/sync_deleted_entry.yml +0 -89
  128. data/spec/fixtures/vcr_cassettes/sync_deletion.yml +0 -191
  129. data/spec/fixtures/vcr_cassettes/sync_environment.yml +0 -81
  130. data/spec/fixtures/vcr_cassettes/sync_page.yml +0 -637
  131. data/spec/fixtures/vcr_cassettes/sync_page_2.yml +0 -71
  132. data/spec/fixtures/vcr_cassettes/sync_page_short.yml +0 -106
  133. data/spec/fixtures/vcr_cassettes/unauthorized.yml +0 -64
  134. data/spec/fixtures/vcr_cassettes/unavailable.yml +0 -76
  135. data/spec/link_spec.rb +0 -50
  136. data/spec/locale_spec.rb +0 -37
  137. data/spec/location_spec.rb +0 -25
  138. data/spec/request_spec.rb +0 -57
  139. data/spec/resource_building_spec.rb +0 -31
  140. data/spec/response_spec.rb +0 -62
  141. data/spec/space_spec.rb +0 -31
  142. data/spec/spec_helper.rb +0 -14
  143. data/spec/support/client.rb +0 -6
  144. data/spec/support/json_responses.rb +0 -18
  145. data/spec/support/vcr.rb +0 -16
  146. data/spec/sync_page_spec.rb +0 -103
  147. data/spec/sync_spec.rb +0 -180
@@ -1,71 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://cdn.contentful.com/spaces/cfexampleapi/environments/master/sync?sync_token=w5ZGw6JFwqZmVcKsE8Kow4grw45QdybCr8Okw6AYwqbDksO3ehvDpUPCgcKsKXbCiAwPC8K2w4LDvsOkw6nCjhPDpcOQADElWsOoU8KGR3HCtsOAwqd6wp_Dulp8w6LDsF_CtsK7Kk05wrMvwrLClMOgG2_Dn2sGPg
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- User-Agent:
11
- - RubyContentfulGem/0.1.3
12
- Authorization:
13
- - Bearer b4c0n73n7fu1
14
- Content-Type:
15
- - application/vnd.contentful.delivery.v1+json
16
- Host:
17
- - cdn.contentful.com
18
- response:
19
- status:
20
- code: 200
21
- message: OK
22
- headers:
23
- Date:
24
- - Fri, 25 Apr 2014 13:31:17 GMT
25
- Server:
26
- - nginx/1.1.19
27
- Access-Control-Allow-Headers:
28
- - Accept,Accept-Language,Authorization,Cache-Control,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization
29
- Access-Control-Allow-Methods:
30
- - GET,HEAD,OPTIONS
31
- Access-Control-Allow-Origin:
32
- - "*"
33
- Access-Control-Max-Age:
34
- - '86400'
35
- Cache-Control:
36
- - max-age=0
37
- Content-Type:
38
- - application/vnd.contentful.delivery.v1+json
39
- Etag:
40
- - '"382e4781b902b58d2edf3f10067167c7"'
41
- X-Contentful-Request-Id:
42
- - f1c-737770542
43
- Content-Length:
44
- - '300'
45
- Accept-Ranges:
46
- - bytes
47
- Via:
48
- - 1.1 varnish
49
- Age:
50
- - '0'
51
- X-Served-By:
52
- - cache-fra1229-FRA
53
- X-Cache:
54
- - MISS
55
- X-Cache-Hits:
56
- - '0'
57
- Vary:
58
- - Accept-Encoding
59
- body:
60
- encoding: UTF-8
61
- string: |
62
- {
63
- "sys": {
64
- "type": "Array"
65
- },
66
- "items": [],
67
- "nextSyncUrl": "https://cdn.contentful.com/spaces/cfexampleapi/environments/master/sync?sync_token=w5ZGw6JFwqZmVcKsE8Kow4grw45QdybCr8Okw6AYwqbDksO3ehvDpUPCgcKsKXbCiAwPC8K2w4LDvsOkw6nCjhPDpcOQADElWsOoU8KGR3HCtsOAwqd6wp_Dulp8w6LDsF_CtsK7Kk05wrMvwrLClMOgG2_Dn2sGPg"
68
- }
69
- http_version:
70
- recorded_at: Fri, 25 Apr 2014 13:31:18 GMT
71
- recorded_with: VCR 2.9.0
@@ -1,106 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://cdn.contentful.com/spaces/cfexampleapi/environments/master/sync?initial=true
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- User-Agent:
11
- - RubyContentfulGem/0.1.3
12
- Authorization:
13
- - Bearer b4c0n73n7fu1
14
- Content-Type:
15
- - application/vnd.contentful.delivery.v1+json
16
- Host:
17
- - cdn.contentful.com
18
- response:
19
- status:
20
- code: 200
21
- message: OK
22
- headers:
23
- Date:
24
- - Fri, 25 Apr 2014 13:31:17 GMT
25
- Server:
26
- - nginx/1.1.19
27
- Access-Control-Allow-Headers:
28
- - Accept,Accept-Language,Authorization,Cache-Control,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization
29
- Access-Control-Allow-Methods:
30
- - GET,HEAD,OPTIONS
31
- Access-Control-Allow-Origin:
32
- - "*"
33
- Access-Control-Max-Age:
34
- - '86400'
35
- Cache-Control:
36
- - max-age=0
37
- Content-Type:
38
- - application/vnd.contentful.delivery.v1+json
39
- Etag:
40
- - '"382e4781b902b58d2edf3f10067167c7"'
41
- X-Contentful-Request-Id:
42
- - f1c-737770542
43
- Content-Length:
44
- - '300'
45
- Accept-Ranges:
46
- - bytes
47
- Via:
48
- - 1.1 varnish
49
- Age:
50
- - '0'
51
- X-Served-By:
52
- - cache-fra1229-FRA
53
- X-Cache:
54
- - MISS
55
- X-Cache-Hits:
56
- - '0'
57
- Vary:
58
- - Accept-Encoding
59
- body:
60
- encoding: UTF-8
61
- string: |
62
- {
63
- "sys": {
64
- "type": "Array"
65
- },
66
- "items": [
67
- {
68
- "sys": {
69
- "space": {
70
- "sys": {
71
- "type": "Link",
72
- "linkType": "Space",
73
- "id": "cfexampleapi"
74
- }
75
- },
76
- "type": "Entry",
77
- "contentType": {
78
- "sys": {
79
- "type": "Link",
80
- "linkType": "ContentType",
81
- "id": "1t9IbcfdCk6m04uISSsaIK"
82
- }
83
- },
84
- "id": "5ETMRzkl9KM4omyMwKAOki",
85
- "revision": 2,
86
- "createdAt": "2014-02-21T13:42:57.752Z",
87
- "updatedAt": "2014-04-16T12:44:02.691Z"
88
- },
89
- "fields": {
90
- "name": {
91
- "en-US": "London"
92
- },
93
- "center": {
94
- "en-US": {
95
- "lat": 51.508515,
96
- "lon": -0.12548719999995228
97
- }
98
- }
99
- }
100
- }
101
- ],
102
- "nextSyncUrl": "https://cdn.contentful.com/spaces/cfexampleapi/environments/master/sync?sync_token=w5ZGw6JFwqZmVcKsE8Kow4grw45QdybCr8Okw6AYwqbDksO3ehvDpUPCgcKsKXbCiAwPC8K2w4LDvsOkw6nCjhPDpcOQADElWsOoU8KGR3HCtsOAwqd6wp_Dulp8w6LDsF_CtsK7Kk05wrMvwrLClMOgG2_Dn2sGPg"
103
- }
104
- http_version:
105
- recorded_at: Fri, 25 Apr 2014 13:31:18 GMT
106
- recorded_with: VCR 2.9.0
@@ -1,64 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://cdn.contentful.com/spaces/wrong/environments/master/entries?sys.id=nyancat
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- User-Agent:
11
- - RubyContentfulGem/0.1.1
12
- Authorization:
13
- - Bearer credentials
14
- Content-Type:
15
- - application/vnd.contentful.delivery.v1+json
16
- Host:
17
- - cdn.contentful.com
18
- response:
19
- status:
20
- code: 401
21
- message: Unauthorized
22
- headers:
23
- Date:
24
- - Wed, 16 Apr 2014 09:00:24 GMT
25
- Server:
26
- - nginx/1.1.19
27
- Access-Control-Allow-Headers:
28
- - Accept,Accept-Language,Authorization,Cache-Control,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization
29
- Access-Control-Allow-Methods:
30
- - GET,HEAD,OPTIONS
31
- Access-Control-Allow-Origin:
32
- - "*"
33
- Access-Control-Max-Age:
34
- - '86400'
35
- Cache-Control:
36
- - max-age=0
37
- Content-Type:
38
- - application/vnd.contentful.delivery.v1+json
39
- Content-Length:
40
- - '179'
41
- Accept-Ranges:
42
- - bytes
43
- Via:
44
- - 1.1 varnish
45
- X-Served-By:
46
- - cache-am72-AMS
47
- X-Cache:
48
- - MISS
49
- X-Cache-Hits:
50
- - '0'
51
- body:
52
- encoding: UTF-8
53
- string: |
54
- {
55
- "sys": {
56
- "type": "Error",
57
- "id": "AccessTokenInvalid"
58
- },
59
- "message": "The access token you sent could not be found or is invalid.",
60
- "requestId": "85f-649640521"
61
- }
62
- http_version:
63
- recorded_at: Wed, 16 Apr 2014 09:00:24 GMT
64
- recorded_with: VCR 2.9.0
@@ -1,76 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://cdn.contentful.com/spaces/wrong/environments/master/entries?sys.id=nyancat
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- User-Agent:
11
- - RubyContentfulGem/1.2.0
12
- Authorization:
13
- - Bearer credentials
14
- Content-Type:
15
- - application/vnd.contentful.delivery.v1+json
16
- Accept-Encoding:
17
- - gzip
18
- Connection:
19
- - close
20
- Host:
21
- - cdn.contentful.com
22
- response:
23
- status:
24
- code: 503
25
- message: ServiceUnavailable
26
- headers:
27
- Access-Control-Allow-Headers:
28
- - Accept,Accept-Language,Authorization,Cache-Control,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization,X-Contentful-Skip-Transformation,X-Contentful-User-Agent
29
- Access-Control-Allow-Methods:
30
- - GET,HEAD,OPTIONS
31
- Access-Control-Allow-Origin:
32
- - "*"
33
- Access-Control-Expose-Headers:
34
- - Etag
35
- Access-Control-Max-Age:
36
- - '86400'
37
- Cache-Control:
38
- - max-age=0
39
- Content-Type:
40
- - application/vnd.contentful.delivery.v1+json
41
- Server:
42
- - Contentful
43
- X-Contentful-Request-Id:
44
- - 2c869757aa2dca0bddce49574f85e62b
45
- Content-Length:
46
- - '198'
47
- Accept-Ranges:
48
- - bytes
49
- Date:
50
- - Tue, 20 Dec 2016 16:27:17 GMT
51
- Via:
52
- - 1.1 varnish
53
- Connection:
54
- - close
55
- X-Served-By:
56
- - cache-fra1238-FRA
57
- X-Cache:
58
- - MISS
59
- X-Cache-Hits:
60
- - '0'
61
- X-Timer:
62
- - S1482251237.033636,VS0,VE114
63
- body:
64
- encoding: ASCII-8BIT
65
- string: |
66
- {
67
- "sys": {
68
- "type": "Error",
69
- "id": "AccessTokenInvalid"
70
- },
71
- "message": "The access token you sent could not be found or is invalid.",
72
- "requestId": "2c869757aa2dca0bddce49574f85e62b"
73
- }
74
- http_version:
75
- recorded_at: Tue, 20 Dec 2016 16:27:17 GMT
76
- recorded_with: VCR 3.0.3
data/spec/link_spec.rb DELETED
@@ -1,50 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Contentful::Link do
4
- let(:client) { create_client }
5
- let(:entry) { vcr('entry') { create_client.entry('nyancat') } }
6
- let(:link) { entry.space }
7
- let(:content_type_link) { entry.content_type }
8
-
9
- describe 'SystemProperties' do
10
- it 'has a #sys getter returning a hash with symbol keys' do
11
- expect(link.sys).to be_a Hash
12
- expect(link.sys.keys.sample).to be_a Symbol
13
- end
14
-
15
- it 'has #id' do
16
- expect(link.id).to eq 'cfexampleapi'
17
- end
18
-
19
- it 'has #type' do
20
- expect(link.type).to eq 'Link'
21
- end
22
-
23
- it 'has #link_type' do
24
- expect(link.link_type).to eq 'Space'
25
- end
26
- end
27
-
28
- describe '#resolve' do
29
- it 'queries the api for the resource' do
30
- vcr('space')do
31
- expect(link.resolve(client)).to be_a Contentful::Space
32
- end
33
- end
34
-
35
- it 'queries the api for the resource (different link object)' do
36
- vcr('content_type')do
37
- expect(content_type_link.resolve(client)).to be_a Contentful::ContentType
38
- end
39
- end
40
- end
41
-
42
- describe 'camel case' do
43
- it 'supports camel case' do
44
- vcr('entry') {
45
- space_link = create_client(use_camel_case: true).entry('nyancat').space
46
- expect(space_link.linkType).to eq 'Space'
47
- }
48
- end
49
- end
50
- end
data/spec/locale_spec.rb DELETED
@@ -1,37 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Contentful::Locale do
4
- let(:locale) { vcr('locale') { create_client.space.locales.first } }
5
-
6
- describe 'Properties' do
7
- it 'has #code' do
8
- expect(locale.code).to eq 'en-US'
9
- end
10
-
11
- it 'has #name' do
12
- expect(locale.name).to eq 'English'
13
- end
14
-
15
- it 'has #default' do
16
- expect(locale.default).to eq true
17
- end
18
- end
19
-
20
- describe 'locales endpoint' do
21
- it 'locales can be fetched from environments' do
22
- vcr('locale_from_environment') {
23
- client = create_client(
24
- space: 'facgnwwgj5fe',
25
- access_token: '<ACCESS_TOKEN>',
26
- environment: 'testing'
27
- )
28
-
29
- locales = client.locales
30
-
31
- expect(locales).to be_a ::Contentful::Array
32
- expect(locales.first).to be_a ::Contentful::Locale
33
- expect(locales.first.code).to eq 'en-US'
34
- }
35
- end
36
- end
37
- end
@@ -1,25 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Contentful::Location do
4
- let(:location)do
5
- vcr('location')do
6
- Contentful::Client.new(
7
- space: 'lzjz8hygvfgu',
8
- access_token: '0c6ef483524b5e46b3bafda1bf355f38f5f40b4830f7599f790a410860c7c271',
9
- dynamic_entries: :auto,
10
- ).entry('3f6fq5ylFCi4kIYAQKsAYG').location
11
- end
12
- end
13
-
14
- describe 'Properties' do
15
- it 'has #lat' do
16
- expect(location.lat).to be_a Float
17
- expect(location.lat.to_i).to eq 36
18
- end
19
-
20
- it 'has #lon' do
21
- expect(location.lon).to be_a Float
22
- expect(location.lon.to_i).to eq(-94)
23
- end
24
- end
25
- end
data/spec/request_spec.rb DELETED
@@ -1,57 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Contentful::Request do
4
- describe '#get' do
5
- it 'calls client' do
6
- client = create_client
7
- request = Contentful::Request.new(client, '/content_types', nil, 'nyancat')
8
-
9
- expect(client).to receive(:get).with(request)
10
-
11
- request.get
12
- end
13
- end
14
-
15
- describe '#query' do
16
- it 'converts arrays given in query to comma strings' do
17
- client = create_client
18
- request = Contentful::Request.new(client, '/entries', 'fields.likes[in]' => %w(jake finn))
19
- expect(request.query[:'fields.likes[in]']).to eq 'jake,finn'
20
- end
21
- end
22
-
23
- context '[single resource]' do
24
- let(:request)do
25
- Contentful::Request.new(create_client, '/content_types', nil, 'nyancat')
26
- end
27
-
28
- describe '#url' do
29
- it 'contais endpoint' do
30
- expect(request.url).to include 'content_types'
31
- end
32
-
33
- it 'contains id' do
34
- expect(request.url).to include 'nyancat'
35
- end
36
- end
37
- end
38
-
39
- context '[multi resource]' do
40
- let(:request)do
41
- Contentful::Request.new(create_client, '/content_types', 'something' => 'requested')
42
- end
43
-
44
- describe '#query' do
45
- it 'contains query' do
46
- expect(request.query).not_to be_empty
47
- expect(request.query[:something]).to eq 'requested'
48
- end
49
- end
50
-
51
- describe '#url' do
52
- it 'contais endpoint' do
53
- expect(request.url).to include 'content_types'
54
- end
55
- end
56
- end
57
- end