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
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://api.contentful.com/spaces/facgnwwgj5fe/extensions
|
5
|
+
uri: https://api.contentful.com/spaces/facgnwwgj5fe/environments/master/extensions
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: '{"extension":{"name":"test extension","fieldTypes":[{"type":"Symbol"},{"type":"Text"}],"srcdoc":"<!doctype
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.contentful.com/spaces/facgnwwgj5fe/extensions/2rf6QdckyoECCsQeE6gIOg
|
5
|
+
uri: https://api.contentful.com/spaces/facgnwwgj5fe/environments/master/extensions/2rf6QdckyoECCsQeE6gIOg
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -125,7 +125,7 @@ http_interactions:
|
|
125
125
|
recorded_at: Tue, 05 Sep 2017 12:18:10 GMT
|
126
126
|
- request:
|
127
127
|
method: delete
|
128
|
-
uri: https://api.contentful.com/spaces/facgnwwgj5fe/extensions/2rf6QdckyoECCsQeE6gIOg
|
128
|
+
uri: https://api.contentful.com/spaces/facgnwwgj5fe/environments/master/extensions/2rf6QdckyoECCsQeE6gIOg
|
129
129
|
body:
|
130
130
|
encoding: US-ASCII
|
131
131
|
string: ''
|
@@ -201,7 +201,7 @@ http_interactions:
|
|
201
201
|
recorded_at: Tue, 05 Sep 2017 12:18:11 GMT
|
202
202
|
- request:
|
203
203
|
method: get
|
204
|
-
uri: https://api.contentful.com/spaces/facgnwwgj5fe/extensions/2rf6QdckyoECCsQeE6gIOg
|
204
|
+
uri: https://api.contentful.com/spaces/facgnwwgj5fe/environments/master/extensions/2rf6QdckyoECCsQeE6gIOg
|
205
205
|
body:
|
206
206
|
encoding: US-ASCII
|
207
207
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.contentful.com/spaces/arqlnkt58eul/extensions/2ZJduY1pKEma6G8Y2ImqYU
|
5
|
+
uri: https://api.contentful.com/spaces/arqlnkt58eul/environments/master/extensions/2ZJduY1pKEma6G8Y2ImqYU
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -84,7 +84,7 @@ http_interactions:
|
|
84
84
|
recorded_at: Tue, 25 Apr 2017 14:00:57 GMT
|
85
85
|
- request:
|
86
86
|
method: post
|
87
|
-
uri: https://api.contentful.com/spaces/facgnwwgj5fe/assets
|
87
|
+
uri: https://api.contentful.com/spaces/facgnwwgj5fe/environments/master/assets
|
88
88
|
body:
|
89
89
|
encoding: UTF-8
|
90
90
|
string: '{"fields":{"title":{"en-US":"pixel"},"description":{"en-US":null},"file":{"en-US":{"contentType":"image/jpeg","fileName":"pixel","uploadFrom":{"sys":{"type":"Link","linkType":"Upload","id":"3oMzfmxT3R1OKI3KMSIN5D"}}}}}}'
|
@@ -213,7 +213,7 @@ http_interactions:
|
|
213
213
|
recorded_at: Tue, 25 Apr 2017 14:01:02 GMT
|
214
214
|
- request:
|
215
215
|
method: put
|
216
|
-
uri: https://api.contentful.com/spaces/facgnwwgj5fe/assets/3d7PVhU4w8kEWSy0WMCwoC/files/en-US/process
|
216
|
+
uri: https://api.contentful.com/spaces/facgnwwgj5fe/environments/master/assets/3d7PVhU4w8kEWSy0WMCwoC/files/en-US/process
|
217
217
|
body:
|
218
218
|
encoding: US-ASCII
|
219
219
|
string: ''
|
@@ -293,7 +293,7 @@ http_interactions:
|
|
293
293
|
recorded_at: Tue, 25 Apr 2017 14:01:03 GMT
|
294
294
|
- request:
|
295
295
|
method: get
|
296
|
-
uri: https://api.contentful.com/spaces/facgnwwgj5fe/assets/3d7PVhU4w8kEWSy0WMCwoC
|
296
|
+
uri: https://api.contentful.com/spaces/facgnwwgj5fe/environments/master/assets/3d7PVhU4w8kEWSy0WMCwoC
|
297
297
|
body:
|
298
298
|
encoding: US-ASCII
|
299
299
|
string: ''
|
@@ -11,17 +11,17 @@ module Contentful
|
|
11
11
|
|
12
12
|
let!(:client) { Client.new(token) }
|
13
13
|
|
14
|
-
subject { client.api_keys }
|
14
|
+
subject { client.api_keys(space_id) }
|
15
15
|
|
16
16
|
describe '.all' do
|
17
17
|
it 'class method also works' do
|
18
18
|
vcr('api_key/all_for_space') { expect(Contentful::Management::ApiKey.all(client, space_id)).to be_kind_of Contentful::Management::Array }
|
19
19
|
end
|
20
20
|
it 'returns a Contentful::Array' do
|
21
|
-
vcr('api_key/all_for_space') { expect(subject.all
|
21
|
+
vcr('api_key/all_for_space') { expect(subject.all).to be_kind_of Contentful::Management::Array }
|
22
22
|
end
|
23
23
|
it 'builds a Contentful::Management::ApiKey object' do
|
24
|
-
vcr('api_key/all_for_space') { expect(subject.all
|
24
|
+
vcr('api_key/all_for_space') { expect(subject.all.first).to be_kind_of Contentful::Management::ApiKey }
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -30,18 +30,18 @@ module Contentful
|
|
30
30
|
vcr('api_key/find') { expect(Contentful::Management::ApiKey.find(client, space_id, api_key_id)).to be_kind_of Contentful::Management::ApiKey }
|
31
31
|
end
|
32
32
|
it 'returns a Contentful::Management::ApiKey' do
|
33
|
-
vcr('api_key/find') { expect(subject.find(
|
33
|
+
vcr('api_key/find') { expect(subject.find(api_key_id)).to be_kind_of Contentful::Management::ApiKey }
|
34
34
|
end
|
35
35
|
it 'returns the api_key for a given key' do
|
36
36
|
vcr('api_key/find') do
|
37
|
-
api_key = subject.find(
|
37
|
+
api_key = subject.find(api_key_id)
|
38
38
|
expect(api_key.id).to eql api_key_id
|
39
39
|
expect(api_key.access_token).to eql '833ea085204398499ea424c8ad832f1ae1cac4d64e2cc56db774aff87ef20b33'
|
40
40
|
end
|
41
41
|
end
|
42
42
|
it 'returns an error when api_key does not exists' do
|
43
43
|
vcr('api_key/find_for_space_not_found') do
|
44
|
-
result = subject.find(
|
44
|
+
result = subject.find('not_exist')
|
45
45
|
expect(result).to be_kind_of Contentful::Management::NotFound
|
46
46
|
end
|
47
47
|
end
|
@@ -50,7 +50,7 @@ module Contentful
|
|
50
50
|
describe '.create' do
|
51
51
|
it 'create api_keys for space' do
|
52
52
|
vcr('api_key/create_for_space') do
|
53
|
-
api_key = subject.create(
|
53
|
+
api_key = subject.create(name: 'testLocalCreate', description: 'bg')
|
54
54
|
expect(api_key.name).to eql 'testLocalCreate'
|
55
55
|
end
|
56
56
|
end
|
@@ -13,21 +13,21 @@ module Contentful
|
|
13
13
|
|
14
14
|
let!(:client) { Client.new(token) }
|
15
15
|
|
16
|
-
subject { client.assets }
|
16
|
+
subject { client.assets(space_id, 'master') }
|
17
17
|
|
18
18
|
describe '.all' do
|
19
19
|
it 'class method also works' do
|
20
|
-
vcr('asset/all') { expect(Contentful::Management::Asset.all(client, space_id)).to be_kind_of Contentful::Management::Array }
|
20
|
+
vcr('asset/all') { expect(Contentful::Management::Asset.all(client, space_id, 'master')).to be_kind_of Contentful::Management::Array }
|
21
21
|
end
|
22
22
|
it 'returns a Contentful::Array' do
|
23
|
-
vcr('asset/all') { expect(subject.all
|
23
|
+
vcr('asset/all') { expect(subject.all).to be_kind_of Contentful::Management::Array }
|
24
24
|
end
|
25
25
|
it 'builds a Contentful::Management::Asset object' do
|
26
|
-
vcr('asset/all') { expect(subject.all
|
26
|
+
vcr('asset/all') { expect(subject.all.first).to be_kind_of Contentful::Management::Asset }
|
27
27
|
end
|
28
28
|
it 'return limited number of assets with next_page' do
|
29
29
|
vcr('asset/limited_assets_next_page') do
|
30
|
-
assets =
|
30
|
+
assets = described_class.all(client, 'bfsvtul0c41g', 'master', limit: 20, skip: 2)
|
31
31
|
expect(assets).to be_kind_of Contentful::Management::Array
|
32
32
|
expect(assets.limit).to eq 20
|
33
33
|
expect(assets.skip).to eq 2
|
@@ -36,45 +36,28 @@ module Contentful
|
|
36
36
|
end
|
37
37
|
it 'supports select operator' do
|
38
38
|
vcr('asset/select_operator') do
|
39
|
-
nyancat =
|
39
|
+
nyancat = described_class.all(client, 'cfexampleapi', 'master', 'sys.id' => 'nyancat', select: 'fields.title').first
|
40
40
|
expect(nyancat.fields).to eq({ title: 'Nyan Cat' })
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
-
describe '.all_published' do
|
46
|
-
let!(:space_id) { 'bjwq7b86vgmm' }
|
47
|
-
before :each do
|
48
|
-
expect_any_instance_of(Contentful::Management::Asset.client_association_class).to receive(:warn)
|
49
|
-
end
|
50
|
-
|
51
|
-
it 'class method also works' do
|
52
|
-
vcr('asset/all_public') { expect(Contentful::Management::Asset.all_published(client, space_id)).to be_kind_of Contentful::Management::Array }
|
53
|
-
end
|
54
|
-
it 'returns a Contentful::Array' do
|
55
|
-
vcr('asset/all_public') { expect(subject.all_published(space_id)).to be_kind_of Contentful::Management::Array }
|
56
|
-
end
|
57
|
-
it 'builds a Contentful::Management::Asset object' do
|
58
|
-
vcr('asset/all_public') { expect(subject.all_published(space_id).first).to be_kind_of Contentful::Management::Asset }
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
45
|
describe '.find' do
|
63
46
|
it 'class method also works' do
|
64
|
-
vcr('asset/find') { expect(Contentful::Management::Asset.find(client, space_id, asset_id)).to be_kind_of Contentful::Management::Asset }
|
47
|
+
vcr('asset/find') { expect(Contentful::Management::Asset.find(client, space_id, 'master', asset_id)).to be_kind_of Contentful::Management::Asset }
|
65
48
|
end
|
66
49
|
it 'returns a Contentful::Management::Asset' do
|
67
|
-
vcr('asset/find') { expect(subject.find(
|
50
|
+
vcr('asset/find') { expect(subject.find(asset_id)).to be_kind_of Contentful::Management::Asset }
|
68
51
|
end
|
69
52
|
it 'returns the asset for a given key' do
|
70
53
|
vcr('asset/find') do
|
71
|
-
asset = subject.find(
|
54
|
+
asset = subject.find(asset_id)
|
72
55
|
expect(asset.id).to eql asset_id
|
73
56
|
end
|
74
57
|
end
|
75
58
|
it 'returns an error when content_type does not exists' do
|
76
59
|
vcr('asset/find_not_found') do
|
77
|
-
result = subject.find(
|
60
|
+
result = subject.find('not_exist')
|
78
61
|
expect(result).to be_kind_of Contentful::Management::NotFound
|
79
62
|
message = [
|
80
63
|
"HTTP status code: 404 Not Found",
|
@@ -89,7 +72,7 @@ module Contentful
|
|
89
72
|
describe '#destroy' do
|
90
73
|
it 'returns Contentful::BadRequest error when content type is published' do
|
91
74
|
vcr('asset/destroy_published') do
|
92
|
-
result = subject.find(
|
75
|
+
result = subject.find('r7o2iuDeSc4UmioOuoKq6').destroy
|
93
76
|
expect(result).to be_kind_of Contentful::Management::BadRequest
|
94
77
|
message = [
|
95
78
|
"HTTP status code: 400 Bad Request",
|
@@ -100,7 +83,7 @@ module Contentful
|
|
100
83
|
end
|
101
84
|
it 'returns true when asset is not published' do
|
102
85
|
vcr('asset/destroy') do
|
103
|
-
result = subject.find(
|
86
|
+
result = subject.find('r7o2iuDeSc4UmioOuoKq6').destroy
|
104
87
|
expect(result).to eq true
|
105
88
|
end
|
106
89
|
end
|
@@ -109,7 +92,7 @@ module Contentful
|
|
109
92
|
describe '#unpublish' do
|
110
93
|
it 'unpublish' do
|
111
94
|
vcr('asset/unpublish') do
|
112
|
-
asset = subject.find(
|
95
|
+
asset = subject.find(asset_id_2)
|
113
96
|
initial_version = asset.sys[:version]
|
114
97
|
asset.unpublish
|
115
98
|
expect(asset).to be_kind_of Contentful::Management::Asset
|
@@ -119,7 +102,7 @@ module Contentful
|
|
119
102
|
|
120
103
|
it 'returns BadRequest error when already unpublished' do
|
121
104
|
vcr('asset/unpublish_already_unpublished') do
|
122
|
-
result = subject.find(
|
105
|
+
result = subject.find(asset_id_2).unpublish
|
123
106
|
expect(result).to be_kind_of Contentful::Management::BadRequest
|
124
107
|
message = [
|
125
108
|
"HTTP status code: 400 Bad Request",
|
@@ -139,7 +122,6 @@ module Contentful
|
|
139
122
|
file.properties[:upload] = 'https://upload.wikimedia.org/wikipedia/commons/c/c7/Gasometer_Berlin_Sch%C3%B6neberg_2011.jpg'
|
140
123
|
|
141
124
|
asset = subject.create(
|
142
|
-
space_id,
|
143
125
|
title: 'titlebyCreateAPI',
|
144
126
|
description: 'descByAPI',
|
145
127
|
file: file
|
@@ -152,7 +134,7 @@ module Contentful
|
|
152
134
|
|
153
135
|
it 'returns Contentful::Management::Asset' do
|
154
136
|
vcr('asset/publish') do
|
155
|
-
asset = subject.find(
|
137
|
+
asset = subject.find(asset_id_2)
|
156
138
|
initial_version = asset.sys[:version]
|
157
139
|
asset.publish
|
158
140
|
expect(asset).to be_kind_of Contentful::Management::Asset
|
@@ -161,7 +143,7 @@ module Contentful
|
|
161
143
|
end
|
162
144
|
it 'returns BadRequest error when already published' do
|
163
145
|
vcr('asset/publish_already_published') do
|
164
|
-
asset = subject.find(
|
146
|
+
asset = subject.find(asset_id_2)
|
165
147
|
asset.sys[:version] = -1
|
166
148
|
result = asset.publish
|
167
149
|
expect(result).to be_kind_of Contentful::Management::Conflict
|
@@ -172,14 +154,14 @@ module Contentful
|
|
172
154
|
describe '#published?' do
|
173
155
|
it 'returns true if asset is published' do
|
174
156
|
vcr('asset/published_true') do
|
175
|
-
asset = subject.find(
|
157
|
+
asset = subject.find(asset_id)
|
176
158
|
asset.publish
|
177
159
|
expect(asset.published?).to be_truthy
|
178
160
|
end
|
179
161
|
end
|
180
162
|
it 'returns false if asset is not published' do
|
181
163
|
vcr('asset/published_false') do
|
182
|
-
asset = subject.find(
|
164
|
+
asset = subject.find(asset_id)
|
183
165
|
asset.unpublish
|
184
166
|
expect(asset.published?).to be_falsey
|
185
167
|
end
|
@@ -189,7 +171,7 @@ module Contentful
|
|
189
171
|
describe '#unarchive' do
|
190
172
|
it 'unarchive the asset' do
|
191
173
|
vcr('asset/unarchive') do
|
192
|
-
asset = subject.find(
|
174
|
+
asset = subject.find(asset_id_2)
|
193
175
|
initial_version = asset.sys[:version]
|
194
176
|
asset.unarchive
|
195
177
|
expect(asset).to be_kind_of Contentful::Management::Asset
|
@@ -199,7 +181,7 @@ module Contentful
|
|
199
181
|
|
200
182
|
it 'returns BadRequest error when already unpublished' do
|
201
183
|
vcr('asset/unarchive_already_unarchived') do
|
202
|
-
result = subject.find(
|
184
|
+
result = subject.find(asset_id_2).unarchive
|
203
185
|
expect(result).to be_kind_of Contentful::Management::BadRequest
|
204
186
|
end
|
205
187
|
end
|
@@ -208,14 +190,14 @@ module Contentful
|
|
208
190
|
describe '#archive' do
|
209
191
|
it 'returns error when archive published asset' do
|
210
192
|
vcr('asset/archive_published') do
|
211
|
-
asset = subject.find(
|
193
|
+
asset = subject.find(asset_id_2).archive
|
212
194
|
expect(asset).to be_kind_of Contentful::Management::BadRequest
|
213
195
|
end
|
214
196
|
end
|
215
197
|
|
216
198
|
it ' archive unpublished asset' do
|
217
199
|
vcr('asset/archive') do
|
218
|
-
asset = subject.find(
|
200
|
+
asset = subject.find(asset_id_2)
|
219
201
|
initial_version = asset.sys[:version]
|
220
202
|
asset.archive
|
221
203
|
expect(asset).to be_kind_of Contentful::Management::Asset
|
@@ -225,7 +207,7 @@ module Contentful
|
|
225
207
|
|
226
208
|
it 'returns BadRequest error when already unpublished' do
|
227
209
|
vcr('asset/unarchive_already_unarchive') do
|
228
|
-
result = subject.find(
|
210
|
+
result = subject.find(asset_id_2).unarchive
|
229
211
|
expect(result).to be_kind_of Contentful::Management::BadRequest
|
230
212
|
end
|
231
213
|
end
|
@@ -234,14 +216,14 @@ module Contentful
|
|
234
216
|
describe '#archived?' do
|
235
217
|
it 'returns true if asset is archive' do
|
236
218
|
vcr('asset/archived_true') do
|
237
|
-
asset = subject.find(
|
219
|
+
asset = subject.find(asset_id_2)
|
238
220
|
asset.archive
|
239
221
|
expect(asset.archived?).to be_truthy
|
240
222
|
end
|
241
223
|
end
|
242
224
|
it 'returns false if asset is not archive' do
|
243
225
|
vcr('asset/archived_false') do
|
244
|
-
asset = subject.find(
|
226
|
+
asset = subject.find(asset_id_2)
|
245
227
|
asset.unarchive
|
246
228
|
expect(asset.archived?).to be_falsey
|
247
229
|
end
|
@@ -251,7 +233,7 @@ module Contentful
|
|
251
233
|
describe '#locale' do
|
252
234
|
it 'returns default locale' do
|
253
235
|
vcr('asset/locale') do
|
254
|
-
asset = subject.find(
|
236
|
+
asset = subject.find(asset_id_2)
|
255
237
|
expect(asset.locale).to eq asset.default_locale
|
256
238
|
expect(asset.title).to eq 'titlebyCreateAPI'
|
257
239
|
expect(asset.description).to eq 'descByAPI'
|
@@ -260,7 +242,7 @@ module Contentful
|
|
260
242
|
|
261
243
|
it 'set locale to given asset' do
|
262
244
|
vcr('asset/set_locale') do
|
263
|
-
asset = subject.find(
|
245
|
+
asset = subject.find(asset_id_2)
|
264
246
|
asset.locale = 'pl-Pl'
|
265
247
|
expect(asset.sys[:locale]).to eq 'pl-Pl'
|
266
248
|
end
|
@@ -276,7 +258,6 @@ module Contentful
|
|
276
258
|
file.properties[:upload] = 'https://upload.wikimedia.org/wikipedia/commons/c/c7/Gasometer_Berlin_Sch%C3%B6neberg_2011.jpg'
|
277
259
|
|
278
260
|
asset = subject.create(
|
279
|
-
space_id,
|
280
261
|
title: 'titlebyCreateAPI',
|
281
262
|
description: 'descByAPI',
|
282
263
|
file: file
|
@@ -294,8 +275,10 @@ module Contentful
|
|
294
275
|
file.properties[:fileName] = 'pic1.jpg'
|
295
276
|
file.properties[:upload] = 'https://upload.wikimedia.org/wikipedia/commons/c/c7/Gasometer_Berlin_Sch%C3%B6neberg_2011.jpg'
|
296
277
|
|
297
|
-
asset =
|
278
|
+
asset = described_class.create(
|
279
|
+
client,
|
298
280
|
'bfsvtul0c41g',
|
281
|
+
'master',
|
299
282
|
title: 'Title PL',
|
300
283
|
description: 'Description PL',
|
301
284
|
file: file,
|
@@ -315,7 +298,6 @@ module Contentful
|
|
315
298
|
file.properties[:upload] = 'http://static.goldenline.pl/firm_logo/082/firm_225106_22f37f_small.jpg'
|
316
299
|
|
317
300
|
asset = subject.create(
|
318
|
-
space_id,
|
319
301
|
id: 'codequest_id_test_custom',
|
320
302
|
title: 'titlebyCreateAPI_custom_id',
|
321
303
|
description: 'descByAPI_custom_id',
|
@@ -336,7 +318,6 @@ module Contentful
|
|
336
318
|
file.properties[:upload] = 'http://static.goldenline.pl/firm_logo/082/firm_225106_22f37f_small.jpg'
|
337
319
|
|
338
320
|
asset = subject.create(
|
339
|
-
space_id,
|
340
321
|
id: 'codequest_id_test_custom_id',
|
341
322
|
title: 'titlebyCreateAPI_custom_id',
|
342
323
|
description: 'descByAPI_custom_id',
|
@@ -350,7 +331,7 @@ module Contentful
|
|
350
331
|
describe '#update' do
|
351
332
|
it 'updates asset with default locale without file' do
|
352
333
|
vcr('asset/update_with_default_locale_without_file') do
|
353
|
-
asset = subject.find(
|
334
|
+
asset = subject.find('4DmT2j54pWY8ocimkEU6qS')
|
354
335
|
asset.update(title: 'Title new', description: 'Description new')
|
355
336
|
expect(asset).to be_kind_of Contentful::Management::Asset
|
356
337
|
expect(asset.title).to eq 'Title new'
|
@@ -366,7 +347,7 @@ module Contentful
|
|
366
347
|
file.properties[:fileName] = 'codequest.jpg'
|
367
348
|
file.properties[:upload] = 'http://static.goldenline.pl/firm_logo/082/firm_225106_22f37f_small.jpg'
|
368
349
|
|
369
|
-
asset = subject.find(
|
350
|
+
asset = subject.find('4DmT2j54pWY8ocimkEU6qS')
|
370
351
|
asset.update(file: file)
|
371
352
|
expect(asset).to be_kind_of Contentful::Management::Asset
|
372
353
|
expect(asset.file.properties[:fileName]).to eq 'codequest.jpg'
|
@@ -380,7 +361,7 @@ module Contentful
|
|
380
361
|
file.properties[:fileName] = 'codequest.jpg'
|
381
362
|
file.properties[:upload] = 'http://static.goldenline.pl/firm_logo/082/firm_225106_22f37f_small.jpg'
|
382
363
|
|
383
|
-
asset = subject.find(
|
364
|
+
asset = subject.find('codequest_id_test_custom_id')
|
384
365
|
asset.locale = 'pl'
|
385
366
|
asset.update(title: 'updateTitlePl', description: 'updateDescPl', file: file)
|
386
367
|
expect(asset).to be_kind_of Contentful::Management::Asset
|
@@ -393,7 +374,7 @@ module Contentful
|
|
393
374
|
describe '#save' do
|
394
375
|
it 'updated' do
|
395
376
|
vcr('asset/save_update') do
|
396
|
-
asset = subject.find(
|
377
|
+
asset = subject.find('35Kt2tInIsoauo8sC82q04')
|
397
378
|
asset.fields[:description] = 'Firmowe logo.'
|
398
379
|
asset.save
|
399
380
|
expect(asset).to be_kind_of Contentful::Management::Asset
|
@@ -406,7 +387,7 @@ module Contentful
|
|
406
387
|
let(:space_id) { 'bfsvtul0c41g' }
|
407
388
|
it 'update the current version of the object to the version on the system' do
|
408
389
|
vcr('asset/reload') do
|
409
|
-
asset = subject.find(
|
390
|
+
asset = subject.find('8R4vbQXKbCkcSu26Wy2U0')
|
410
391
|
asset.sys[:version] = 999
|
411
392
|
update_asset = asset.update(title: 'Updated name')
|
412
393
|
expect(update_asset).to be_kind_of Contentful::Management::Conflict
|
@@ -420,7 +401,7 @@ module Contentful
|
|
420
401
|
|
421
402
|
it 'updates fields collection when reloaded' do
|
422
403
|
vcr('asset/reload_with_fields') do
|
423
|
-
asset = subject.find(
|
404
|
+
asset = subject.find('8R4vbQXKbCkcSu26Wy2U0')
|
424
405
|
valid_fields = asset.instance_variable_get(:@fields)
|
425
406
|
asset.instance_variable_set(:@fields, 'changed')
|
426
407
|
asset.reload
|
@@ -454,7 +435,7 @@ module Contentful
|
|
454
435
|
file.properties[:fileName] = 'pic1.jpg'
|
455
436
|
file.properties[:upload] = 'https://upload.wikimedia.org/wikipedia/commons/c/c7/Gasometer_Berlin_Sch%C3%B6neberg_2011.jpg'
|
456
437
|
|
457
|
-
asset = subject.create(
|
438
|
+
asset = subject.create(title: 'Asset title', description: 'Description', file: file)
|
458
439
|
asset.process_file
|
459
440
|
expect(asset).to be_kind_of Contentful::Management::Asset
|
460
441
|
expect(asset.title).to eq 'Asset title'
|
@@ -479,7 +460,7 @@ module Contentful
|
|
479
460
|
describe "Pagination on assets doesn't work without first calling limit - #143" do
|
480
461
|
it 'shouldnt break on next page without parameters on original query' do
|
481
462
|
vcr('asset/143_assets_next_page') do
|
482
|
-
assets =
|
463
|
+
assets = described_class.all(client, 'facgnwwgj5fe', 'master')
|
483
464
|
assets.next_page
|
484
465
|
end
|
485
466
|
end
|