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.
- checksums.yaml +5 -5
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +48 -0
- data/README.md +92 -50
- data/lib/contentful/management/api_key.rb +25 -2
- data/lib/contentful/management/array.rb +3 -3
- data/lib/contentful/management/asset.rb +13 -8
- data/lib/contentful/management/client.rb +73 -60
- data/lib/contentful/management/client_api_key_methods_factory.rb +8 -0
- data/lib/contentful/management/client_asset_methods_factory.rb +0 -2
- data/lib/contentful/management/client_association_all_published_method_factory.rb +2 -3
- data/lib/contentful/management/client_association_methods_factory.rb +9 -9
- data/lib/contentful/management/client_content_type_methods_factory.rb +8 -2
- data/lib/contentful/management/client_editor_interface_methods_factory.rb +12 -6
- data/lib/contentful/management/client_entry_methods_factory.rb +1 -3
- data/lib/contentful/management/client_environment_methods_factory.rb +59 -0
- data/lib/contentful/management/client_organization_methods_factory.rb +1 -1
- data/lib/contentful/management/client_personal_access_tokens_methods_factory.rb +3 -3
- data/lib/contentful/management/client_role_methods_factory.rb +8 -0
- data/lib/contentful/management/client_snapshot_methods_factory.rb +8 -6
- data/lib/contentful/management/client_space_methods_factory.rb +2 -6
- data/lib/contentful/management/client_upload_methods_factory.rb +8 -0
- data/lib/contentful/management/client_user_methods_factory.rb +1 -1
- data/lib/contentful/management/client_webhook_call_methods_factory.rb +11 -6
- data/lib/contentful/management/client_webhook_health_methods_factory.rb +2 -2
- data/lib/contentful/management/client_webhook_methods_factory.rb +8 -0
- data/lib/contentful/management/content_type.rb +9 -7
- data/lib/contentful/management/content_type_editor_interface_methods_factory.rb +7 -3
- data/lib/contentful/management/content_type_entry_methods_factory.rb +2 -2
- data/lib/contentful/management/content_type_snapshot_methods_factory.rb +16 -2
- data/lib/contentful/management/dynamic_entry.rb +1 -1
- data/lib/contentful/management/editor_interface.rb +14 -6
- data/lib/contentful/management/entry.rb +12 -10
- data/lib/contentful/management/entry_association_methods_factory.rb +2 -2
- data/lib/contentful/management/environment.rb +138 -0
- data/lib/contentful/management/environment_asset_methods_factory.rb +11 -0
- data/lib/contentful/management/environment_association_methods_factory.rb +42 -0
- data/lib/contentful/management/environment_content_type_methods_factory.rb +11 -0
- data/lib/contentful/management/environment_editor_interface_methods_factory.rb +15 -0
- data/lib/contentful/management/environment_entry_methods_factory.rb +11 -0
- data/lib/contentful/management/environment_locale_methods_factory.rb +11 -0
- data/lib/contentful/management/environment_ui_extension_methods_factory.rb +11 -0
- data/lib/contentful/management/field.rb +3 -3
- data/lib/contentful/management/file.rb +2 -2
- data/lib/contentful/management/link.rb +21 -7
- data/lib/contentful/management/locale.rb +4 -2
- data/lib/contentful/management/organization.rb +1 -1
- data/lib/contentful/management/personal_access_token.rb +2 -2
- data/lib/contentful/management/resource.rb +34 -13
- data/lib/contentful/management/resource/all_published.rb +2 -2
- data/lib/contentful/management/resource/archiver.rb +12 -2
- data/lib/contentful/management/resource/environment_aware.rb +13 -0
- data/lib/contentful/management/resource/publisher.rb +12 -2
- data/lib/contentful/management/resource/refresher.rb +1 -1
- data/lib/contentful/management/resource_builder.rb +16 -14
- data/lib/contentful/management/response.rb +1 -1
- data/lib/contentful/management/role.rb +29 -2
- data/lib/contentful/management/snapshot.rb +13 -7
- data/lib/contentful/management/space.rb +14 -93
- data/lib/contentful/management/space_association_methods_factory.rb +1 -1
- data/lib/contentful/management/{space_locale_methods_factory.rb → space_environment_methods_factory.rb} +2 -6
- data/lib/contentful/management/space_membership.rb +3 -3
- data/lib/contentful/management/ui_extension.rb +4 -2
- data/lib/contentful/management/upload.rb +24 -1
- data/lib/contentful/management/user.rb +4 -4
- data/lib/contentful/management/validation.rb +5 -5
- data/lib/contentful/management/version.rb +1 -1
- data/lib/contentful/management/webhook.rb +26 -3
- data/lib/contentful/management/webhook_call.rb +8 -8
- data/lib/contentful/management/webhook_health.rb +2 -2
- data/spec/fixtures/vcr_cassettes/asset/143_assets_next_page.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/all.yml +1 -1
- data/spec/fixtures/vcr_cassettes/asset/archive.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/archive_published.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/archived_false.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/archived_true.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/create.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/create_with_already_used_id.yml +1 -1
- data/spec/fixtures/vcr_cassettes/asset/create_with_custom_id.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/create_with_locale.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/destroy.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/destroy_published.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/find.yml +1 -1
- data/spec/fixtures/vcr_cassettes/asset/find_not_found.yml +1 -1
- data/spec/fixtures/vcr_cassettes/asset/limited_assets_next_page.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/locale.yml +1 -1
- data/spec/fixtures/vcr_cassettes/asset/process.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/publish.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/publish_after_create.yml +3 -3
- data/spec/fixtures/vcr_cassettes/asset/publish_already_published.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/published_false.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/published_true.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/reload.yml +4 -4
- data/spec/fixtures/vcr_cassettes/asset/reload_with_fields.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/save_update.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/select_operator.yml +1 -1
- data/spec/fixtures/vcr_cassettes/asset/set_locale.yml +1 -1
- data/spec/fixtures/vcr_cassettes/asset/unarchive.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/unarchive_already_unarchive.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/unarchive_already_unarchived.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/unpublish.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/unpublish_already_unpublished.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/update_file.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/update_to_specified_locale.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/update_with_default_locale_without_file.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/activate.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/activate_with_invalid_version.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/activated_false.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/activated_true.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/all.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/all_public.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/create.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/create_content_type_with_id.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/create_with_Array_field.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/create_with_Boolean_field.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/create_with_Date_field.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/create_with_Integer_field.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/create_with_Link_field.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/create_with_Location_field.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/create_with_Number_field.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/create_with_Object_field.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/create_with_Symbol_field.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/create_with_Text_field.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/deactivate.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/deactivate_already_deactivated.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/deactivate_with_entries.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/deactivate_with_version_change.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/destroy.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/destroy_activated.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/entry/all.yml +4 -4
- data/spec/fixtures/vcr_cassettes/content_type/entry/create.yml +4 -4
- data/spec/fixtures/vcr_cassettes/content_type/entry/create_only_with_localized_fields.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/entry/create_to_single_locale_only_with_localized_fields.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/entry/create_with_camel_case_id_to_multiple_locales.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/entry/create_with_entries.yml +3 -3
- data/spec/fixtures/vcr_cassettes/content_type/entry/create_with_entries_for_multiple_locales.yml +9 -9
- data/spec/fixtures/vcr_cassettes/content_type/entry/create_with_multiple_locales.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/entry/update_only_with_localized_fields.yml +3 -3
- data/spec/fixtures/vcr_cassettes/content_type/fields/add.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/fields/create.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/fields/create_array_types.yml +3 -3
- data/spec/fixtures/vcr_cassettes/content_type/fields/create_array_with_params.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/fields/create_with_params.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/fields/destroy.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/fields/update_field.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/find.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/find_not_found.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/issue_79.yml +3 -3
- data/spec/fixtures/vcr_cassettes/content_type/omitted_field.yml +4 -4
- data/spec/fixtures/vcr_cassettes/content_type/reload.yml +4 -4
- data/spec/fixtures/vcr_cassettes/content_type/save_new.yml +3 -3
- data/spec/fixtures/vcr_cassettes/content_type/save_updated.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/save_with_added_field.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/update.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/update_change_field_name.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/update_remove_field.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/update_with_fields.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/update_with_one_new_field.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/validation/in.yml +3 -3
- data/spec/fixtures/vcr_cassettes/content_type/validation/in_add.yml +3 -3
- data/spec/fixtures/vcr_cassettes/content_type/validation/in_update.yml +3 -3
- data/spec/fixtures/vcr_cassettes/content_type/validation/link_content_type.yml +3 -3
- data/spec/fixtures/vcr_cassettes/content_type/validation/link_field.yml +3 -3
- data/spec/fixtures/vcr_cassettes/content_type/validation/link_mimetype_group.yml +3 -3
- data/spec/fixtures/vcr_cassettes/content_type/validation/multiple_add.yml +3 -3
- data/spec/fixtures/vcr_cassettes/content_type/validation/present.yml +3 -3
- data/spec/fixtures/vcr_cassettes/content_type/validation/range.yml +3 -3
- data/spec/fixtures/vcr_cassettes/content_type/validation/range_update.yml +3 -3
- data/spec/fixtures/vcr_cassettes/content_type/validation/regexp.yml +3 -3
- data/spec/fixtures/vcr_cassettes/content_type/validation/size.yml +3 -3
- data/spec/fixtures/vcr_cassettes/content_type/validation/unique.yml +3 -3
- data/spec/fixtures/vcr_cassettes/editor_interfaces/default_for_space.yml +1 -1
- data/spec/fixtures/vcr_cassettes/editor_interfaces/update.yml +3 -3
- data/spec/fixtures/vcr_cassettes/entry/all.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/archive.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/archive_published.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/archived_false.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/archived_true.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/content_type_entires.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/create.yml +4 -4
- data/spec/fixtures/vcr_cassettes/entry/create_with_asset.yml +3 -3
- data/spec/fixtures/vcr_cassettes/entry/create_with_assets.yml +3 -3
- data/spec/fixtures/vcr_cassettes/entry/create_with_custom_id.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/create_with_entries.yml +3 -3
- data/spec/fixtures/vcr_cassettes/entry/create_with_entry.yml +3 -3
- data/spec/fixtures/vcr_cassettes/entry/create_with_just_id.yml +4 -4
- data/spec/fixtures/vcr_cassettes/entry/create_with_location.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/create_with_specified_locale.yml +3 -3
- data/spec/fixtures/vcr_cassettes/entry/create_with_symbols.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/destory_published.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/destroy.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/fallback_undefined.yml +3 -3
- data/spec/fixtures/vcr_cassettes/entry/find-with-null-symbols.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/find.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/find_not_found.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/issue_61_1.yml +6 -6
- data/spec/fixtures/vcr_cassettes/entry/issue_61_2.yml +6 -6
- data/spec/fixtures/vcr_cassettes/entry/issue_61_3.yml +6 -6
- data/spec/fixtures/vcr_cassettes/entry/issue_61_4.yml +6 -6
- data/spec/fixtures/vcr_cassettes/entry/issue_61_5.yml +305 -198
- data/spec/fixtures/vcr_cassettes/entry/issue_61_6.yml +5 -5
- data/spec/fixtures/vcr_cassettes/entry/issue_61_7.yml +6 -6
- data/spec/fixtures/vcr_cassettes/entry/issue_61_8.yml +6 -6
- data/spec/fixtures/vcr_cassettes/entry/issue_61_spaces.yml +143 -188
- data/spec/fixtures/vcr_cassettes/entry/issue_70.yml +3 -3
- data/spec/fixtures/vcr_cassettes/entry/issue_73.yml +4 -4
- data/spec/fixtures/vcr_cassettes/entry/issue_91.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/limited_entries.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/locales/fallback_to_default_locale.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/locales/retrieve_localized.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/locales/simple_assignments_use_default_locale.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/locales/simple_assignments_use_specified_locale.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/publish.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/publish_already_published.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/published_false.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/published_true.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/reload.yml +6 -6
- data/spec/fixtures/vcr_cassettes/entry/save_update.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/search_filter/equality_operator.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/search_filter/exclusion_operator.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/search_filter/full_search.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/search_filter/full_search_match_operator.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/search_filter/including_linked_entries.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/search_filter/inclusion_operator.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/search_filter/inequality_operator.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/search_filter/location_search_near_operator.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/search_filter/location_search_within_operator.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/search_filter/matching_array_fields.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/search_filter/order_sys_createdAt.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/search_filter/order_sys_updatedAt.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/search_filter/range_operators_greater_than_or_equal.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/search_filter/range_operators_less.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/search_filter/reverse_order_sys_updatedAt.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/select_operator.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/service_unavailable.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/too_many_requests.yml +5 -5
- data/spec/fixtures/vcr_cassettes/entry/too_many_requests_retry.yml +6 -6
- data/spec/fixtures/vcr_cassettes/entry/unarchive.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/unarchive_already_unarchived.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/unpublish.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/unpublish_already_unpublished.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/update.yml +4 -4
- data/spec/fixtures/vcr_cassettes/entry/update_bool_field.yml +4 -4
- data/spec/fixtures/vcr_cassettes/entry/update_unlocalized_field.yml +3 -3
- data/spec/fixtures/vcr_cassettes/entry/update_with_custom_locale.yml +3 -3
- data/spec/fixtures/vcr_cassettes/environment/all.yml +226 -0
- data/spec/fixtures/vcr_cassettes/environment/create.yml +155 -0
- data/spec/fixtures/vcr_cassettes/environment/destroy.yml +89 -0
- data/spec/fixtures/vcr_cassettes/environment/find.yml +155 -0
- data/spec/fixtures/vcr_cassettes/environment/find_2.yml +155 -0
- data/spec/fixtures/vcr_cassettes/environment/not_found.yml +98 -0
- data/spec/fixtures/vcr_cassettes/locale/all_for_space.yml +1 -1
- data/spec/fixtures/vcr_cassettes/locale/create_for_space.yml +2 -2
- data/spec/fixtures/vcr_cassettes/locale/destroy.yml +5 -5
- data/spec/fixtures/vcr_cassettes/locale/fallback_code.yml +3 -3
- data/spec/fixtures/vcr_cassettes/locale/find.yml +1 -1
- data/spec/fixtures/vcr_cassettes/locale/find_default.yml +1 -1
- data/spec/fixtures/vcr_cassettes/locale/find_for_space_not_found.yml +1 -1
- data/spec/fixtures/vcr_cassettes/locale/find_not_default.yml +1 -1
- data/spec/fixtures/vcr_cassettes/locale/find_not_optional.yml +1 -1
- data/spec/fixtures/vcr_cassettes/locale/find_optional.yml +1 -1
- data/spec/fixtures/vcr_cassettes/locale/reload.yml +3 -3
- data/spec/fixtures/vcr_cassettes/locale/update_both.yml +3 -3
- data/spec/fixtures/vcr_cassettes/locale/update_code.yml +3 -3
- data/spec/fixtures/vcr_cassettes/locale/update_name.yml +3 -3
- data/spec/fixtures/vcr_cassettes/snapshot/all.yml +1 -1
- data/spec/fixtures/vcr_cassettes/snapshot/ct_all.yml +1 -1
- data/spec/fixtures/vcr_cassettes/snapshot/ct_find.yml +1 -1
- data/spec/fixtures/vcr_cassettes/snapshot/ct_find_not_found.yml +1 -1
- data/spec/fixtures/vcr_cassettes/snapshot/find.yml +1 -1
- data/spec/fixtures/vcr_cassettes/snapshot/find_not_found.yml +1 -1
- data/spec/fixtures/vcr_cassettes/snapshot/properties.yml +2 -2
- data/spec/fixtures/vcr_cassettes/ui_extension/all.yml +1 -1
- data/spec/fixtures/vcr_cassettes/ui_extension/create.yml +1 -1
- data/spec/fixtures/vcr_cassettes/ui_extension/delete.yml +3 -3
- data/spec/fixtures/vcr_cassettes/ui_extension/find.yml +1 -1
- data/spec/fixtures/vcr_cassettes/upload/associate_with_asset.yml +3 -3
- data/spec/lib/contentful/management/api_key_spec.rb +7 -7
- data/spec/lib/contentful/management/asset_spec.rb +38 -57
- data/spec/lib/contentful/management/client_spec.rb +1 -1
- data/spec/lib/contentful/management/content_type_spec.rb +78 -78
- data/spec/lib/contentful/management/editor_interface_spec.rb +4 -4
- data/spec/lib/contentful/management/entry_spec.rb +104 -114
- data/spec/lib/contentful/management/environment_spec.rb +87 -0
- data/spec/lib/contentful/management/locale_spec.rb +22 -22
- data/spec/lib/contentful/management/role_spec.rb +11 -11
- data/spec/lib/contentful/management/snapshot_spec.rb +27 -27
- data/spec/lib/contentful/management/space_membership_spec.rb +6 -7
- data/spec/lib/contentful/management/space_spec.rb +0 -282
- data/spec/lib/contentful/management/ui_extension_spec.rb +8 -8
- data/spec/lib/contentful/management/upload_spec.rb +9 -9
- data/spec/lib/contentful/management/webhook_calls_spec.rb +6 -6
- data/spec/lib/contentful/management/webhook_health_spec.rb +3 -3
- data/spec/lib/contentful/management/webhook_spec.rb +14 -12
- metadata +28 -14
- data/lib/contentful/management/space_asset_methods_factory.rb +0 -13
- data/lib/contentful/management/space_association_all_published_method_factory.rb +0 -12
- data/lib/contentful/management/space_content_type_methods_factory.rb +0 -13
- data/lib/contentful/management/space_editor_interface_methods_factory.rb +0 -21
- data/lib/contentful/management/space_entry_methods_factory.rb +0 -21
- data/lib/contentful/management/space_ui_extension_methods_factory.rb +0 -15
- data/spec/fixtures/vcr_cassettes/asset/all_public.yml +0 -112
- 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
|
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 =
|
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(
|
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(
|
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 =
|
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 =
|
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 =
|
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 =
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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
|
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
|
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
|
300
|
-
entry_att =
|
301
|
-
entry =
|
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
|
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(
|
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
|
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(
|
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
|
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
|
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 =
|
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 =
|
445
|
-
ct =
|
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 =
|
458
|
-
ct =
|
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 =
|
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
|
481
|
-
entry_att = subject.find(
|
482
|
-
entry = subject.find(
|
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(
|
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
|
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(
|
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 =
|
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 =
|
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(
|
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
|
-
|
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 =
|
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 =
|
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 =
|
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 =
|
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 =
|
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 =
|
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 =
|
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 =
|
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 =
|
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 =
|
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 =
|
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 =
|
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 =
|
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 =
|
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 =
|
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 =
|
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 =
|
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
|
-
|
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
|
-
|
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
|
-
|
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 =
|
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 =
|
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
|
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
|
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
|
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 =
|
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
|
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 =
|
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
|
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 =
|
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
|
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 =
|
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:
|
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 =
|
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 =
|
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 =
|
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 =
|
1082
|
+
expected_entry = client.entries('u2viwgfeal0o', 'master').find('2GmtCwDBcIu4giMgQGIIcq')
|
1093
1083
|
|
1094
1084
|
expect(expected_entry.value).to eq nil
|
1095
1085
|
|