contentful-management 1.10.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (303) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +3 -0
  3. data/CHANGELOG.md +48 -0
  4. data/README.md +92 -50
  5. data/lib/contentful/management/api_key.rb +25 -2
  6. data/lib/contentful/management/array.rb +3 -3
  7. data/lib/contentful/management/asset.rb +13 -8
  8. data/lib/contentful/management/client.rb +73 -60
  9. data/lib/contentful/management/client_api_key_methods_factory.rb +8 -0
  10. data/lib/contentful/management/client_asset_methods_factory.rb +0 -2
  11. data/lib/contentful/management/client_association_all_published_method_factory.rb +2 -3
  12. data/lib/contentful/management/client_association_methods_factory.rb +9 -9
  13. data/lib/contentful/management/client_content_type_methods_factory.rb +8 -2
  14. data/lib/contentful/management/client_editor_interface_methods_factory.rb +12 -6
  15. data/lib/contentful/management/client_entry_methods_factory.rb +1 -3
  16. data/lib/contentful/management/client_environment_methods_factory.rb +59 -0
  17. data/lib/contentful/management/client_organization_methods_factory.rb +1 -1
  18. data/lib/contentful/management/client_personal_access_tokens_methods_factory.rb +3 -3
  19. data/lib/contentful/management/client_role_methods_factory.rb +8 -0
  20. data/lib/contentful/management/client_snapshot_methods_factory.rb +8 -6
  21. data/lib/contentful/management/client_space_methods_factory.rb +2 -6
  22. data/lib/contentful/management/client_upload_methods_factory.rb +8 -0
  23. data/lib/contentful/management/client_user_methods_factory.rb +1 -1
  24. data/lib/contentful/management/client_webhook_call_methods_factory.rb +11 -6
  25. data/lib/contentful/management/client_webhook_health_methods_factory.rb +2 -2
  26. data/lib/contentful/management/client_webhook_methods_factory.rb +8 -0
  27. data/lib/contentful/management/content_type.rb +9 -7
  28. data/lib/contentful/management/content_type_editor_interface_methods_factory.rb +7 -3
  29. data/lib/contentful/management/content_type_entry_methods_factory.rb +2 -2
  30. data/lib/contentful/management/content_type_snapshot_methods_factory.rb +16 -2
  31. data/lib/contentful/management/dynamic_entry.rb +1 -1
  32. data/lib/contentful/management/editor_interface.rb +14 -6
  33. data/lib/contentful/management/entry.rb +12 -10
  34. data/lib/contentful/management/entry_association_methods_factory.rb +2 -2
  35. data/lib/contentful/management/environment.rb +138 -0
  36. data/lib/contentful/management/environment_asset_methods_factory.rb +11 -0
  37. data/lib/contentful/management/environment_association_methods_factory.rb +42 -0
  38. data/lib/contentful/management/environment_content_type_methods_factory.rb +11 -0
  39. data/lib/contentful/management/environment_editor_interface_methods_factory.rb +15 -0
  40. data/lib/contentful/management/environment_entry_methods_factory.rb +11 -0
  41. data/lib/contentful/management/environment_locale_methods_factory.rb +11 -0
  42. data/lib/contentful/management/environment_ui_extension_methods_factory.rb +11 -0
  43. data/lib/contentful/management/field.rb +3 -3
  44. data/lib/contentful/management/file.rb +2 -2
  45. data/lib/contentful/management/link.rb +21 -7
  46. data/lib/contentful/management/locale.rb +4 -2
  47. data/lib/contentful/management/organization.rb +1 -1
  48. data/lib/contentful/management/personal_access_token.rb +2 -2
  49. data/lib/contentful/management/resource.rb +34 -13
  50. data/lib/contentful/management/resource/all_published.rb +2 -2
  51. data/lib/contentful/management/resource/archiver.rb +12 -2
  52. data/lib/contentful/management/resource/environment_aware.rb +13 -0
  53. data/lib/contentful/management/resource/publisher.rb +12 -2
  54. data/lib/contentful/management/resource/refresher.rb +1 -1
  55. data/lib/contentful/management/resource_builder.rb +16 -14
  56. data/lib/contentful/management/response.rb +1 -1
  57. data/lib/contentful/management/role.rb +29 -2
  58. data/lib/contentful/management/snapshot.rb +13 -7
  59. data/lib/contentful/management/space.rb +14 -93
  60. data/lib/contentful/management/space_association_methods_factory.rb +1 -1
  61. data/lib/contentful/management/{space_locale_methods_factory.rb → space_environment_methods_factory.rb} +2 -6
  62. data/lib/contentful/management/space_membership.rb +3 -3
  63. data/lib/contentful/management/ui_extension.rb +4 -2
  64. data/lib/contentful/management/upload.rb +24 -1
  65. data/lib/contentful/management/user.rb +4 -4
  66. data/lib/contentful/management/validation.rb +5 -5
  67. data/lib/contentful/management/version.rb +1 -1
  68. data/lib/contentful/management/webhook.rb +26 -3
  69. data/lib/contentful/management/webhook_call.rb +8 -8
  70. data/lib/contentful/management/webhook_health.rb +2 -2
  71. data/spec/fixtures/vcr_cassettes/asset/143_assets_next_page.yml +2 -2
  72. data/spec/fixtures/vcr_cassettes/asset/all.yml +1 -1
  73. data/spec/fixtures/vcr_cassettes/asset/archive.yml +2 -2
  74. data/spec/fixtures/vcr_cassettes/asset/archive_published.yml +2 -2
  75. data/spec/fixtures/vcr_cassettes/asset/archived_false.yml +2 -2
  76. data/spec/fixtures/vcr_cassettes/asset/archived_true.yml +2 -2
  77. data/spec/fixtures/vcr_cassettes/asset/create.yml +2 -2
  78. data/spec/fixtures/vcr_cassettes/asset/create_with_already_used_id.yml +1 -1
  79. data/spec/fixtures/vcr_cassettes/asset/create_with_custom_id.yml +2 -2
  80. data/spec/fixtures/vcr_cassettes/asset/create_with_locale.yml +2 -2
  81. data/spec/fixtures/vcr_cassettes/asset/destroy.yml +2 -2
  82. data/spec/fixtures/vcr_cassettes/asset/destroy_published.yml +2 -2
  83. data/spec/fixtures/vcr_cassettes/asset/find.yml +1 -1
  84. data/spec/fixtures/vcr_cassettes/asset/find_not_found.yml +1 -1
  85. data/spec/fixtures/vcr_cassettes/asset/limited_assets_next_page.yml +2 -2
  86. data/spec/fixtures/vcr_cassettes/asset/locale.yml +1 -1
  87. data/spec/fixtures/vcr_cassettes/asset/process.yml +2 -2
  88. data/spec/fixtures/vcr_cassettes/asset/publish.yml +2 -2
  89. data/spec/fixtures/vcr_cassettes/asset/publish_after_create.yml +3 -3
  90. data/spec/fixtures/vcr_cassettes/asset/publish_already_published.yml +2 -2
  91. data/spec/fixtures/vcr_cassettes/asset/published_false.yml +2 -2
  92. data/spec/fixtures/vcr_cassettes/asset/published_true.yml +2 -2
  93. data/spec/fixtures/vcr_cassettes/asset/reload.yml +4 -4
  94. data/spec/fixtures/vcr_cassettes/asset/reload_with_fields.yml +2 -2
  95. data/spec/fixtures/vcr_cassettes/asset/save_update.yml +2 -2
  96. data/spec/fixtures/vcr_cassettes/asset/select_operator.yml +1 -1
  97. data/spec/fixtures/vcr_cassettes/asset/set_locale.yml +1 -1
  98. data/spec/fixtures/vcr_cassettes/asset/unarchive.yml +2 -2
  99. data/spec/fixtures/vcr_cassettes/asset/unarchive_already_unarchive.yml +2 -2
  100. data/spec/fixtures/vcr_cassettes/asset/unarchive_already_unarchived.yml +2 -2
  101. data/spec/fixtures/vcr_cassettes/asset/unpublish.yml +2 -2
  102. data/spec/fixtures/vcr_cassettes/asset/unpublish_already_unpublished.yml +2 -2
  103. data/spec/fixtures/vcr_cassettes/asset/update_file.yml +2 -2
  104. data/spec/fixtures/vcr_cassettes/asset/update_to_specified_locale.yml +2 -2
  105. data/spec/fixtures/vcr_cassettes/asset/update_with_default_locale_without_file.yml +2 -2
  106. data/spec/fixtures/vcr_cassettes/content_type/activate.yml +2 -2
  107. data/spec/fixtures/vcr_cassettes/content_type/activate_with_invalid_version.yml +2 -2
  108. data/spec/fixtures/vcr_cassettes/content_type/activated_false.yml +2 -2
  109. data/spec/fixtures/vcr_cassettes/content_type/activated_true.yml +2 -2
  110. data/spec/fixtures/vcr_cassettes/content_type/all.yml +1 -1
  111. data/spec/fixtures/vcr_cassettes/content_type/all_public.yml +1 -1
  112. data/spec/fixtures/vcr_cassettes/content_type/create.yml +1 -1
  113. data/spec/fixtures/vcr_cassettes/content_type/create_content_type_with_id.yml +1 -1
  114. data/spec/fixtures/vcr_cassettes/content_type/create_with_Array_field.yml +1 -1
  115. data/spec/fixtures/vcr_cassettes/content_type/create_with_Boolean_field.yml +1 -1
  116. data/spec/fixtures/vcr_cassettes/content_type/create_with_Date_field.yml +1 -1
  117. data/spec/fixtures/vcr_cassettes/content_type/create_with_Integer_field.yml +1 -1
  118. data/spec/fixtures/vcr_cassettes/content_type/create_with_Link_field.yml +1 -1
  119. data/spec/fixtures/vcr_cassettes/content_type/create_with_Location_field.yml +1 -1
  120. data/spec/fixtures/vcr_cassettes/content_type/create_with_Number_field.yml +1 -1
  121. data/spec/fixtures/vcr_cassettes/content_type/create_with_Object_field.yml +1 -1
  122. data/spec/fixtures/vcr_cassettes/content_type/create_with_Symbol_field.yml +1 -1
  123. data/spec/fixtures/vcr_cassettes/content_type/create_with_Text_field.yml +1 -1
  124. data/spec/fixtures/vcr_cassettes/content_type/deactivate.yml +2 -2
  125. data/spec/fixtures/vcr_cassettes/content_type/deactivate_already_deactivated.yml +2 -2
  126. data/spec/fixtures/vcr_cassettes/content_type/deactivate_with_entries.yml +2 -2
  127. data/spec/fixtures/vcr_cassettes/content_type/deactivate_with_version_change.yml +2 -2
  128. data/spec/fixtures/vcr_cassettes/content_type/destroy.yml +2 -2
  129. data/spec/fixtures/vcr_cassettes/content_type/destroy_activated.yml +2 -2
  130. data/spec/fixtures/vcr_cassettes/content_type/entry/all.yml +4 -4
  131. data/spec/fixtures/vcr_cassettes/content_type/entry/create.yml +4 -4
  132. data/spec/fixtures/vcr_cassettes/content_type/entry/create_only_with_localized_fields.yml +2 -2
  133. data/spec/fixtures/vcr_cassettes/content_type/entry/create_to_single_locale_only_with_localized_fields.yml +2 -2
  134. data/spec/fixtures/vcr_cassettes/content_type/entry/create_with_camel_case_id_to_multiple_locales.yml +2 -2
  135. data/spec/fixtures/vcr_cassettes/content_type/entry/create_with_entries.yml +3 -3
  136. data/spec/fixtures/vcr_cassettes/content_type/entry/create_with_entries_for_multiple_locales.yml +9 -9
  137. data/spec/fixtures/vcr_cassettes/content_type/entry/create_with_multiple_locales.yml +2 -2
  138. data/spec/fixtures/vcr_cassettes/content_type/entry/update_only_with_localized_fields.yml +3 -3
  139. data/spec/fixtures/vcr_cassettes/content_type/fields/add.yml +2 -2
  140. data/spec/fixtures/vcr_cassettes/content_type/fields/create.yml +2 -2
  141. data/spec/fixtures/vcr_cassettes/content_type/fields/create_array_types.yml +3 -3
  142. data/spec/fixtures/vcr_cassettes/content_type/fields/create_array_with_params.yml +2 -2
  143. data/spec/fixtures/vcr_cassettes/content_type/fields/create_with_params.yml +2 -2
  144. data/spec/fixtures/vcr_cassettes/content_type/fields/destroy.yml +2 -2
  145. data/spec/fixtures/vcr_cassettes/content_type/fields/update_field.yml +2 -2
  146. data/spec/fixtures/vcr_cassettes/content_type/find.yml +1 -1
  147. data/spec/fixtures/vcr_cassettes/content_type/find_not_found.yml +1 -1
  148. data/spec/fixtures/vcr_cassettes/content_type/issue_79.yml +3 -3
  149. data/spec/fixtures/vcr_cassettes/content_type/omitted_field.yml +4 -4
  150. data/spec/fixtures/vcr_cassettes/content_type/reload.yml +4 -4
  151. data/spec/fixtures/vcr_cassettes/content_type/save_new.yml +3 -3
  152. data/spec/fixtures/vcr_cassettes/content_type/save_updated.yml +2 -2
  153. data/spec/fixtures/vcr_cassettes/content_type/save_with_added_field.yml +2 -2
  154. data/spec/fixtures/vcr_cassettes/content_type/update.yml +2 -2
  155. data/spec/fixtures/vcr_cassettes/content_type/update_change_field_name.yml +2 -2
  156. data/spec/fixtures/vcr_cassettes/content_type/update_remove_field.yml +2 -2
  157. data/spec/fixtures/vcr_cassettes/content_type/update_with_fields.yml +2 -2
  158. data/spec/fixtures/vcr_cassettes/content_type/update_with_one_new_field.yml +2 -2
  159. data/spec/fixtures/vcr_cassettes/content_type/validation/in.yml +3 -3
  160. data/spec/fixtures/vcr_cassettes/content_type/validation/in_add.yml +3 -3
  161. data/spec/fixtures/vcr_cassettes/content_type/validation/in_update.yml +3 -3
  162. data/spec/fixtures/vcr_cassettes/content_type/validation/link_content_type.yml +3 -3
  163. data/spec/fixtures/vcr_cassettes/content_type/validation/link_field.yml +3 -3
  164. data/spec/fixtures/vcr_cassettes/content_type/validation/link_mimetype_group.yml +3 -3
  165. data/spec/fixtures/vcr_cassettes/content_type/validation/multiple_add.yml +3 -3
  166. data/spec/fixtures/vcr_cassettes/content_type/validation/present.yml +3 -3
  167. data/spec/fixtures/vcr_cassettes/content_type/validation/range.yml +3 -3
  168. data/spec/fixtures/vcr_cassettes/content_type/validation/range_update.yml +3 -3
  169. data/spec/fixtures/vcr_cassettes/content_type/validation/regexp.yml +3 -3
  170. data/spec/fixtures/vcr_cassettes/content_type/validation/size.yml +3 -3
  171. data/spec/fixtures/vcr_cassettes/content_type/validation/unique.yml +3 -3
  172. data/spec/fixtures/vcr_cassettes/editor_interfaces/default_for_space.yml +1 -1
  173. data/spec/fixtures/vcr_cassettes/editor_interfaces/update.yml +3 -3
  174. data/spec/fixtures/vcr_cassettes/entry/all.yml +1 -1
  175. data/spec/fixtures/vcr_cassettes/entry/archive.yml +2 -2
  176. data/spec/fixtures/vcr_cassettes/entry/archive_published.yml +2 -2
  177. data/spec/fixtures/vcr_cassettes/entry/archived_false.yml +2 -2
  178. data/spec/fixtures/vcr_cassettes/entry/archived_true.yml +2 -2
  179. data/spec/fixtures/vcr_cassettes/entry/content_type_entires.yml +1 -1
  180. data/spec/fixtures/vcr_cassettes/entry/create.yml +4 -4
  181. data/spec/fixtures/vcr_cassettes/entry/create_with_asset.yml +3 -3
  182. data/spec/fixtures/vcr_cassettes/entry/create_with_assets.yml +3 -3
  183. data/spec/fixtures/vcr_cassettes/entry/create_with_custom_id.yml +2 -2
  184. data/spec/fixtures/vcr_cassettes/entry/create_with_entries.yml +3 -3
  185. data/spec/fixtures/vcr_cassettes/entry/create_with_entry.yml +3 -3
  186. data/spec/fixtures/vcr_cassettes/entry/create_with_just_id.yml +4 -4
  187. data/spec/fixtures/vcr_cassettes/entry/create_with_location.yml +2 -2
  188. data/spec/fixtures/vcr_cassettes/entry/create_with_specified_locale.yml +3 -3
  189. data/spec/fixtures/vcr_cassettes/entry/create_with_symbols.yml +2 -2
  190. data/spec/fixtures/vcr_cassettes/entry/destory_published.yml +2 -2
  191. data/spec/fixtures/vcr_cassettes/entry/destroy.yml +2 -2
  192. data/spec/fixtures/vcr_cassettes/entry/fallback_undefined.yml +3 -3
  193. data/spec/fixtures/vcr_cassettes/entry/find-with-null-symbols.yml +2 -2
  194. data/spec/fixtures/vcr_cassettes/entry/find.yml +1 -1
  195. data/spec/fixtures/vcr_cassettes/entry/find_not_found.yml +1 -1
  196. data/spec/fixtures/vcr_cassettes/entry/issue_61_1.yml +6 -6
  197. data/spec/fixtures/vcr_cassettes/entry/issue_61_2.yml +6 -6
  198. data/spec/fixtures/vcr_cassettes/entry/issue_61_3.yml +6 -6
  199. data/spec/fixtures/vcr_cassettes/entry/issue_61_4.yml +6 -6
  200. data/spec/fixtures/vcr_cassettes/entry/issue_61_5.yml +305 -198
  201. data/spec/fixtures/vcr_cassettes/entry/issue_61_6.yml +5 -5
  202. data/spec/fixtures/vcr_cassettes/entry/issue_61_7.yml +6 -6
  203. data/spec/fixtures/vcr_cassettes/entry/issue_61_8.yml +6 -6
  204. data/spec/fixtures/vcr_cassettes/entry/issue_61_spaces.yml +143 -188
  205. data/spec/fixtures/vcr_cassettes/entry/issue_70.yml +3 -3
  206. data/spec/fixtures/vcr_cassettes/entry/issue_73.yml +4 -4
  207. data/spec/fixtures/vcr_cassettes/entry/issue_91.yml +2 -2
  208. data/spec/fixtures/vcr_cassettes/entry/limited_entries.yml +2 -2
  209. data/spec/fixtures/vcr_cassettes/entry/locales/fallback_to_default_locale.yml +2 -2
  210. data/spec/fixtures/vcr_cassettes/entry/locales/retrieve_localized.yml +2 -2
  211. data/spec/fixtures/vcr_cassettes/entry/locales/simple_assignments_use_default_locale.yml +2 -2
  212. data/spec/fixtures/vcr_cassettes/entry/locales/simple_assignments_use_specified_locale.yml +2 -2
  213. data/spec/fixtures/vcr_cassettes/entry/publish.yml +2 -2
  214. data/spec/fixtures/vcr_cassettes/entry/publish_already_published.yml +2 -2
  215. data/spec/fixtures/vcr_cassettes/entry/published_false.yml +2 -2
  216. data/spec/fixtures/vcr_cassettes/entry/published_true.yml +2 -2
  217. data/spec/fixtures/vcr_cassettes/entry/reload.yml +6 -6
  218. data/spec/fixtures/vcr_cassettes/entry/save_update.yml +2 -2
  219. data/spec/fixtures/vcr_cassettes/entry/search_filter/equality_operator.yml +2 -2
  220. data/spec/fixtures/vcr_cassettes/entry/search_filter/exclusion_operator.yml +2 -2
  221. data/spec/fixtures/vcr_cassettes/entry/search_filter/full_search.yml +2 -2
  222. data/spec/fixtures/vcr_cassettes/entry/search_filter/full_search_match_operator.yml +2 -2
  223. data/spec/fixtures/vcr_cassettes/entry/search_filter/including_linked_entries.yml +2 -2
  224. data/spec/fixtures/vcr_cassettes/entry/search_filter/inclusion_operator.yml +2 -2
  225. data/spec/fixtures/vcr_cassettes/entry/search_filter/inequality_operator.yml +2 -2
  226. data/spec/fixtures/vcr_cassettes/entry/search_filter/location_search_near_operator.yml +2 -2
  227. data/spec/fixtures/vcr_cassettes/entry/search_filter/location_search_within_operator.yml +2 -2
  228. data/spec/fixtures/vcr_cassettes/entry/search_filter/matching_array_fields.yml +2 -2
  229. data/spec/fixtures/vcr_cassettes/entry/search_filter/order_sys_createdAt.yml +2 -2
  230. data/spec/fixtures/vcr_cassettes/entry/search_filter/order_sys_updatedAt.yml +2 -2
  231. data/spec/fixtures/vcr_cassettes/entry/search_filter/range_operators_greater_than_or_equal.yml +2 -2
  232. data/spec/fixtures/vcr_cassettes/entry/search_filter/range_operators_less.yml +2 -2
  233. data/spec/fixtures/vcr_cassettes/entry/search_filter/reverse_order_sys_updatedAt.yml +2 -2
  234. data/spec/fixtures/vcr_cassettes/entry/select_operator.yml +1 -1
  235. data/spec/fixtures/vcr_cassettes/entry/service_unavailable.yml +1 -1
  236. data/spec/fixtures/vcr_cassettes/entry/too_many_requests.yml +5 -5
  237. data/spec/fixtures/vcr_cassettes/entry/too_many_requests_retry.yml +6 -6
  238. data/spec/fixtures/vcr_cassettes/entry/unarchive.yml +2 -2
  239. data/spec/fixtures/vcr_cassettes/entry/unarchive_already_unarchived.yml +2 -2
  240. data/spec/fixtures/vcr_cassettes/entry/unpublish.yml +2 -2
  241. data/spec/fixtures/vcr_cassettes/entry/unpublish_already_unpublished.yml +2 -2
  242. data/spec/fixtures/vcr_cassettes/entry/update.yml +4 -4
  243. data/spec/fixtures/vcr_cassettes/entry/update_bool_field.yml +4 -4
  244. data/spec/fixtures/vcr_cassettes/entry/update_unlocalized_field.yml +3 -3
  245. data/spec/fixtures/vcr_cassettes/entry/update_with_custom_locale.yml +3 -3
  246. data/spec/fixtures/vcr_cassettes/environment/all.yml +226 -0
  247. data/spec/fixtures/vcr_cassettes/environment/create.yml +155 -0
  248. data/spec/fixtures/vcr_cassettes/environment/destroy.yml +89 -0
  249. data/spec/fixtures/vcr_cassettes/environment/find.yml +155 -0
  250. data/spec/fixtures/vcr_cassettes/environment/find_2.yml +155 -0
  251. data/spec/fixtures/vcr_cassettes/environment/not_found.yml +98 -0
  252. data/spec/fixtures/vcr_cassettes/locale/all_for_space.yml +1 -1
  253. data/spec/fixtures/vcr_cassettes/locale/create_for_space.yml +2 -2
  254. data/spec/fixtures/vcr_cassettes/locale/destroy.yml +5 -5
  255. data/spec/fixtures/vcr_cassettes/locale/fallback_code.yml +3 -3
  256. data/spec/fixtures/vcr_cassettes/locale/find.yml +1 -1
  257. data/spec/fixtures/vcr_cassettes/locale/find_default.yml +1 -1
  258. data/spec/fixtures/vcr_cassettes/locale/find_for_space_not_found.yml +1 -1
  259. data/spec/fixtures/vcr_cassettes/locale/find_not_default.yml +1 -1
  260. data/spec/fixtures/vcr_cassettes/locale/find_not_optional.yml +1 -1
  261. data/spec/fixtures/vcr_cassettes/locale/find_optional.yml +1 -1
  262. data/spec/fixtures/vcr_cassettes/locale/reload.yml +3 -3
  263. data/spec/fixtures/vcr_cassettes/locale/update_both.yml +3 -3
  264. data/spec/fixtures/vcr_cassettes/locale/update_code.yml +3 -3
  265. data/spec/fixtures/vcr_cassettes/locale/update_name.yml +3 -3
  266. data/spec/fixtures/vcr_cassettes/snapshot/all.yml +1 -1
  267. data/spec/fixtures/vcr_cassettes/snapshot/ct_all.yml +1 -1
  268. data/spec/fixtures/vcr_cassettes/snapshot/ct_find.yml +1 -1
  269. data/spec/fixtures/vcr_cassettes/snapshot/ct_find_not_found.yml +1 -1
  270. data/spec/fixtures/vcr_cassettes/snapshot/find.yml +1 -1
  271. data/spec/fixtures/vcr_cassettes/snapshot/find_not_found.yml +1 -1
  272. data/spec/fixtures/vcr_cassettes/snapshot/properties.yml +2 -2
  273. data/spec/fixtures/vcr_cassettes/ui_extension/all.yml +1 -1
  274. data/spec/fixtures/vcr_cassettes/ui_extension/create.yml +1 -1
  275. data/spec/fixtures/vcr_cassettes/ui_extension/delete.yml +3 -3
  276. data/spec/fixtures/vcr_cassettes/ui_extension/find.yml +1 -1
  277. data/spec/fixtures/vcr_cassettes/upload/associate_with_asset.yml +3 -3
  278. data/spec/lib/contentful/management/api_key_spec.rb +7 -7
  279. data/spec/lib/contentful/management/asset_spec.rb +38 -57
  280. data/spec/lib/contentful/management/client_spec.rb +1 -1
  281. data/spec/lib/contentful/management/content_type_spec.rb +78 -78
  282. data/spec/lib/contentful/management/editor_interface_spec.rb +4 -4
  283. data/spec/lib/contentful/management/entry_spec.rb +104 -114
  284. data/spec/lib/contentful/management/environment_spec.rb +87 -0
  285. data/spec/lib/contentful/management/locale_spec.rb +22 -22
  286. data/spec/lib/contentful/management/role_spec.rb +11 -11
  287. data/spec/lib/contentful/management/snapshot_spec.rb +27 -27
  288. data/spec/lib/contentful/management/space_membership_spec.rb +6 -7
  289. data/spec/lib/contentful/management/space_spec.rb +0 -282
  290. data/spec/lib/contentful/management/ui_extension_spec.rb +8 -8
  291. data/spec/lib/contentful/management/upload_spec.rb +9 -9
  292. data/spec/lib/contentful/management/webhook_calls_spec.rb +6 -6
  293. data/spec/lib/contentful/management/webhook_health_spec.rb +3 -3
  294. data/spec/lib/contentful/management/webhook_spec.rb +14 -12
  295. metadata +28 -14
  296. data/lib/contentful/management/space_asset_methods_factory.rb +0 -13
  297. data/lib/contentful/management/space_association_all_published_method_factory.rb +0 -12
  298. data/lib/contentful/management/space_content_type_methods_factory.rb +0 -13
  299. data/lib/contentful/management/space_editor_interface_methods_factory.rb +0 -21
  300. data/lib/contentful/management/space_entry_methods_factory.rb +0 -21
  301. data/lib/contentful/management/space_ui_extension_methods_factory.rb +0 -15
  302. data/spec/fixtures/vcr_cassettes/asset/all_public.yml +0 -112
  303. data/spec/fixtures/vcr_cassettes/entry/all_public.yml +0 -102
@@ -23,14 +23,14 @@ module Contentful
23
23
 
24
24
  let!(:client) { Client.new(token) }
25
25
 
26
- subject { client.editor_interfaces }
26
+ subject { client.editor_interfaces(space_id, 'master', content_type_id) }
27
27
 
28
28
  describe '.default' do
29
29
  it 'class method also works' do
30
- vcr('editor_interfaces/default_for_space') { expect(Contentful::Management::EditorInterface.default(client, space_id, content_type_id)).to be_kind_of Contentful::Management::EditorInterface }
30
+ vcr('editor_interfaces/default_for_space') { expect(Contentful::Management::EditorInterface.default(client, space_id, 'master', content_type_id)).to be_kind_of Contentful::Management::EditorInterface }
31
31
  end
32
32
  it 'builds a Contentful::Management::Locale object' do
33
- vcr('editor_interfaces/default_for_space') { expect(subject.default(space_id, content_type_id)).to be_kind_of Contentful::Management::EditorInterface }
33
+ vcr('editor_interfaces/default_for_space') { expect(subject.default).to be_kind_of Contentful::Management::EditorInterface }
34
34
  end
35
35
  end
36
36
 
@@ -39,7 +39,7 @@ module Contentful
39
39
 
40
40
  it 'can update the editor_interface' do
41
41
  vcr('editor_interfaces/update') do
42
- editor_interface = subject.default(space_id, content_type_id)
42
+ editor_interface = described_class.default(client, space_id, 'master', content_type_id)
43
43
 
44
44
  expect(editor_interface.controls.first['widgetId']).to eq 'singleline'
45
45
 
@@ -18,27 +18,27 @@ end
18
18
  module Contentful
19
19
  module Management
20
20
  describe Entry do
21
- let(:token) { '<ACCESS_TOKEN>' }
21
+ let(:token) { ENV.fetch('CF_TEST_CMA_TOKEN', '<ACCESS_TOKEN>') }
22
22
  let(:space_id) { 'yr5m0jky5hsh' }
23
23
  let(:entry_id) { '4Rouux8SoUCKwkyCq2I0E0' }
24
24
 
25
25
  let!(:client) { Client.new(token) }
26
26
 
27
- subject { client.entries }
27
+ subject { client.entries(space_id, 'master') }
28
28
 
29
29
  describe '.all' do
30
30
  it 'class method also works' do
31
- vcr('entry/all') { expect(Contentful::Management::Entry.all(client, 'bfsvtul0c41g')).to be_kind_of Contentful::Management::Array }
31
+ vcr('entry/all') { expect(Contentful::Management::Entry.all(client, 'bfsvtul0c41g', 'master')).to be_kind_of Contentful::Management::Array }
32
32
  end
33
33
  it 'returns a Contentful::Array' do
34
- vcr('entry/all') { expect(subject.all('bfsvtul0c41g')).to be_kind_of Contentful::Management::Array }
34
+ vcr('entry/all') { expect(described_class.all(client, 'bfsvtul0c41g', 'master')).to be_kind_of Contentful::Management::Array }
35
35
  end
36
36
  it 'builds a Contentful::Management::Entry object' do
37
- vcr('entry/all') { expect(subject.all('bfsvtul0c41g').first).to be_kind_of Contentful::Management::Entry }
37
+ vcr('entry/all') { expect(described_class.all(client, 'bfsvtul0c41g', 'master').first).to be_kind_of Contentful::Management::Entry }
38
38
  end
39
39
  it 'returns entries in context of specified content type' do
40
40
  vcr('entry/content_type_entires') do
41
- entries = subject.all('bfsvtul0c41g', content_type: 'category_content_type')
41
+ entries = described_class.all(client, 'bfsvtul0c41g', 'master', content_type: 'category_content_type')
42
42
  expect(entries).to be_kind_of Contentful::Management::Array
43
43
  expect(entries.first).to be_kind_of Contentful::Management::Entry
44
44
  expect(entries.first.sys[:contentType].id).to eq 'category_content_type'
@@ -46,7 +46,7 @@ module Contentful
46
46
  end
47
47
  it 'return limited number of entries with next_page' do
48
48
  vcr('entry/limited_entries') do
49
- entries = subject.all('bfsvtul0c41g', limit: 20, skip: 2)
49
+ entries = described_class.all(client, 'bfsvtul0c41g', 'master', limit: 20, skip: 2)
50
50
  expect(entries).to be_kind_of Contentful::Management::Array
51
51
  expect(entries.limit).to eq 20
52
52
  expect(entries.skip).to eq 2
@@ -55,57 +55,39 @@ module Contentful
55
55
  end
56
56
  it 'supports select operator' do
57
57
  vcr('entry/select_operator') do
58
- nyancat = subject.all('cfexampleapi', 'sys.id' => 'nyancat', content_type: 'cat', select: 'fields.lives').first
58
+ nyancat = described_class.all(client, 'cfexampleapi', 'master', 'sys.id' => 'nyancat', content_type: 'cat', select: 'fields.lives').first
59
59
  expect(nyancat.fields).to eq({lives: 1337})
60
60
  end
61
61
  end
62
62
  end
63
63
 
64
- describe '.all_published' do
65
- let!(:space_id) { 'bjwq7b86vgmm' }
66
-
67
- before :each do
68
- expect_any_instance_of(Contentful::Management::Entry.client_association_class).to receive(:warn)
69
- end
70
-
71
- it 'class method also works' do
72
- vcr('entry/all_public') { expect(Contentful::Management::Entry.all_published(client, space_id)).to be_kind_of Contentful::Management::Array }
73
- end
74
- it 'returns a Contentful::Array' do
75
- vcr('entry/all_public') { expect(subject.all_published(space_id)).to be_kind_of Contentful::Management::Array }
76
- end
77
- it 'builds a Contentful::Management::Entry object' do
78
- vcr('entry/all_public') { expect(subject.all_published(space_id).first).to be_kind_of Contentful::Management::Entry }
79
- end
80
- end
81
-
82
64
  describe '.find' do
83
65
  it 'class method also works' do
84
- vcr('entry/find') { expect(Contentful::Management::Entry.find(client, space_id, entry_id)).to be_kind_of Contentful::Management::Entry }
66
+ vcr('entry/find') { expect(Contentful::Management::Entry.find(client, space_id, 'master', entry_id)).to be_kind_of Contentful::Management::Entry }
85
67
  end
86
68
 
87
69
  it 'returns null as nil on empty Symbols' do
88
70
  vcr('entry/find-with-null-symbols') do
89
71
  space = client.spaces.find(space_id)
90
- entry = space.entries.find(entry_id)
72
+ entry = client.entries(space.id, 'master').find(entry_id)
91
73
  expect(entry.fields[:videoid]).to_not be_kind_of(String)
92
74
  expect(entry.fields[:videoid]).to be_nil
93
75
  end
94
76
  end
95
77
 
96
78
  it 'returns a Contentful::Management::Entry' do
97
- vcr('entry/find') { expect(subject.find(space_id, entry_id)).to be_kind_of Contentful::Management::Entry }
79
+ vcr('entry/find') { expect(subject.find(entry_id)).to be_kind_of Contentful::Management::Entry }
98
80
  end
99
81
 
100
82
  it 'returns the entry for a given key' do
101
83
  vcr('entry/find') do
102
- entry = subject.find(space_id, entry_id)
84
+ entry = subject.find(entry_id)
103
85
  expect(entry.id).to eql entry_id
104
86
  end
105
87
  end
106
88
  it 'returns an error when entry does not exists' do
107
89
  vcr('entry/find_not_found') do
108
- result = subject.find(space_id, 'not_exist')
90
+ result = subject.find('not_exist')
109
91
  expect(result).to be_kind_of Contentful::Management::NotFound
110
92
  end
111
93
  end
@@ -113,14 +95,14 @@ module Contentful
113
95
  let!(:client) { Client.new(token, raise_errors: true) }
114
96
  it 'returns an error when entry does not exists' do
115
97
  expect_vcr('entry/find_not_found') do
116
- subject.find(space_id, 'not_exist')
98
+ subject.find('not_exist')
117
99
  end.to raise_error Contentful::Management::NotFound
118
100
  end
119
101
  end
120
102
 
121
103
  it 'returns an error when service is unavailable' do
122
104
  vcr('entry/service_unavailable') do
123
- result = subject.find(space_id, 'not_exist')
105
+ result = subject.find('not_exist')
124
106
  expect(result).to be_kind_of Contentful::Management::ServiceUnavailable
125
107
  message = [
126
108
  "HTTP status code: 503 Service Unavailable",
@@ -134,7 +116,7 @@ module Contentful
134
116
  describe '#destroy' do
135
117
  it 'returns Contentful::BadRequest error when content type is published' do
136
118
  vcr('entry/destory_published') do
137
- result = subject.find(space_id, '3U7JqGuVzOWIimU40mKeem').destroy
119
+ result = subject.find('3U7JqGuVzOWIimU40mKeem').destroy
138
120
  expect(result).to be_kind_of Contentful::Management::BadRequest
139
121
  message = [
140
122
  "HTTP status code: 400 Bad Request",
@@ -145,7 +127,7 @@ module Contentful
145
127
  end
146
128
  it 'returns true when entry is not published' do
147
129
  vcr('entry/destroy') do
148
- result = subject.find(space_id, '3U7JqGuVzOWIimU40mKeem').destroy
130
+ result = subject.find('3U7JqGuVzOWIimU40mKeem').destroy
149
131
  expect(result).to eq true
150
132
  end
151
133
  end
@@ -154,7 +136,7 @@ module Contentful
154
136
  describe '#unpublish' do
155
137
  it 'unpublish the entry' do
156
138
  vcr('entry/unpublish') do
157
- entry = subject.find(space_id, entry_id)
139
+ entry = subject.find(entry_id)
158
140
  initial_version = entry.sys[:version]
159
141
  entry.unpublish
160
142
  expect(entry).to be_kind_of Contentful::Management::Entry
@@ -164,7 +146,7 @@ module Contentful
164
146
 
165
147
  it 'returns BadRequest error when already unpublished' do
166
148
  vcr('entry/unpublish_already_unpublished') do
167
- result = subject.find(space_id, entry_id).unpublish
149
+ result = subject.find(entry_id).unpublish
168
150
  expect(result).to be_kind_of Contentful::Management::BadRequest
169
151
  message = [
170
152
  "HTTP status code: 400 Bad Request",
@@ -172,7 +154,7 @@ module Contentful
172
154
  ].join("\n")
173
155
  expect(result.message).to eq message
174
156
  expect(result.error[:message]).to eq 'Not published'
175
- expect(result.error[:url]).to eq 'spaces/yr5m0jky5hsh/entries/4Rouux8SoUCKwkyCq2I0E0/published'
157
+ expect(result.error[:url]).to eq 'spaces/yr5m0jky5hsh/environments/master/entries/4Rouux8SoUCKwkyCq2I0E0/published'
176
158
  expect(result.error[:details]).to eq "{\n \"sys\": {\n \"type\": \"Error\",\n \"id\": \"BadRequest\"\n },\n \"message\": \"Not published\"\n}\n"
177
159
  end
178
160
  end
@@ -181,7 +163,7 @@ module Contentful
181
163
  describe '#publish' do
182
164
  it 'returns Contentful::Management::Entry' do
183
165
  vcr('entry/publish') do
184
- entry = subject.find(space_id, entry_id)
166
+ entry = subject.find(entry_id)
185
167
  initial_version = entry.sys[:version]
186
168
  entry.publish
187
169
  expect(entry).to be_kind_of Contentful::Management::Entry
@@ -190,7 +172,7 @@ module Contentful
190
172
  end
191
173
  it 'returns BadRequest error when already published' do
192
174
  vcr('entry/publish_already_published') do
193
- entry = subject.find(space_id, entry_id)
175
+ entry = subject.find(entry_id)
194
176
  entry.sys[:version] = -1
195
177
  result = entry.publish
196
178
  expect(result).to be_kind_of Contentful::Management::Conflict
@@ -201,14 +183,14 @@ module Contentful
201
183
  describe '#published?' do
202
184
  it 'returns true if entry is published' do
203
185
  vcr('entry/published_true') do
204
- entry = subject.find(space_id, entry_id)
186
+ entry = subject.find(entry_id)
205
187
  entry.publish
206
188
  expect(entry.published?).to be_truthy
207
189
  end
208
190
  end
209
191
  it 'returns false if entry is not published' do
210
192
  vcr('entry/published_false') do
211
- entry = subject.find(space_id, entry_id)
193
+ entry = subject.find(entry_id)
212
194
  entry.unpublish
213
195
  expect(entry.published?).to be_falsey
214
196
  end
@@ -218,7 +200,7 @@ module Contentful
218
200
  describe '#unarchive' do
219
201
  it 'unarchive the entry' do
220
202
  vcr('entry/unarchive') do
221
- entry = subject.find(space_id, entry_id)
203
+ entry = subject.find(entry_id)
222
204
  initial_version = entry.sys[:version]
223
205
  entry.unarchive
224
206
  expect(entry).to be_kind_of Contentful::Management::Entry
@@ -227,14 +209,14 @@ module Contentful
227
209
  end
228
210
  it 'returns BadRequest error when already unpublished' do
229
211
  vcr('entry/unarchive_already_unarchived') do
230
- result = subject.find(space_id, entry_id).unarchive
212
+ result = subject.find(entry_id).unarchive
231
213
  expect(result).to be_kind_of Contentful::Management::BadRequest
232
214
  end
233
215
  end
234
216
 
235
217
  it 'returns BadRequest error when already unarchived' do
236
218
  vcr('entry/unarchive_already_unarchived') do
237
- result = subject.find(space_id, entry_id).unarchive
219
+ result = subject.find(entry_id).unarchive
238
220
  expect(result).to be_kind_of Contentful::Management::BadRequest
239
221
  message = [
240
222
  "HTTP status code: 400 Bad Request",
@@ -248,7 +230,7 @@ module Contentful
248
230
  describe '#archive' do
249
231
  it 'entry' do
250
232
  vcr(:'entry/archive') do
251
- entry = subject.find(space_id, '3U7JqGuVzOWIimU40mKeem')
233
+ entry = subject.find('3U7JqGuVzOWIimU40mKeem')
252
234
  initial_version = entry.sys[:version]
253
235
  entry.archive
254
236
  expect(entry).to be_kind_of Contentful::Management::Entry
@@ -257,7 +239,7 @@ module Contentful
257
239
  end
258
240
  it 'returns error when archive published entry' do
259
241
  vcr('entry/archive_published') do
260
- entry = subject.find(space_id, entry_id).archive
242
+ entry = subject.find(entry_id).archive
261
243
  expect(entry).to be_kind_of Contentful::Management::BadRequest
262
244
  message = [
263
245
  "HTTP status code: 400 Bad Request",
@@ -271,14 +253,14 @@ module Contentful
271
253
  describe '#archived?' do
272
254
  it 'returns true if entry is archived' do
273
255
  vcr('entry/archived_true') do
274
- entry = subject.find(space_id, entry_id)
256
+ entry = subject.find(entry_id)
275
257
  entry.archive
276
258
  expect(entry.archived?).to be_truthy
277
259
  end
278
260
  end
279
261
  it 'returns false if entry is not archived' do
280
262
  vcr('entry/archived_false') do
281
- entry = subject.find(space_id, entry_id)
263
+ entry = subject.find(entry_id)
282
264
  entry.unarchive
283
265
  expect(entry.archived?).to be_falsey
284
266
  end
@@ -287,18 +269,18 @@ module Contentful
287
269
 
288
270
  describe '.create' do
289
271
  let(:content_type_id) { '5DSpuKrl04eMAGQoQckeIq' }
290
- let(:content_type) { client.content_types.find(space_id, content_type_id) }
272
+ let(:content_type) { client.content_types(space_id, 'master').find(content_type_id) }
291
273
 
292
274
  it 'create with all attributes' do
293
275
  vcr('entry/create') do
294
- content_type = client.content_types.find('ene4qtp2sh7u', '5BHZB1vi4ooq4wKcmA8e2c')
276
+ content_type = client.content_types('ene4qtp2sh7u', 'master').find('5BHZB1vi4ooq4wKcmA8e2c')
295
277
  location = Location.new.tap do |loc|
296
278
  loc.lat = 22.44
297
279
  loc.lon = 33.33
298
280
  end
299
- file = client.assets.find('ene4qtp2sh7u', '2oNoT3vSAs82SOIQmKe0KG')
300
- entry_att = subject.find('ene4qtp2sh7u', '60zYC7nY9GcKGiCYwAs4wm')
301
- entry = subject.create(
281
+ file = client.assets('ene4qtp2sh7u', 'master').find('2oNoT3vSAs82SOIQmKe0KG')
282
+ entry_att = described_class.find(client, 'ene4qtp2sh7u', 'master', '60zYC7nY9GcKGiCYwAs4wm')
283
+ entry = client.entries('ene4qtp2sh7u', 'master').create(
302
284
  content_type,
303
285
  name: 'Test name',
304
286
  number: 30,
@@ -343,7 +325,7 @@ module Contentful
343
325
 
344
326
  it 'with entry' do
345
327
  vcr('entry/create_with_entry') do
346
- entry_att = client.entries.find(space_id, '4o6ghKSmSko4i828YCYaEo')
328
+ entry_att = client.entries(space_id, 'master').find('4o6ghKSmSko4i828YCYaEo')
347
329
  entry = subject.create(content_type, name: 'EntryWithEntry', age: 20, entry: entry_att)
348
330
  expect(entry.name).to eq 'EntryWithEntry'
349
331
  expect(entry.age).to eq 20
@@ -353,7 +335,7 @@ module Contentful
353
335
 
354
336
  it 'with entries' do
355
337
  vcr('entry/create_with_entries') do
356
- entry_att = subject.find(space_id, '1d1QDYzeiyWmgqQYysae8u')
338
+ entry_att = subject.find('1d1QDYzeiyWmgqQYysae8u')
357
339
  new_entry = subject.create(content_type,
358
340
  name: 'EntryWithEntries',
359
341
  age: 20,
@@ -382,7 +364,7 @@ module Contentful
382
364
 
383
365
  it 'with entry inherited from Contentful::Entry' do
384
366
  vcr('entry/create_with_entry') do
385
- entry_att = Contentful::BaseEntry.new(client.entries.find(space_id, '4o6ghKSmSko4i828YCYaEo'))
367
+ entry_att = Contentful::BaseEntry.new(client.entries(space_id, 'master').find('4o6ghKSmSko4i828YCYaEo'))
386
368
  entry = subject.create(content_type, name: 'EntryWithEntry', age: 20, entry: entry_att)
387
369
  expect(entry.name).to eq 'EntryWithEntry'
388
370
  expect(entry.age).to eq 20
@@ -392,7 +374,7 @@ module Contentful
392
374
 
393
375
  it 'with entries inherited from Contentful::Entry' do
394
376
  vcr('entry/create_with_entries') do
395
- entry_att = Contentful::BaseEntry.new(subject.find(space_id, '1d1QDYzeiyWmgqQYysae8u'))
377
+ entry_att = Contentful::BaseEntry.new(subject.find('1d1QDYzeiyWmgqQYysae8u'))
396
378
  new_entry = subject.create(content_type,
397
379
  name: 'EntryWithEntries',
398
380
  age: 20,
@@ -404,14 +386,14 @@ module Contentful
404
386
 
405
387
  it 'with asset' do
406
388
  vcr('entry/create_with_asset') do
407
- asset = client.assets.find(space_id, 'codequest_id_test_custom')
389
+ asset = client.assets(space_id, 'master').find('codequest_id_test_custom')
408
390
  entry = subject.create(content_type, name: 'OneAsset', asset: asset)
409
391
  expect(entry.name).to eq 'OneAsset'
410
392
  end
411
393
  end
412
394
  it 'with assets' do
413
395
  vcr('entry/create_with_assets') do
414
- asset = client.assets.find(space_id, 'codequest_id_test_custom')
396
+ asset = client.assets(space_id, 'master').find('codequest_id_test_custom')
415
397
  entry = subject.create(content_type, name: 'multiAssets', assets: [asset, asset, asset])
416
398
  expect(entry.name).to eq 'multiAssets'
417
399
  end
@@ -432,7 +414,7 @@ module Contentful
432
414
  it 'to specified locale' do
433
415
  vcr('entry/create_with_specified_locale') do
434
416
  space = client.spaces.find('s37a4pe35l1x')
435
- ct = space.content_types.find('category_content_type')
417
+ ct = client.content_types(space.id, 'master').find('category_content_type')
436
418
  entry = ct.entries.create(name: 'Create test', description: 'Test - create entry with specified locale.', locale: 'pl-PL')
437
419
  expect(entry.name).to eq 'Create test'
438
420
  end
@@ -441,8 +423,8 @@ module Contentful
441
423
  it 'too many requests' do
442
424
  vcr('entry/too_many_requests') do
443
425
  space = client.spaces.find('286arvy86ry9')
444
- invalid_entry = space.entries.find('1YNepnMpXGiMWikaKC4GG0')
445
- ct = space.content_types.find('5lIEiXrCIoKoIKaSW2C8aa')
426
+ invalid_entry = client.entries(space.id, 'master').find('1YNepnMpXGiMWikaKC4GG0')
427
+ ct = client.content_types(space.id, 'master').find('5lIEiXrCIoKoIKaSW2C8aa')
446
428
  entry = ct.entries.create(name: 'Create test', entry: invalid_entry)
447
429
  publish = entry.publish
448
430
  expect(publish).to be_a RateLimitExceeded
@@ -454,8 +436,8 @@ module Contentful
454
436
  vcr('entry/too_many_requests_retry') do
455
437
  logger = RetryLoggerMock.new(STDOUT)
456
438
  space = Client.new(token, raise_errors: true, logger: logger).spaces.find('286arvy86ry9')
457
- invalid_entry = space.entries.find('1YNepnMpXGiMWikaKC4GG0')
458
- ct = space.content_types.find('5lIEiXrCIoKoIKaSW2C8aa')
439
+ invalid_entry = client.entries(space.id, 'master').find('1YNepnMpXGiMWikaKC4GG0')
440
+ ct = client.content_types(space.id, 'master').find('5lIEiXrCIoKoIKaSW2C8aa')
459
441
  entry = ct.entries.create(name: 'Create test', entry: invalid_entry)
460
442
  entry.publish
461
443
 
@@ -466,7 +448,7 @@ module Contentful
466
448
  it 'with just an id' do
467
449
  vcr('entry/create_with_just_id') do
468
450
  space = client.spaces.find('bbukbffokvih')
469
- entry = space.content_types.all.first.entries.create({'id' => 'yol'})
451
+ entry = client.content_types(space.id, 'master').all.first.entries.create({'id' => 'yol'})
470
452
  entry.save
471
453
  expect(entry).to be_a Contentful::Management::Entry
472
454
  end
@@ -477,9 +459,9 @@ module Contentful
477
459
  let(:entry_id) { '1I3qWOiP8k2WWYCogKy88S' }
478
460
  it 'update entry' do
479
461
  vcr('entry/update') do
480
- asset = client.assets.find(space_id, 'codequest_id_test_custom_id')
481
- entry_att = subject.find(space_id, '1d1QDYzeiyWmgqQYysae8u')
482
- entry = subject.find(space_id, '4o6ghKSmSko4i828YCYaEo')
462
+ asset = client.assets(space_id, 'master').find('codequest_id_test_custom_id')
463
+ entry_att = subject.find('1d1QDYzeiyWmgqQYysae8u')
464
+ entry = subject.find('4o6ghKSmSko4i828YCYaEo')
483
465
 
484
466
  location = Location.new
485
467
  location.lat = 22.44
@@ -507,7 +489,7 @@ module Contentful
507
489
 
508
490
  it 'update entry for custom locale' do
509
491
  vcr('entry/update_with_custom_locale') do
510
- entry = subject.find(space_id, '3U7JqGuVzOWIimU40mKeem')
492
+ entry = subject.find('3U7JqGuVzOWIimU40mKeem')
511
493
  entry.locale = 'pl'
512
494
  result = entry.update(name: 'testName', bool: true)
513
495
  expect(result).to be_kind_of Contentful::Management::Entry
@@ -518,12 +500,12 @@ module Contentful
518
500
 
519
501
  it 'return Error when update not localized field' do
520
502
  vcr('entry/update_unlocalized_field') do
521
- asset = client.assets.find(space_id, 'codequest_id_test_custom_id')
503
+ asset = client.assets(space_id, 'master').find('codequest_id_test_custom_id')
522
504
 
523
505
  location = Location.new
524
506
  location.lat = 22.44
525
507
  location.lon = 33.33
526
- entry = subject.find(space_id, '3U7JqGuVzOWIimU40mKeem')
508
+ entry = subject.find('3U7JqGuVzOWIimU40mKeem')
527
509
  entry.locale = 'pl'
528
510
  result = entry.update(name: 'DoestMatter', bool: false, city: location, asset: asset)
529
511
  expect(result).to be_kind_of Contentful::Management::Error
@@ -533,7 +515,7 @@ module Contentful
533
515
  it 'can update boolean fields to `false`' do
534
516
  vcr('entry/update_bool_field') do
535
517
  space = client.spaces.find('fujuvqn6zcl1')
536
- content_type = space.content_types.find('1kUEViTN4EmGiEaaeC6ouY')
518
+ content_type = client.content_types(space.id, 'master').find('1kUEViTN4EmGiEaaeC6ouY')
537
519
 
538
520
  q = content_type.entries.new
539
521
  q.name_with_locales = {'en-US' => 'Hello World'}
@@ -541,7 +523,7 @@ module Contentful
541
523
  expected = q.fields
542
524
  q.save
543
525
 
544
- p = space.entries.find(q.id)
526
+ p = client.entries(space.id, 'master').find(q.id)
545
527
  expect(p.fields).to match(expected)
546
528
  end
547
529
  end
@@ -550,7 +532,7 @@ module Contentful
550
532
  describe '#save' do
551
533
  it 'save updated' do
552
534
  vcr('entry/save_update') do
553
- entry = subject.find(space_id, '664EPJ6zHqAeMO6O0mGggU')
535
+ entry = subject.find('664EPJ6zHqAeMO6O0mGggU')
554
536
  entry.fields[:carMark] = 'Merc'
555
537
  entry.save
556
538
  expect(entry).to be_kind_of Contentful::Management::Entry
@@ -564,7 +546,9 @@ module Contentful
564
546
  it 'update the current version of the object to the version on the system' do
565
547
  vcr('entry/reload') do
566
548
  space = client.spaces.find(space_id)
567
- entry = space.entries.find('2arjcjtY7ucC4AGeIOIkok')
549
+ client.content_types(space.id, 'master').all # warm-up cache
550
+
551
+ entry = client.entries(space.id, 'master').find('2arjcjtY7ucC4AGeIOIkok')
568
552
  entry.sys[:version] = 999
569
553
  update_entry = entry.update(post_title: 'Updated title')
570
554
  expect(update_entry).to be_kind_of Contentful::Management::Conflict
@@ -583,7 +567,7 @@ module Contentful
583
567
  context 'order' do
584
568
  it 'returns ordered entries by createdAt' do
585
569
  vcr('entry/search_filter/order_sys.createdAt') do
586
- ordered_entries = space.entries.all(order: 'sys.createdAt')
570
+ ordered_entries = client.entries(space.id, 'master').all(order: 'sys.createdAt')
587
571
  expect(ordered_entries).to be_kind_of Contentful::Management::Array
588
572
  expect(ordered_entries.first).to be_kind_of Contentful::Management::Entry
589
573
  expect(ordered_entries.first.sys[:createdAt] < ordered_entries.to_a[4].sys[:createdAt]).to be_truthy
@@ -592,7 +576,7 @@ module Contentful
592
576
 
593
577
  it 'returns ordered entries by updatedAt' do
594
578
  vcr('entry/search_filter/order_sys.updatedAt') do
595
- ordered_entries = space.entries.all(order: 'sys.updatedAt')
579
+ ordered_entries = client.entries(space.id, 'master').all(order: 'sys.updatedAt')
596
580
  expect(ordered_entries).to be_kind_of Contentful::Management::Array
597
581
  expect(ordered_entries.first).to be_kind_of Contentful::Management::Entry
598
582
  expect(ordered_entries.first.sys[:updatedAt] < ordered_entries.to_a[4].sys[:updatedAt]).to be_truthy
@@ -601,7 +585,7 @@ module Contentful
601
585
  context 'reverse the sort-order' do
602
586
  it 'returns reverse sort of ordered entries by updatedAt' do
603
587
  vcr('entry/search_filter/reverse_order_sys.updatedAt') do
604
- reverse_ordered_entries = space.entries.all(order: '-sys.updatedAt')
588
+ reverse_ordered_entries = client.entries(space.id, 'master').all(order: '-sys.updatedAt')
605
589
  expect(reverse_ordered_entries).to be_kind_of Contentful::Management::Array
606
590
  expect(reverse_ordered_entries.first).to be_kind_of Contentful::Management::Entry
607
591
  expect(reverse_ordered_entries.first.sys[:updatedAt] > reverse_ordered_entries.to_a[4].sys[:updatedAt]).to be_truthy
@@ -613,7 +597,7 @@ module Contentful
613
597
  context 'Including linked Entries in search results' do
614
598
  it 'returns content_type Entry and include 1 level of linked Entries' do
615
599
  vcr('entry/search_filter/including_linked_entries') do
616
- filtered_entries = space.entries.all('sys.id' => '2Hs5BaU56oUmUIySMQQMUS', include: 2)
600
+ filtered_entries = client.entries(space.id, 'master').all('sys.id' => '2Hs5BaU56oUmUIySMQQMUS', include: 2)
617
601
  expect(filtered_entries).to be_kind_of Contentful::Management::Array
618
602
  expect(filtered_entries.first).to be_kind_of Contentful::Management::Entry
619
603
  end
@@ -624,7 +608,7 @@ module Contentful
624
608
  context 'equality operator' do
625
609
  it 'returns all Entries with specified ID(IDs are unique and there can only be one)' do
626
610
  vcr('entry/search_filter/equality_operator') do
627
- filtered_entries = space.entries.all('sys.id' => '2Hs5BaU56oUmUIySMQQMUS')
611
+ filtered_entries = client.entries(space.id, 'master').all('sys.id' => '2Hs5BaU56oUmUIySMQQMUS')
628
612
  expect(filtered_entries).to be_kind_of Contentful::Management::Array
629
613
  expect(filtered_entries.first).to be_kind_of Contentful::Management::Entry
630
614
  expect(filtered_entries.first.sys[:id]).to eq '2Hs5BaU56oUmUIySMQQMUS'
@@ -632,7 +616,7 @@ module Contentful
632
616
  end
633
617
  it 'returns all entries by matching fields.number equal 33' do
634
618
  vcr('entry/search_filter/matching_array_fields') do
635
- filtered_entries = space.entries.all(content_type: 'category_content_type', 'fields.number' => 33)
619
+ filtered_entries = client.entries(space.id, 'master').all(content_type: 'category_content_type', 'fields.number' => 33)
636
620
  expect(filtered_entries).to be_kind_of Contentful::Management::Array
637
621
  expect(filtered_entries.first).to be_kind_of Contentful::Management::Entry
638
622
  expect(filtered_entries.size).to eq 2
@@ -642,7 +626,7 @@ module Contentful
642
626
  context 'inequality operator' do
643
627
  it 'returns all entries except entry with id = 2Hs5BaU56oUmUIySMQQMUS' do
644
628
  vcr('entry/search_filter/inequality_operator') do
645
- filtered_entries = space.entries.all('sys.id[ne]' => '2Hs5BaU56oUmUIySMQQMUS')
629
+ filtered_entries = client.entries(space.id, 'master').all('sys.id[ne]' => '2Hs5BaU56oUmUIySMQQMUS')
646
630
  expect(filtered_entries).to be_kind_of Contentful::Management::Array
647
631
  expect(filtered_entries.first).to be_kind_of Contentful::Management::Entry
648
632
  expect(filtered_entries.map(&:id).include?('2Hs5BaU56oUmUIySMQQMUS')).to be_falsey
@@ -654,7 +638,7 @@ module Contentful
654
638
  context 'inclusion operator' do
655
639
  it 'returns entries with specified IDs' do
656
640
  vcr('entry/search_filter/inclusion_operator') do
657
- filtered_entries = space.entries.all('sys.id[in]' => '2Hs5BaU56oUmUIySMQQMUS,2X3X7RHVzqsKGAgIEewgaS')
641
+ filtered_entries = client.entries(space.id, 'master').all('sys.id[in]' => '2Hs5BaU56oUmUIySMQQMUS,2X3X7RHVzqsKGAgIEewgaS')
658
642
  expect(filtered_entries).to be_kind_of Contentful::Management::Array
659
643
  expect(filtered_entries.first).to be_kind_of Contentful::Management::Entry
660
644
  expect(filtered_entries.map(&:id).include?('2Hs5BaU56oUmUIySMQQMUS')).to be_truthy
@@ -666,7 +650,7 @@ module Contentful
666
650
  context 'exclusion operator' do
667
651
  it 'returns all entries except with specified IDs' do
668
652
  vcr('entry/search_filter/exclusion_operator') do
669
- filtered_entries = space.entries.all(content_type: 'category_content_type', 'sys.id[nin]' => '2Hs5BaU56oUmUIySMQQMUS,2X3X7RHVzqsKGAgIEewgaS')
653
+ filtered_entries = client.entries(space.id, 'master').all(content_type: 'category_content_type', 'sys.id[nin]' => '2Hs5BaU56oUmUIySMQQMUS,2X3X7RHVzqsKGAgIEewgaS')
670
654
  expect(filtered_entries).to be_kind_of Contentful::Management::Array
671
655
  expect(filtered_entries.first).to be_kind_of Contentful::Management::Entry
672
656
  expect(filtered_entries.map(&:id).include?('2Hs5BaU56oUmUIySMQQMUS')).to be_falsy
@@ -679,7 +663,7 @@ module Contentful
679
663
  context 'Full-text Search' do
680
664
  it 'returns all entries except with specified IDs' do
681
665
  vcr('entry/search_filter/full_search') do
682
- filtered_entries = space.entries.all(query: 'find me')
666
+ filtered_entries = client.entries(space.id, 'master').all(query: 'find me')
683
667
  expect(filtered_entries).to be_kind_of Contentful::Management::Array
684
668
  expect(filtered_entries.first).to be_kind_of Contentful::Management::Entry
685
669
  expect(filtered_entries.size).to eq 2
@@ -687,7 +671,7 @@ module Contentful
687
671
  end
688
672
  it 'returns all entries except with specified IDs' do
689
673
  vcr('entry/search_filter/full_search_match_operator') do
690
- filtered_entries = space.entries.all(content_type: 'category_content_type', 'fields.description[match]' => 'find')
674
+ filtered_entries = client.entries(space.id, 'master').all(content_type: 'category_content_type', 'fields.description[match]' => 'find')
691
675
  expect(filtered_entries).to be_kind_of Contentful::Management::Array
692
676
  expect(filtered_entries.first).to be_kind_of Contentful::Management::Entry
693
677
  expect(filtered_entries.size).to eq 2
@@ -697,7 +681,7 @@ module Contentful
697
681
  context 'Location-based search' do
698
682
  it 'returns entries closest to a specific map location and order the results by distance' do
699
683
  vcr('entry/search_filter/location_search_near_operator') do
700
- filtered_entries = space.entries.all('fields.location[near]' => '23.15758,53.1297098', content_type: '37TpyB8DcQkq0wkY8c4g2g')
684
+ filtered_entries = client.entries(space.id, 'master').all('fields.location[near]' => '23.15758,53.1297098', content_type: '37TpyB8DcQkq0wkY8c4g2g')
701
685
  expect(filtered_entries).to be_kind_of Contentful::Management::Array
702
686
  expect(filtered_entries.first).to be_kind_of Contentful::Management::Entry
703
687
  end
@@ -705,7 +689,7 @@ module Contentful
705
689
 
706
690
  it 'returns entries with fields.location is inside of the circle' do
707
691
  vcr('entry/search_filter/location_search_within_operator') do
708
- filtered_entries = space.entries.all('fields.location[within]' => '52,23,300', content_type: '37TpyB8DcQkq0wkY8c4g2g')
692
+ filtered_entries = client.entries(space.id, 'master').all('fields.location[within]' => '52,23,300', content_type: '37TpyB8DcQkq0wkY8c4g2g')
709
693
  expect(filtered_entries).to be_kind_of Contentful::Management::Array
710
694
  expect(filtered_entries.first).to be_kind_of Contentful::Management::Entry
711
695
  end
@@ -716,7 +700,7 @@ module Contentful
716
700
  context 'number' do
717
701
  it 'returns entries with fields.number less then 20' do
718
702
  vcr('entry/search_filter/range_operators_less') do
719
- filtered_entries = space.entries.all('fields.number[lte]' => '20', content_type: 'category_content_type')
703
+ filtered_entries = client.entries(space.id, 'master').all('fields.number[lte]' => '20', content_type: 'category_content_type')
720
704
  expect(filtered_entries).to be_kind_of Contentful::Management::Array
721
705
  expect(filtered_entries.first).to be_kind_of Contentful::Management::Entry
722
706
  expect(filtered_entries.size).to eq 1
@@ -726,7 +710,7 @@ module Contentful
726
710
  context 'date ranges' do
727
711
  it 'returns entries have been updated since midnight August 19th 2013' do
728
712
  vcr('entry/search_filter/range_operators_greater_than_or_equal') do
729
- filtered_entries = space.entries.all('sys.updatedAt[gte]' => '2014-08-19T00:00:00Z')
713
+ filtered_entries = client.entries(space.id, 'master').all('sys.updatedAt[gte]' => '2014-08-19T00:00:00Z')
730
714
  expect(filtered_entries).to be_kind_of Contentful::Management::Array
731
715
  expect(filtered_entries.first).to be_kind_of Contentful::Management::Entry
732
716
  expect(filtered_entries.size).to eq 11
@@ -740,7 +724,7 @@ module Contentful
740
724
  it 'retrieves localized value if it exists' do
741
725
  vcr('entry/locales/retrieve_localized') do
742
726
  space = client.spaces.find('0agypmo1waov')
743
- entry = space.entries.find('5cMXsmSd5So6iggWi268eG')
727
+ entry = client.entries(space.id, 'master').find('5cMXsmSd5So6iggWi268eG')
744
728
  entry.locale = 'de-DE'
745
729
 
746
730
  expect(entry.fields.count).to eq 2
@@ -751,7 +735,7 @@ module Contentful
751
735
  it 'retrieves value of default locale if it has not been localized' do
752
736
  vcr('entry/locales/fallback_to_default_locale') do
753
737
  space = client.spaces.find('0agypmo1waov')
754
- entry = space.entries.find('4epXENbO8wsaOukgqquYcI')
738
+ entry = client.entries(space.id, 'master').find('4epXENbO8wsaOukgqquYcI')
755
739
  entry.locale = 'de-DE'
756
740
 
757
741
  expect(entry.fields.count).to eq 2
@@ -762,7 +746,9 @@ module Contentful
762
746
  it 'sets value for the default locale when using simple assignments' do
763
747
  vcr('entry/locales/simple_assignments_use_default_locale') do
764
748
  space = client.spaces.find('0agypmo1waov')
765
- entry = space.entries.find('4epXENbO8wsaOukgqquYcI')
749
+ client.content_types(space.id, 'master').all # warm-up cache
750
+
751
+ entry = client.entries(space.id, 'master').find('4epXENbO8wsaOukgqquYcI')
766
752
 
767
753
  entry.yolo = 'changed'
768
754
 
@@ -773,7 +759,9 @@ module Contentful
773
759
  it 'sets value for the specified locales when using *_with_locales' do
774
760
  vcr('entry/locales/simple_assignments_use_specified_locale') do
775
761
  space = client.spaces.find('0agypmo1waov')
776
- entry = space.entries.find('4epXENbO8wsaOukgqquYcI')
762
+ client.content_types(space.id, 'master').all # warm-up cache
763
+
764
+ entry = client.entries(space.id, 'master').find('4epXENbO8wsaOukgqquYcI')
777
765
 
778
766
  entry.yolo_with_locales = {'de-DE' => 'changed'}
779
767
  entry.locale = 'de-DE'
@@ -840,7 +828,8 @@ module Contentful
840
828
  let(:space) { client.spaces.find('wqjq16zu9s8b') }
841
829
  it "if a property is nil, it's removed from the request to undefine it in the API" do
842
830
  vcr('entry/fallback_undefined') {
843
- entry = space.entries.find('6HSlhD1o3eqkyEWWuMQYyU')
831
+ client.content_types(space.id, 'master').all # warm-up cache
832
+ entry = client.entries(space.id, 'master').find('6HSlhD1o3eqkyEWWuMQYyU')
844
833
 
845
834
  expect(entry.name).to eq 'Foo'
846
835
  expect(entry.fields('es')[:name]).to eq 'Bar'
@@ -861,13 +850,14 @@ module Contentful
861
850
  it 'merges all present locales' do
862
851
  vcr('entry/issue_70') {
863
852
  space = client.spaces.find('9sh5dtmfyzhj')
853
+ client.content_types(space.id, 'master').all # warm-up cache
864
854
 
865
- entry_non_default_locale = space.entries.find('1PdCkb5maYgqsSUCOweseM')
855
+ entry_non_default_locale = client.entries(space.id, 'master').find('1PdCkb5maYgqsSUCOweseM')
866
856
 
867
857
  expect(entry_non_default_locale.name_with_locales).to match({"de-DE" => nil, "es" => "Futbolista"})
868
858
  expect(entry_non_default_locale.non_localized_with_locales).to match({"de-DE" => "baz", "es" => nil})
869
859
 
870
- entry_with_all_locales = space.entries.find('1QKkNRf9AEW2wqwWowgscs')
860
+ entry_with_all_locales = client.entries(space.id, 'master').find('1QKkNRf9AEW2wqwWowgscs')
871
861
 
872
862
  expect(entry_with_all_locales.name_with_locales).to match({"de-DE" => "Junge", "en-US" => "Boy", "es" => "Chico"})
873
863
  expect(entry_with_all_locales.non_localized_with_locales).to match({"de-DE" => "foobar", "en-US" => nil, "es" => nil})
@@ -878,7 +868,7 @@ module Contentful
878
868
  vcr('entry/issue_73') {
879
869
  begin
880
870
  client.configuration[:default_locale] = 'en-GB'
881
- content_type = client.content_types.find('u2viwgfeal0o', 'someType')
871
+ content_type = client.content_types('u2viwgfeal0o', 'master').find('someType')
882
872
  new_entry = content_type.entries.create(id: 'hello-world')
883
873
 
884
874
  new_entry.name = 'Hello World!'
@@ -891,14 +881,14 @@ module Contentful
891
881
  expect(res.is_a?(Contentful::Management::DynamicEntry)).to be_truthy
892
882
  expect(res.value_with_locales).to match('en-GB' => 'hello world', 'es-ES' => 'hola mundo')
893
883
  ensure
894
- new_entry.destroy
884
+ #new_entry.destroy
895
885
  end
896
886
  }
897
887
  end
898
888
 
899
889
  it 'fields_for_query get properly updated when setting a field using _with_locales - #91' do
900
890
  vcr('entry/issue_91') {
901
- entry = client.entries.find('iv4sic0eru9h', '5GrMLWzfyMs0eKoi4sg2ug')
891
+ entry = client.entries('iv4sic0eru9h', 'master').find('5GrMLWzfyMs0eKoi4sg2ug')
902
892
 
903
893
  expect(entry.test_with_locales).to eq('en-US' => 'foo', 'es' => 'bar')
904
894
 
@@ -916,7 +906,7 @@ module Contentful
916
906
  vcr('entry/issue_61.1') {
917
907
  begin
918
908
  client.configuration[:default_locale] = 'en-GB'
919
- content_type = client.content_types.find('u2viwgfeal0o', 'someType')
909
+ content_type = client.content_types('u2viwgfeal0o', 'master').find('someType')
920
910
  new_entry = content_type.entries.create(id: 'issue61_1', value: 'hello')
921
911
 
922
912
  expect(new_entry.value).to eq 'hello'
@@ -926,7 +916,7 @@ module Contentful
926
916
  new_entry.save
927
917
  new_entry.publish
928
918
 
929
- expected_entry = subject.find('u2viwgfeal0o', new_entry.id)
919
+ expected_entry = client.entries('u2viwgfeal0o', 'master').find(new_entry.id)
930
920
 
931
921
  expect(expected_entry.value).to eq 'goodbye'
932
922
  ensure
@@ -939,7 +929,7 @@ module Contentful
939
929
  vcr('entry/issue_61.2') {
940
930
  begin
941
931
  client.configuration[:default_locale] = 'en-GB'
942
- content_type = client.content_types.find('u2viwgfeal0o', 'someType')
932
+ content_type = client.content_types('u2viwgfeal0o', 'master').find('someType')
943
933
  new_entry = content_type.entries.create(id: 'issue61_2')
944
934
 
945
935
  new_entry.value = 'goodbye'
@@ -949,7 +939,7 @@ module Contentful
949
939
 
950
940
  expect(new_entry.value).to eq 'goodbye'
951
941
 
952
- expected_entry = subject.find('u2viwgfeal0o', new_entry.id)
942
+ expected_entry = client.entries('u2viwgfeal0o', 'master').find(new_entry.id)
953
943
 
954
944
  expect(expected_entry.value).to eq 'goodbye'
955
945
  ensure
@@ -964,12 +954,12 @@ module Contentful
964
954
  vcr('entry/issue_61.3') {
965
955
  begin
966
956
  client.configuration[:default_locale] = 'en-GB'
967
- content_type = client.content_types.find('u2viwgfeal0o', 'someType')
957
+ content_type = client.content_types('u2viwgfeal0o', 'master').find('someType')
968
958
  new_entry = content_type.entries.create(id: 'issue61_3', value: 'hello')
969
959
 
970
960
  expect(new_entry.value).to eq 'hello'
971
961
 
972
- expected_entry = subject.find('u2viwgfeal0o', new_entry.id)
962
+ expected_entry = client.entries('u2viwgfeal0o', 'master').find(new_entry.id)
973
963
 
974
964
  expected_entry.value = 'goodbye'
975
965
 
@@ -987,10 +977,10 @@ module Contentful
987
977
  vcr('entry/issue_61.4') {
988
978
  begin
989
979
  client.configuration[:default_locale] = 'en-GB'
990
- content_type = client.content_types.find('u2viwgfeal0o', 'someType')
980
+ content_type = client.content_types('u2viwgfeal0o', 'master').find('someType')
991
981
  new_entry = content_type.entries.create(id: 'issue61_4')
992
982
 
993
- expected_entry = subject.find('u2viwgfeal0o', new_entry.id)
983
+ expected_entry = client.entries('u2viwgfeal0o', 'master').find(new_entry.id)
994
984
 
995
985
  expected_entry.value = 'goodbye'
996
986
 
@@ -1008,13 +998,13 @@ module Contentful
1008
998
 
1009
999
  describe 'on an entry created through the ui' do
1010
1000
  describe 'with dynamic_entries' do
1011
- let!(:client) { vcr('entry/issue_61_spaces') { Client.new(token, dynamic_entries: ['u2viwgfeal0o']) } }
1001
+ let!(:client) { vcr('entry/issue_61_spaces') { Client.new(token, dynamic_entries: {'u2viwgfeal0o' => 'master'}) } }
1012
1002
  it 'on an already populated field' do
1013
1003
  vcr('entry/issue_61.5') {
1014
1004
  begin
1015
1005
  client.configuration[:default_locale] = 'en-GB'
1016
1006
 
1017
- expected_entry = subject.find('u2viwgfeal0o', 'fIpsfQSOd22IsqMQCiG0K')
1007
+ expected_entry = client.entries('u2viwgfeal0o', 'master').find('fIpsfQSOd22IsqMQCiG0K')
1018
1008
 
1019
1009
  expect(expected_entry.value).to eq 'hello'
1020
1010
 
@@ -1038,7 +1028,7 @@ module Contentful
1038
1028
  begin
1039
1029
  client.configuration[:default_locale] = 'en-GB'
1040
1030
 
1041
- expected_entry = subject.find('u2viwgfeal0o', '2GmtCwDBcIu4giMgQGIIcq')
1031
+ expected_entry = client.entries('u2viwgfeal0o', 'master').find('2GmtCwDBcIu4giMgQGIIcq')
1042
1032
 
1043
1033
  expect(expected_entry.value).to eq nil
1044
1034
 
@@ -1065,7 +1055,7 @@ module Contentful
1065
1055
  begin
1066
1056
  client.configuration[:default_locale] = 'en-GB'
1067
1057
 
1068
- expected_entry = subject.find('u2viwgfeal0o', 'fIpsfQSOd22IsqMQCiG0K')
1058
+ expected_entry = client.entries('u2viwgfeal0o', 'master').find('fIpsfQSOd22IsqMQCiG0K')
1069
1059
 
1070
1060
  expect(expected_entry.value).to eq 'hello'
1071
1061
 
@@ -1089,7 +1079,7 @@ module Contentful
1089
1079
  begin
1090
1080
  client.configuration[:default_locale] = 'en-GB'
1091
1081
 
1092
- expected_entry = subject.find('u2viwgfeal0o', '2GmtCwDBcIu4giMgQGIIcq')
1082
+ expected_entry = client.entries('u2viwgfeal0o', 'master').find('2GmtCwDBcIu4giMgQGIIcq')
1093
1083
 
1094
1084
  expect(expected_entry.value).to eq nil
1095
1085