hyrax 1.1.1 → 2.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +5 -4
- data/.eslintrc +1 -1
- data/.fcrepo_wrapper +4 -0
- data/.github/CODE_OF_CONDUCT.md +36 -0
- data/.github/CONTRIBUTING.md +73 -17
- data/.github/PULL_REQUEST_TEMPLATE.md +4 -4
- data/.github/SUPPORT.md +3 -0
- data/.hound.yml +4 -0
- data/.rubocop.yml +57 -21
- data/{.rubocop_todo.yml → .rubocop_fixme.yml} +15 -35
- data/.solr_wrapper +6 -0
- data/.travis.yml +13 -11
- data/Gemfile +3 -3
- data/LICENSE +205 -15
- data/README.md +87 -54
- data/Rakefile +0 -0
- data/app/actors/hyrax/actors/abstract_actor.rb +79 -12
- data/app/actors/hyrax/actors/add_to_work_actor.rb +27 -27
- data/app/actors/hyrax/actors/apply_order_actor.rb +21 -21
- data/app/actors/hyrax/actors/apply_permission_template_actor.rb +25 -0
- data/app/actors/hyrax/actors/assign_representative_actor.rb +8 -6
- data/app/actors/hyrax/actors/attach_members_actor.rb +14 -18
- data/app/actors/hyrax/actors/base_actor.rb +58 -32
- data/app/actors/hyrax/actors/cleanup_file_sets_actor.rb +30 -0
- data/app/actors/hyrax/actors/cleanup_trophies_actor.rb +20 -0
- data/app/actors/hyrax/actors/collections_membership_actor.rb +35 -0
- data/app/actors/hyrax/actors/create_with_files_actor.rb +53 -0
- data/app/actors/hyrax/actors/create_with_remote_files_actor.rb +55 -0
- data/app/actors/hyrax/actors/default_admin_set_actor.rb +48 -0
- data/app/actors/hyrax/actors/environment.rb +21 -0
- data/app/actors/hyrax/actors/featured_work_actor.rb +32 -0
- data/app/actors/hyrax/actors/file_actor.rb +35 -39
- data/app/actors/hyrax/actors/file_set_actor.rb +76 -67
- data/app/actors/hyrax/actors/initialize_workflow_actor.rb +6 -4
- data/app/actors/hyrax/actors/interpret_visibility_actor.rb +60 -49
- data/app/actors/hyrax/actors/model_actor.rb +32 -0
- data/app/actors/hyrax/actors/optimistic_lock_validator.rb +7 -5
- data/app/actors/hyrax/actors/terminator.rb +18 -0
- data/app/actors/hyrax/actors/transactional_request.rb +8 -4
- data/app/assets/javascripts/hyrax.js +13 -6
- data/app/assets/javascripts/hyrax/admin/admin_set/group_participants.es6 +20 -0
- data/app/assets/javascripts/hyrax/admin/admin_set/participants.es6 +13 -2
- data/app/assets/javascripts/hyrax/admin/admin_set/registered_users.es6 +31 -0
- data/app/assets/javascripts/hyrax/admin/admin_set_controls.es6 +16 -8
- data/app/assets/javascripts/hyrax/admin/graphs.es6 +1 -1
- data/app/assets/javascripts/hyrax/app.js +52 -29
- data/app/assets/javascripts/hyrax/authority_select.es6 +31 -37
- data/app/assets/javascripts/hyrax/autocomplete.es6 +13 -7
- data/app/assets/javascripts/hyrax/autocomplete/default.es6 +10 -5
- data/app/assets/javascripts/hyrax/autocomplete/linked_data.es6 +65 -0
- data/app/assets/javascripts/hyrax/batch_select.es6 +11 -0
- data/app/assets/javascripts/hyrax/batch_select_all.js +17 -25
- data/app/assets/javascripts/hyrax/browse_everything.js +11 -7
- data/app/assets/javascripts/hyrax/collections/editor.es6 +11 -0
- data/app/assets/javascripts/hyrax/config.js.erb +3 -0
- data/app/assets/javascripts/hyrax/editor.es6 +49 -2
- data/app/assets/javascripts/hyrax/editor/controlled_vocabulary.es6 +122 -0
- data/app/assets/javascripts/hyrax/{fileupload.js.erb → fileupload.js} +0 -5
- data/app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee +1 -1
- data/app/assets/javascripts/hyrax/notification.es6 +37 -0
- data/app/assets/javascripts/hyrax/notifications.es6 +5 -10
- data/app/assets/javascripts/hyrax/per_page.es6 +15 -0
- data/app/assets/javascripts/hyrax/save_work/save_work_control.es6 +8 -1
- data/app/assets/javascripts/hyrax/save_work/visibility_component.es6 +8 -13
- data/app/assets/javascripts/hyrax/sorting.js +0 -8
- data/app/assets/javascripts/hyrax/tabs.js +3 -1
- data/app/assets/javascripts/hyrax/thumbnail_select.es6 +29 -0
- data/app/assets/javascripts/hyrax/trophy.js +1 -1
- data/app/assets/javascripts/hyrax/uploader.js +1 -5
- data/app/assets/stylesheets/hyrax/_batch-edit.scss +8 -4
- data/app/assets/stylesheets/hyrax/_buttons.scss +9 -7
- data/app/assets/stylesheets/hyrax/_catalog.scss +11 -0
- data/app/assets/stylesheets/hyrax/_collections.scss +6 -19
- data/app/assets/stylesheets/hyrax/_file-listing.scss +5 -25
- data/app/assets/stylesheets/hyrax/_file_manager.scss +1 -0
- data/app/assets/stylesheets/hyrax/_footer.scss +5 -0
- data/app/assets/stylesheets/hyrax/_forms.scss +25 -1
- data/app/assets/stylesheets/hyrax/_header.scss +6 -0
- data/app/assets/stylesheets/hyrax/_hyrax.scss +8 -2
- data/app/assets/stylesheets/hyrax/_positioning.scss +3 -126
- data/app/assets/stylesheets/hyrax/_styles.scss +0 -4
- data/app/assets/stylesheets/hyrax/_users.scss +15 -0
- data/app/assets/stylesheets/hyrax/_variables.scss +1 -0
- data/app/assets/stylesheets/hyrax/_work_editor.scss +17 -0
- data/app/assets/stylesheets/hyrax/controlled_vocabulary.scss +7 -0
- data/app/assets/stylesheets/hyrax/dashboard.scss +247 -0
- data/app/assets/stylesheets/hyrax/sidebar.scss +147 -0
- data/app/assets/stylesheets/typeahead.css +64 -0
- data/app/authorities/qa/authorities/find_works.rb +11 -2
- data/app/controlled_vocabularies/hyrax/controlled_vocabularies/location.rb +13 -0
- data/app/controllers/concerns/hyrax/admin/stats_behavior.rb +2 -2
- data/app/controllers/concerns/hyrax/admin/users_controller_behavior.rb +11 -1
- data/app/controllers/concerns/hyrax/breadcrumbs.rb +1 -1
- data/app/controllers/concerns/hyrax/breadcrumbs_for_collections.rb +1 -1
- data/app/controllers/concerns/hyrax/breadcrumbs_for_works.rb +26 -14
- data/app/controllers/concerns/hyrax/collections.rb +4 -0
- data/{lib → app/controllers/concerns}/hyrax/collections/accepts_batches.rb +1 -1
- data/app/controllers/concerns/hyrax/collections_controller_behavior.rb +1 -190
- data/app/controllers/concerns/hyrax/controller.rb +1 -23
- data/app/controllers/concerns/hyrax/embargoes_controller_behavior.rb +38 -0
- data/app/controllers/concerns/hyrax/leases_controller_behavior.rb +37 -0
- data/app/controllers/concerns/hyrax/manages_embargoes.rb +18 -0
- data/app/controllers/concerns/hyrax/parent_container.rb +2 -2
- data/app/controllers/concerns/hyrax/works_controller_behavior.rb +225 -11
- data/app/controllers/hyrax/admin/admin_sets_controller.rb +32 -18
- data/app/controllers/hyrax/admin/appearances_controller.rb +33 -0
- data/app/controllers/hyrax/admin/features_controller.rb +4 -3
- data/app/controllers/hyrax/admin/permission_template_accesses_controller.rb +16 -7
- data/app/controllers/hyrax/admin/users_controller.rb +1 -1
- data/app/controllers/hyrax/admin/workflow_roles_controller.rb +2 -2
- data/app/controllers/hyrax/admin/workflows_controller.rb +10 -11
- data/app/controllers/hyrax/api/zotero_controller.rb +4 -4
- data/app/controllers/hyrax/batch_edits_controller.rb +99 -2
- data/app/controllers/hyrax/batch_uploads_controller.rb +92 -2
- data/app/controllers/hyrax/citations_controller.rb +2 -2
- data/app/controllers/hyrax/collections_controller.rb +26 -0
- data/app/controllers/hyrax/contact_form_controller.rb +42 -1
- data/app/controllers/hyrax/content_blocks_controller.rb +25 -19
- data/app/controllers/hyrax/dashboard/collections_controller.rb +311 -0
- data/app/controllers/hyrax/dashboard/profiles_controller.rb +69 -0
- data/app/controllers/hyrax/dashboard/works_controller.rb +31 -0
- data/app/controllers/hyrax/dashboard_controller.rb +16 -1
- data/app/controllers/hyrax/depositors_controller.rb +41 -1
- data/app/controllers/hyrax/downloads_controller.rb +83 -1
- data/app/controllers/hyrax/embargoes_controller.rb +5 -0
- data/app/controllers/hyrax/featured_work_lists_controller.rb +1 -1
- data/app/controllers/hyrax/file_sets_controller.rb +236 -1
- data/app/controllers/hyrax/fixity_checks_controller.rb +32 -0
- data/app/controllers/hyrax/homepage_controller.rb +47 -1
- data/app/controllers/hyrax/leases_controller.rb +5 -0
- data/app/controllers/hyrax/my/collections_controller.rb +8 -5
- data/app/controllers/hyrax/my/highlights_controller.rb +3 -3
- data/app/controllers/hyrax/my/shares_controller.rb +3 -3
- data/app/controllers/hyrax/my/works_controller.rb +10 -5
- data/app/controllers/hyrax/my_controller.rb +79 -2
- data/app/controllers/hyrax/{mailbox_controller.rb → notifications_controller.rb} +5 -1
- data/app/controllers/hyrax/pages_controller.rb +42 -3
- data/app/controllers/hyrax/permissions_controller.rb +30 -1
- data/app/controllers/hyrax/single_use_links_controller.rb +46 -1
- data/app/controllers/hyrax/single_use_links_viewer_controller.rb +87 -12
- data/app/controllers/hyrax/static_controller.rb +0 -1
- data/app/controllers/hyrax/stats_controller.rb +2 -2
- data/app/controllers/hyrax/transfers_controller.rb +79 -1
- data/app/controllers/hyrax/uploads_controller.rb +12 -1
- data/app/controllers/hyrax/users_controller.rb +67 -1
- data/app/controllers/hyrax/workflow_actions_controller.rb +15 -9
- data/app/forms/hyrax/forms/admin/appearance.rb +139 -0
- data/app/forms/hyrax/forms/admin_set_form.rb +12 -6
- data/app/forms/hyrax/forms/batch_edit_form.rb +22 -21
- data/app/forms/hyrax/forms/collection_form.rb +50 -11
- data/app/forms/hyrax/forms/file_set_edit_form.rb +2 -2
- data/app/forms/hyrax/forms/permission_template_form.rb +2 -8
- data/app/forms/hyrax/forms/work_form.rb +46 -9
- data/app/forms/hyrax/forms/workflow_action_form.rb +2 -1
- data/app/forms/hyrax/forms/workflow_responsibility_form.rb +0 -6
- data/app/helpers/hyrax/ability_helper.rb +2 -2
- data/app/helpers/hyrax/batch_edits_helper.rb +16 -0
- data/app/helpers/hyrax/citations_behaviors/formatters/chicago_formatter.rb +14 -22
- data/app/helpers/hyrax/citations_behaviors/formatters/open_url_formatter.rb +17 -21
- data/app/helpers/hyrax/citations_behaviors/publication_behavior.rb +4 -3
- data/app/helpers/hyrax/citations_behaviors/title_behavior.rb +1 -1
- data/app/helpers/hyrax/collections_helper.rb +12 -4
- data/app/helpers/hyrax/content_block_helper_behavior.rb +5 -41
- data/app/helpers/hyrax/dashboard_helper_behavior.rb +0 -41
- data/app/helpers/hyrax/file_set_helper.rb +2 -0
- data/app/helpers/hyrax/hyrax_helper_behavior.rb +20 -7
- data/app/helpers/hyrax/trophy_helper.rb +5 -3
- data/app/indexers/concerns/hyrax/indexes_basic_metadata.rb +9 -0
- data/app/indexers/concerns/hyrax/indexes_linked_metadata.rb +9 -0
- data/app/indexers/hyrax/admin_set_indexer.rb +0 -1
- data/app/indexers/hyrax/basic_metadata_indexer.rb +57 -0
- data/app/indexers/hyrax/collection_indexer.rb +4 -1
- data/app/indexers/hyrax/collection_with_basic_metadata_indexer.rb +5 -0
- data/app/indexers/hyrax/deep_indexing_service.rb +102 -0
- data/app/indexers/hyrax/file_set_indexer.rb +19 -19
- data/app/indexers/hyrax/work_indexer.rb +7 -6
- data/app/inputs/controlled_vocabulary_input.rb +87 -0
- data/app/inputs/multi_value_select_input.rb +2 -0
- data/app/jobs/attach_files_to_work_job.rb +25 -21
- data/app/jobs/batch_create_job.rb +1 -1
- data/app/jobs/characterize_job.rb +7 -5
- data/app/jobs/create_derivatives_job.rb +1 -1
- data/app/jobs/create_work_job.rb +7 -5
- data/app/jobs/event_job.rb +4 -5
- data/app/jobs/fixity_check_job.rb +63 -0
- data/app/jobs/hyrax/application_job.rb +7 -0
- data/app/jobs/hyrax/grant_edit_job.rb +14 -0
- data/app/jobs/hyrax/grant_edit_to_members_job.rb +24 -0
- data/app/jobs/hyrax/grant_read_job.rb +14 -0
- data/app/jobs/hyrax/grant_read_to_members_job.rb +24 -0
- data/app/jobs/hyrax/revoke_edit_from_members_job.rb +23 -0
- data/app/jobs/hyrax/revoke_edit_job.rb +14 -0
- data/app/jobs/import_export_job.rb +31 -0
- data/app/jobs/import_url_job.rb +27 -23
- data/app/jobs/ingest_job.rb +18 -0
- data/app/jobs/ingest_local_file_job.rb +1 -1
- data/app/jobs/inherit_permissions_job.rb +1 -1
- data/app/jobs/resolrize_job.rb +1 -1
- data/app/jobs/visibility_copy_job.rb +20 -11
- data/app/models/admin_set.rb +109 -3
- data/app/models/batch_upload_item.rb +3 -1
- data/app/models/checksum_audit_log.rb +59 -12
- data/app/models/concerns/hyrax/ability.rb +61 -8
- data/app/models/concerns/hyrax/basic_metadata.rb +26 -57
- data/app/models/concerns/hyrax/collection_behavior.rb +9 -9
- data/app/models/concerns/hyrax/{required_metadata.rb → core_metadata.rb} +3 -1
- data/app/models/concerns/hyrax/file_set/belongs_to_works.rb +2 -2
- data/app/models/concerns/hyrax/file_set/derivatives.rb +1 -1
- data/app/models/concerns/hyrax/file_set/indexing.rb +0 -1
- data/app/models/concerns/hyrax/file_set_behavior.rb +2 -2
- data/app/models/concerns/hyrax/nested_works.rb +1 -1
- data/app/models/concerns/hyrax/proxy_deposit.rb +1 -1
- data/app/models/concerns/hyrax/solr_document/metadata.rb +88 -0
- data/app/models/concerns/hyrax/solr_document_behavior.rb +9 -151
- data/app/models/concerns/hyrax/user.rb +16 -9
- data/app/models/concerns/hyrax/with_file_sets.rb +0 -25
- data/app/models/concerns/hyrax/work_behavior.rb +3 -4
- data/app/models/content_block.rb +102 -1
- data/app/models/featured_work_list.rb +7 -3
- data/app/models/hyrax/operation.rb +6 -4
- data/app/models/hyrax/permission_template.rb +2 -2
- data/app/models/hyrax/permission_template_access.rb +26 -1
- data/app/models/hyrax/uploaded_file.rb +2 -0
- data/app/models/job_io_wrapper.rb +105 -0
- data/app/models/proxy_deposit_request.rb +16 -12
- data/app/models/single_use_link.rb +1 -1
- data/app/models/sipity/method.rb +11 -0
- data/app/presenters/hyrax/admin/users_presenter.rb +1 -1
- data/app/presenters/hyrax/admin_set_options_presenter.rb +7 -2
- data/app/presenters/hyrax/admin_stats_presenter.rb +21 -13
- data/app/presenters/hyrax/characterization_behavior.rb +1 -1
- data/app/presenters/hyrax/collection_options_presenter.rb +1 -1
- data/app/presenters/hyrax/collection_presenter.rb +4 -3
- data/app/presenters/hyrax/dashboard/user_presenter.rb +60 -0
- data/app/presenters/hyrax/embargo_presenter.rb +1 -1
- data/app/presenters/hyrax/file_set_presenter.rb +12 -17
- data/app/presenters/hyrax/fixity_status_presenter.rb +89 -0
- data/app/presenters/hyrax/homepage_presenter.rb +15 -3
- data/app/presenters/hyrax/lease_presenter.rb +1 -1
- data/app/presenters/hyrax/member_presenter_factory.rb +3 -1
- data/app/presenters/hyrax/menu_presenter.rb +31 -7
- data/app/presenters/hyrax/permission_badge.rb +12 -14
- data/app/presenters/hyrax/presenter_factory.rb +25 -6
- data/app/presenters/hyrax/presenter_renderer.rb +1 -1
- data/app/presenters/hyrax/select_type_presenter.rb +16 -0
- data/app/presenters/hyrax/transfers_presenter.rb +37 -0
- data/app/presenters/hyrax/trophy_presenter.rb +1 -5
- data/app/presenters/hyrax/twitter_presenter.rb +18 -0
- data/app/presenters/hyrax/work_show_presenter.rb +25 -15
- data/app/presenters/hyrax/workflow_presenter.rb +7 -0
- data/app/renderers/hyrax/renderers/attribute_renderer.rb +2 -2
- data/app/renderers/hyrax/renderers/faceted_attribute_renderer.rb +1 -1
- data/app/renderers/hyrax/renderers/{rights_attribute_renderer.rb → license_attribute_renderer.rb} +4 -6
- data/app/search_builders/hyrax/README.md +3 -3
- data/app/search_builders/hyrax/admin_set_search_builder.rb +3 -21
- data/app/search_builders/hyrax/collection_member_search_builder.rb +9 -1
- data/app/search_builders/hyrax/collection_search_builder.rb +1 -25
- data/app/search_builders/hyrax/deposit_search_builder.rb +26 -0
- data/app/search_builders/hyrax/filter_by_type.rb +1 -3
- data/app/search_builders/hyrax/member_with_files_search_builder.rb +1 -1
- data/app/search_builders/hyrax/my/collections_search_builder.rb +8 -0
- data/app/search_builders/hyrax/{find_works_search_builder.rb → my/find_works_search_builder.rb} +2 -3
- data/app/search_builders/hyrax/{my_highlights_search_builder.rb → my/highlights_search_builder.rb} +2 -2
- data/app/search_builders/hyrax/my/search_builder.rb +21 -0
- data/app/search_builders/hyrax/{my_search_builder_behavior.rb → my/search_builder_behavior.rb} +1 -1
- data/app/search_builders/hyrax/{my_shares_search_builder.rb → my/shares_search_builder.rb} +3 -3
- data/app/search_builders/hyrax/{my_works_search_builder.rb → my/works_search_builder.rb} +6 -2
- data/app/search_builders/hyrax/parent_collection_search_builder.rb +12 -0
- data/app/search_builders/hyrax/search_builder.rb +0 -8
- data/app/search_builders/hyrax/search_filters.rb +11 -5
- data/app/search_builders/hyrax/single_admin_set_search_builder.rb +4 -2
- data/app/search_builders/hyrax/works_search_builder.rb +6 -1
- data/app/services/hyrax/admin_set_create_service.rb +37 -12
- data/app/services/hyrax/admin_set_service.rb +3 -2
- data/app/services/hyrax/analytics.rb +1 -1
- data/app/services/hyrax/collection_thumbnail_path_service.rb +1 -0
- data/{lib → app/services}/hyrax/collections/search_service.rb +1 -1
- data/app/services/hyrax/collections_service.rb +2 -2
- data/app/services/hyrax/curation_concern.rb +39 -7
- data/app/services/hyrax/default_middleware_stack.rb +27 -0
- data/app/services/hyrax/file_set_csv_service.rb +1 -1
- data/app/services/hyrax/file_set_derivatives_service.rb +6 -1
- data/app/services/hyrax/file_set_fixity_check_service.rb +122 -0
- data/app/services/hyrax/fixity_check_failure_service.rb +25 -0
- data/app/services/hyrax/form_metadata_service.rb +9 -3
- data/app/services/hyrax/lock_manager.rb +1 -14
- data/app/services/hyrax/microdata.rb +44 -13
- data/app/services/hyrax/noid.rb +0 -5
- data/app/services/hyrax/qa_select_service.rb +1 -1
- data/app/services/hyrax/quick_classification_query.rb +2 -2
- data/app/services/hyrax/repository_fixity_check_service.rb +12 -0
- data/app/services/hyrax/resource_types_service.rb +4 -1
- data/app/services/hyrax/statistics/depositors/summary.rb +9 -1
- data/app/services/hyrax/statistics/system_stats.rb +9 -0
- data/app/services/hyrax/statistics/term_query.rb +7 -0
- data/app/services/hyrax/statistics/works/count.rb +11 -0
- data/app/services/hyrax/thumbnail_path_service.rb +1 -1
- data/app/services/hyrax/user_stat_importer.rb +20 -18
- data/app/services/hyrax/workflow/abstract_notification.rb +1 -3
- data/app/services/hyrax/workflow/changes_required_notification.rb +1 -3
- data/app/services/hyrax/workflow/deposited_notification.rb +1 -3
- data/app/services/hyrax/workflow/grant_edit_to_depositor.rb +5 -0
- data/app/services/hyrax/workflow/grant_read_to_depositor.rb +3 -0
- data/app/services/hyrax/workflow/notification_service.rb +12 -4
- data/app/services/hyrax/workflow/pending_review_notification.rb +1 -3
- data/app/services/hyrax/workflow/permission_generator.rb +26 -2
- data/app/services/hyrax/workflow/permission_query.rb +21 -24
- data/app/services/hyrax/workflow/revoke_edit_from_depositor.rb +3 -0
- data/app/services/hyrax/workflow/workflow_action_service.rb +3 -3
- data/app/services/hyrax/working_directory.rb +3 -0
- data/app/uploaders/hyrax/avatar_uploader.rb +1 -1
- data/app/views/_flash_msg.html.erb +1 -1
- data/app/views/_masthead.html.erb +0 -2
- data/app/views/_user_util_links.html.erb +7 -10
- data/app/views/catalog/_document.html.erb +1 -3
- data/app/views/catalog/_index_list_default.html.erb +2 -1
- data/app/views/catalog/_search_form.html.erb +5 -5
- data/app/views/catalog/_thumbnail_list_default.html.erb +1 -2
- data/app/views/collections/edit_fields/_based_near.html.erb +8 -0
- data/app/views/hyrax/admin/admin_sets/_form.html.erb +3 -1
- data/app/views/hyrax/admin/admin_sets/_form_participant_table.html.erb +12 -3
- data/app/views/hyrax/admin/admin_sets/_show_document_list.html.erb +1 -1
- data/app/views/hyrax/admin/admin_sets/_show_document_list_row.html.erb +2 -2
- data/app/views/hyrax/admin/admin_sets/edit.html.erb +1 -1
- data/app/views/hyrax/admin/admin_sets/index.html.erb +8 -9
- data/app/views/hyrax/admin/admin_sets/index.json.jbuilder +5 -0
- data/app/views/hyrax/admin/admin_sets/new.html.erb +1 -1
- data/app/views/hyrax/admin/admin_sets/show.html.erb +22 -16
- data/app/views/hyrax/admin/appearances/show.html.erb +16 -0
- data/app/views/hyrax/admin/features/index.html.erb +5 -5
- data/app/views/hyrax/admin/stats/_deposits.html.erb +1 -2
- data/app/views/hyrax/admin/stats/_new_users.html.erb +1 -2
- data/app/views/hyrax/admin/stats/_works.html.erb +6 -6
- data/app/views/hyrax/admin/users/index.html.erb +3 -4
- data/app/views/hyrax/admin/workflow_roles/index.html.erb +58 -39
- data/app/views/hyrax/admin/workflows/index.html.erb +1 -1
- data/app/views/hyrax/base/_attribute_rows.html.erb +2 -1
- data/app/views/hyrax/base/_attributes.html.erb +1 -1
- data/app/views/hyrax/base/_form.html.erb +4 -3
- data/app/views/hyrax/base/_form_files.html.erb +2 -2
- data/app/views/hyrax/base/_form_member_of_collections.html.erb +1 -0
- data/app/views/hyrax/base/_form_metadata.html.erb +15 -15
- data/app/views/hyrax/base/_form_permission_under_embargo.html.erb +5 -4
- data/app/views/hyrax/base/_form_permission_under_lease.html.erb +3 -4
- data/app/views/hyrax/base/_form_progress.html.erb +6 -3
- data/app/views/hyrax/base/_form_share.html.erb +6 -6
- data/app/views/hyrax/base/_form_visibility_component.html.erb +9 -1
- data/app/views/hyrax/base/_guts4form.html.erb +39 -37
- data/app/views/hyrax/base/_metadata.html.erb +1 -1
- data/app/views/hyrax/base/_relationships_parent_rows.html.erb +8 -20
- data/app/views/hyrax/base/_work_title.erb +3 -1
- data/app/views/hyrax/base/edit.html.erb +1 -1
- data/app/views/hyrax/base/show.html.erb +5 -3
- data/app/views/hyrax/base/show.json.jbuilder +1 -1
- data/app/views/hyrax/base/unavailable.html.erb +3 -2
- data/app/views/hyrax/batch_edits/edit.html.erb +1 -1
- data/app/views/{batch_select → hyrax/batch_select}/_add_button.html.erb +0 -0
- data/app/views/hyrax/batch_uploads/_form.html.erb +2 -3
- data/app/views/hyrax/citations/work.html.erb +0 -2
- data/app/views/hyrax/collections/_collection_description.erb +1 -1
- data/app/views/hyrax/{my/_index_partials → collections}/_default_group.html.erb +4 -4
- data/app/views/hyrax/collections/_document_list.html.erb +1 -1
- data/app/views/hyrax/{my/_index_partials → collections}/_list_collections.html.erb +1 -1
- data/app/views/hyrax/collections/_list_works.html.erb +36 -0
- data/app/views/hyrax/collections/_media_display.html.erb +8 -1
- data/app/views/hyrax/collections/_search_form.html.erb +1 -1
- data/app/views/hyrax/collections/_show_document_list.html.erb +0 -3
- data/app/views/hyrax/collections/_show_document_list_row.html.erb +0 -5
- data/app/views/hyrax/collections/_sort_and_per_page.html.erb +0 -10
- data/app/views/hyrax/collections/show.html.erb +2 -5
- data/app/views/hyrax/content_blocks/_form.html.erb +63 -0
- data/app/views/hyrax/content_blocks/edit.html.erb +9 -0
- data/app/views/hyrax/content_blocks/templates/agreement.html.erb +44 -0
- data/app/views/hyrax/content_blocks/templates/terms.html.erb +62 -0
- data/app/views/hyrax/{admin/_collections.html.erb → dashboard/_admin_sets.html.erb} +3 -5
- data/app/views/hyrax/dashboard/_index_partials/_transfers.html.erb +3 -3
- data/app/views/hyrax/dashboard/_sidebar.html.erb +19 -0
- data/app/views/hyrax/{collections → dashboard/collections}/_batch_edits_actions.html.erb +0 -0
- data/app/views/hyrax/dashboard/collections/_bookmark_control.html.erb +23 -0
- data/app/views/hyrax/dashboard/collections/_button_create_collection.html.erb +1 -0
- data/app/views/hyrax/{collections → dashboard/collections}/_button_for_remove_selected_from_collection.html.erb +1 -1
- data/app/views/hyrax/{collections → dashboard/collections}/_button_for_update_collection.html.erb +1 -1
- data/app/views/hyrax/{collections → dashboard/collections}/_button_remove_from_collection.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_document_list.html.erb +13 -0
- data/app/views/hyrax/{collections → dashboard/collections}/_edit_actions.html.erb +3 -2
- data/app/views/hyrax/dashboard/collections/_form.html.erb +86 -0
- data/app/views/hyrax/dashboard/collections/_form_default_group.html.erb +25 -0
- data/app/views/hyrax/{collections → dashboard/collections}/_form_for_select_collection.html.erb +5 -5
- data/app/views/hyrax/{collections → dashboard/collections}/_form_permission.html.erb +0 -0
- data/app/views/hyrax/dashboard/collections/_form_share.html.erb +90 -0
- data/app/views/hyrax/dashboard/collections/_list_collections.html.erb +45 -0
- data/app/views/hyrax/dashboard/collections/_list_works.html.erb +40 -0
- data/app/views/hyrax/{collections → dashboard/collections}/_show_actions.html.erb +4 -3
- data/app/views/hyrax/dashboard/collections/_show_descriptions.html.erb +7 -0
- data/app/views/hyrax/dashboard/collections/_show_document_list.html.erb +17 -0
- data/app/views/hyrax/{collections → dashboard/collections}/_show_document_list_menu.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_show_document_list_row.html.erb +49 -0
- data/app/views/hyrax/dashboard/collections/_show_fields.html.erb +0 -0
- data/app/views/hyrax/{collections → dashboard/collections}/_single_item_action_fields.html.erb +0 -0
- data/app/views/hyrax/dashboard/collections/_sort_and_per_page.html.erb +32 -0
- data/app/views/hyrax/{collections → dashboard/collections}/_work_action_menu.html.erb +0 -0
- data/app/views/hyrax/dashboard/collections/edit.html.erb +35 -0
- data/app/views/hyrax/{collections → dashboard/collections}/edit_fields/_description.html.erb +0 -0
- data/app/views/hyrax/dashboard/collections/new.html.erb +11 -0
- data/app/views/hyrax/dashboard/collections/show.html.erb +36 -0
- data/app/views/hyrax/{users → dashboard/profiles}/_edit_primary.html.erb +3 -8
- data/app/views/hyrax/{users → dashboard/profiles}/_edit_secondary.html.erb +0 -0
- data/app/views/hyrax/{users → dashboard/profiles}/_trophy_edit.html.erb +0 -0
- data/app/views/hyrax/{users → dashboard/profiles}/_zotero.html.erb +0 -0
- data/app/views/hyrax/dashboard/profiles/edit.html.erb +14 -0
- data/app/views/hyrax/dashboard/profiles/show.html.erb +22 -0
- data/app/views/hyrax/{admin/show.html.erb → dashboard/show_admin.html.erb} +1 -1
- data/app/views/hyrax/dashboard/{_index_partials/_contents.html.erb → show_user.html.erb} +14 -10
- data/app/views/hyrax/dashboard/sidebar/_activity.html.erb +27 -0
- data/app/views/hyrax/dashboard/sidebar/_configuration.html.erb +31 -0
- data/app/views/hyrax/dashboard/sidebar/_repository_content.html.erb +17 -0
- data/app/views/hyrax/dashboard/sidebar/_tasks.html.erb +12 -0
- data/app/views/hyrax/dashboard/works/_default_group.html.erb +19 -0
- data/app/views/hyrax/{my/_index_partials → dashboard/works}/_list_works.html.erb +0 -6
- data/app/views/hyrax/embargoes/_embargo_history.html.erb +8 -0
- data/app/views/hyrax/embargoes/_list_active_embargoes.html.erb +18 -0
- data/app/views/hyrax/embargoes/_list_deactivated_embargoes.html.erb +4 -0
- data/app/views/hyrax/embargoes/_list_expired_active_embargoes.html.erb +53 -0
- data/app/views/hyrax/embargoes/_table_headers.html.erb +5 -0
- data/app/views/hyrax/embargoes/edit.html.erb +45 -0
- data/app/views/hyrax/embargoes/index.html.erb +25 -0
- data/app/views/hyrax/file_sets/_actions.html.erb +1 -2
- data/app/views/hyrax/file_sets/_extra_fields_modal.html.erb +1 -1
- data/app/views/hyrax/file_sets/_file_set_title.erb +9 -0
- data/app/views/hyrax/file_sets/_permission_form.html.erb +2 -2
- data/app/views/hyrax/file_sets/_show_characterization_details.html.erb +1 -1
- data/app/views/hyrax/file_sets/_show_details.html.erb +2 -2
- data/app/views/hyrax/file_sets/media_display/_image.html.erb +1 -2
- data/app/views/hyrax/file_sets/show.html.erb +2 -4
- data/app/views/hyrax/homepage/_announcement.html.erb +2 -2
- data/app/views/hyrax/homepage/_explore_collections.html.erb +8 -7
- data/app/views/hyrax/homepage/_featured_researcher.html.erb +5 -7
- data/app/views/hyrax/homepage/_home_content.html.erb +14 -18
- data/app/views/hyrax/homepage/_marketing.html.erb +2 -3
- data/app/views/hyrax/homepage/index.html.erb +2 -2
- data/app/views/hyrax/leases/_lease_history.html.erb +8 -0
- data/app/views/hyrax/leases/_list_active_leases.html.erb +18 -0
- data/app/views/hyrax/leases/_list_deactivated_leases.html.erb +4 -0
- data/app/views/hyrax/leases/_list_expired_active_leases.html.erb +53 -0
- data/app/views/hyrax/leases/_table_headers.html.erb +5 -0
- data/app/views/hyrax/leases/edit.html.erb +45 -0
- data/app/views/hyrax/leases/index.html.erb +24 -0
- data/app/views/hyrax/my/_collection_action_menu.html.erb +3 -3
- data/app/views/hyrax/my/_constraints.html.erb +11 -9
- data/app/views/hyrax/my/_document_list.html.erb +1 -1
- data/app/views/hyrax/my/_facet_layout.html.erb +6 -11
- data/app/views/hyrax/my/_facet_limit.html.erb +5 -1
- data/app/views/hyrax/my/_scripts.js.erb +0 -5
- data/app/views/hyrax/my/_search_form.html.erb +14 -0
- data/app/views/hyrax/my/_search_header.html.erb +25 -1
- data/app/views/hyrax/my/_sort_and_per_page.html.erb +1 -27
- data/app/views/hyrax/my/_work_action_menu.html.erb +1 -1
- data/app/views/hyrax/my/collections/_default_group.html.erb +18 -0
- data/app/views/hyrax/my/collections/_facets.html.erb +7 -0
- data/app/views/hyrax/my/collections/_list_collections.html.erb +43 -0
- data/app/views/hyrax/my/collections/_tabs.html.erb +9 -0
- data/app/views/hyrax/my/collections/index.html.erb +38 -0
- data/app/views/hyrax/my/index.html.erb +18 -27
- data/app/views/hyrax/my/works/_default_group.html.erb +20 -0
- data/app/views/hyrax/my/works/_facets.html.erb +7 -0
- data/app/views/hyrax/my/works/_list_works.html.erb +40 -0
- data/app/views/hyrax/my/works/_tabs.html.erb +9 -0
- data/app/views/hyrax/my/works/index.html.erb +62 -0
- data/app/views/hyrax/notifications/_notifications.html.erb +37 -0
- data/app/views/hyrax/notifications/index.html.erb +15 -0
- data/app/views/hyrax/pages/_form.html.erb +82 -0
- data/app/views/hyrax/pages/edit.html.erb +9 -0
- data/app/views/hyrax/pages/show.html.erb +3 -1
- data/app/views/hyrax/permissions/confirm_access.html.erb +1 -1
- data/app/views/hyrax/stats/file.html.erb +1 -1
- data/app/views/hyrax/stats/work.html.erb +1 -1
- data/app/views/hyrax/transfers/_received.html.erb +9 -11
- data/app/views/hyrax/transfers/_sent.html.erb +7 -9
- data/app/views/hyrax/transfers/index.html.erb +27 -5
- data/app/views/hyrax/transfers/new.html.erb +9 -3
- data/app/views/hyrax/uploads/_js_templates.html.erb +4 -3
- data/app/views/hyrax/users/_activity_log.html.erb +7 -2
- data/app/views/hyrax/users/_left_sidebar.html.erb +1 -1
- data/app/views/hyrax/users/_notify_number.html.erb +8 -3
- data/app/views/hyrax/users/_profile_tabs.html.erb +1 -1
- data/app/views/hyrax/users/_user.html.erb +1 -5
- data/app/views/hyrax/users/_user_row.html.erb +3 -3
- data/app/views/layouts/_head_tag_content.html.erb +1 -1
- data/app/views/layouts/dashboard.html.erb +34 -0
- data/app/views/layouts/hyrax.html.erb +13 -34
- data/app/views/records/edit_fields/_based_near.html.erb +5 -1
- data/app/views/records/edit_fields/{_rights.html.erb → _license.html.erb} +1 -1
- data/app/views/records/edit_fields/_rights_statement.html.erb +5 -0
- data/app/views/shared/_appearance_styles.html.erb +59 -0
- data/app/views/shared/_citations.html.erb +5 -5
- data/app/views/shared/_footer.html.erb +1 -1
- data/app/views/shared/_select_work_type_modal.html.erb +2 -2
- data/artifacts/entity-relationship-diagram.dot +76 -0
- data/artifacts/entity-relationship-diagram.pdf +0 -0
- data/config/brakeman.ignore +105 -0
- data/config/features.rb +4 -0
- data/config/i18n-tasks.yml +127 -0
- data/config/initializers/hyrax_callbacks.rb +5 -6
- data/config/locales/hyrax.de.yml +865 -0
- data/config/locales/hyrax.en.yml +224 -102
- data/config/locales/hyrax.es.yml +649 -526
- data/config/locales/hyrax.fr.yml +865 -0
- data/config/locales/hyrax.it.yml +865 -0
- data/config/locales/hyrax.pt-BR.yml +865 -0
- data/config/locales/hyrax.zh.yml +627 -497
- data/config/locales/simple_form.de.yml +10 -0
- data/config/locales/simple_form.es.yml +10 -0
- data/config/locales/simple_form.fr.yml +10 -0
- data/config/locales/simple_form.it.yml +10 -0
- data/config/locales/simple_form.pt-BR.yml +10 -0
- data/config/locales/simple_form.zh.yml +10 -0
- data/config/routes.rb +69 -28
- data/db/migrate/20170307142607_tidy_up_because_of_bad_exception.rb +1 -1
- data/db/migrate/20170504192714_change_checksum_audit_log.rb +18 -0
- data/db/migrate/20170621201939_create_job_io_wrappers.rb +15 -0
- data/hyrax.gemspec +23 -27
- data/lib/generators/hyrax/assets_generator.rb +1 -0
- data/lib/generators/hyrax/clamav_generator.rb +1 -0
- data/lib/generators/hyrax/config_generator.rb +6 -0
- data/lib/generators/hyrax/install_generator.rb +0 -12
- data/lib/generators/hyrax/models_generator.rb +2 -0
- data/lib/generators/hyrax/templates/app/models/collection.rb +1 -0
- data/lib/generators/hyrax/templates/catalog_controller.rb +4 -4
- data/lib/generators/hyrax/templates/config/hyrax.rb +23 -33
- data/lib/generators/hyrax/templates/config/locales/hyrax.de.yml +56 -0
- data/lib/generators/hyrax/templates/config/locales/hyrax.en.yml +3 -3
- data/lib/generators/hyrax/templates/config/locales/hyrax.es.yml +9 -8
- data/lib/generators/hyrax/templates/config/locales/hyrax.fr.yml +56 -0
- data/lib/generators/hyrax/templates/config/locales/hyrax.it.yml +56 -0
- data/lib/generators/hyrax/templates/config/locales/hyrax.pt-BR.yml +56 -0
- data/lib/generators/hyrax/templates/config/locales/hyrax.zh.yml +9 -8
- data/lib/generators/hyrax/work/templates/controller.rb.erb +3 -0
- data/lib/generators/hyrax/work/templates/feature_spec.rb.erb +1 -1
- data/lib/generators/hyrax/work/templates/indexer.rb.erb +19 -0
- data/lib/generators/hyrax/work/templates/locale.de.yml.erb +8 -0
- data/lib/generators/hyrax/work/templates/locale.fr.yml.erb +8 -0
- data/lib/generators/hyrax/work/templates/locale.it.yml.erb +8 -0
- data/lib/generators/hyrax/work/templates/locale.pt-BR.yml.erb +8 -0
- data/lib/generators/hyrax/work/templates/model.rb.erb +7 -2
- data/lib/generators/hyrax/work/templates/presenter.rb.erb +6 -0
- data/lib/generators/hyrax/work/templates/presenter_spec.rb.erb +9 -0
- data/lib/generators/hyrax/work/work_generator.rb +25 -10
- data/lib/hyrax.rb +0 -1
- data/lib/hyrax/arkivo/actor.rb +14 -5
- data/lib/hyrax/arkivo/create_subscription_job.rb +1 -1
- data/lib/hyrax/arkivo/schema_validator.rb +1 -1
- data/lib/hyrax/configuration.rb +58 -100
- data/lib/hyrax/controller_resource.rb +1 -1
- data/lib/hyrax/engine.rb +7 -4
- data/lib/hyrax/rails/routes.rb +2 -18
- data/lib/hyrax/resource_sync/capability_list_writer.rb +3 -0
- data/lib/hyrax/resource_sync/change_list_writer.rb +14 -2
- data/lib/hyrax/role_registry.rb +5 -0
- data/lib/hyrax/version.rb +1 -1
- data/lib/tasks/default_admin_set.rake +12 -1
- data/lib/tasks/migrate.rake +21 -4
- data/spec/abilities/ability_spec.rb +98 -8
- data/spec/abilities/admin_ability_spec.rb +5 -2
- data/spec/abilities/admin_set_abilities_spec.rb +2 -2
- data/spec/abilities/collection_abilities_spec.rb +5 -2
- data/spec/abilities/embargo_and_lease_ability_spec.rb +1 -2
- data/spec/abilities/file_set_abilities_spec.rb +8 -5
- data/spec/abilities/generic_work_abilities_spec.rb +10 -7
- data/spec/abilities/operation_ability_spec.rb +4 -3
- data/spec/abilities/proxies_and_transfer_abilities_spec.rb +13 -2
- data/spec/actors/hyrax/actors/apply_order_actor_spec.rb +25 -35
- data/spec/actors/hyrax/{apply_permission_template_actor_spec.rb → actors/apply_permission_template_actor_spec.rb} +15 -16
- data/spec/actors/hyrax/actors/attach_members_actor_spec.rb +16 -16
- data/spec/actors/hyrax/actors/cleanup_file_sets_actor_spec.rb +24 -0
- data/spec/actors/hyrax/actors/cleanup_trophies_actor_spec.rb +25 -0
- data/spec/actors/hyrax/actors/{add_as_member_of_collections_actor_spec.rb → collections_membership_actor_spec.rb} +29 -20
- data/spec/actors/hyrax/{create_with_files_actor_spec.rb → actors/create_with_files_actor_spec.rb} +27 -16
- data/spec/actors/hyrax/actors/create_with_remote_files_actor_spec.rb +68 -0
- data/spec/actors/hyrax/{default_admin_set_actor_spec.rb → actors/default_admin_set_actor_spec.rb} +19 -18
- data/spec/actors/hyrax/actors/embargo_actor_spec.rb +2 -3
- data/spec/actors/hyrax/actors/featured_work_actor_spec.rb +38 -0
- data/spec/actors/hyrax/actors/file_actor_spec.rb +102 -35
- data/spec/actors/hyrax/actors/file_set_actor_spec.rb +102 -175
- data/spec/actors/hyrax/actors/generic_work_actor_spec.rb +86 -54
- data/spec/actors/hyrax/actors/initialize_workflow_actor_spec.rb +15 -15
- data/spec/actors/hyrax/actors/interpret_visibility_actor_spec.rb +71 -52
- data/spec/actors/hyrax/actors/lease_actor_spec.rb +2 -3
- data/spec/actors/hyrax/actors/model_actor_spec.rb +26 -0
- data/spec/actors/hyrax/actors/optimistic_lock_validator_spec.rb +19 -17
- data/spec/actors/hyrax/actors/transactional_request_spec.rb +17 -11
- data/spec/authorities/qa/authorities/find_works_spec.rb +6 -9
- data/spec/config/hyrax_events_spec.rb +3 -8
- data/spec/controllers/catalog_controller_spec.rb +5 -2
- data/spec/controllers/hyrax/accepts_batches_controller_spec.rb +6 -6
- data/spec/controllers/hyrax/admin/admin_sets_controller_spec.rb +29 -5
- data/spec/controllers/hyrax/admin/appearances_controller_spec.rb +66 -0
- data/spec/controllers/hyrax/admin/features_controller_spec.rb +4 -2
- data/spec/controllers/hyrax/admin/permission_template_accesses_controller_spec.rb +29 -12
- data/spec/controllers/hyrax/admin/permission_templates_controller_spec.rb +2 -4
- data/spec/controllers/hyrax/admin/stats_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/admin/strategies_controller_spec.rb +2 -15
- data/spec/controllers/hyrax/admin/users_controller_spec.rb +3 -13
- data/spec/controllers/hyrax/admin/workflow_roles_controller_spec.rb +4 -8
- data/spec/controllers/hyrax/admin/workflows_controller_spec.rb +2 -4
- data/spec/controllers/hyrax/api/items_controller_spec.rb +22 -15
- data/spec/controllers/hyrax/api/zotero_controller_spec.rb +4 -4
- data/spec/controllers/hyrax/batch_edits_controller_spec.rb +7 -6
- data/spec/controllers/hyrax/batch_uploads_controller_spec.rb +25 -3
- data/spec/controllers/hyrax/citations_controller_spec.rb +3 -3
- data/spec/controllers/hyrax/collections_controller_spec.rb +7 -229
- data/spec/controllers/hyrax/contact_form_controller_spec.rb +11 -3
- data/spec/controllers/hyrax/content_blocks_controller_spec.rb +55 -55
- data/spec/controllers/hyrax/dashboard/collections_controller_spec.rb +353 -0
- data/spec/controllers/hyrax/dashboard/profiles_controller_spec.rb +155 -0
- data/spec/controllers/hyrax/dashboard/works_controller_spec.rb +13 -0
- data/spec/controllers/hyrax/dashboard_controller_spec.rb +19 -58
- data/spec/controllers/hyrax/depositors_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/downloads_controller_spec.rb +19 -15
- data/spec/controllers/hyrax/embargoes_controller_spec.rb +106 -0
- data/spec/controllers/hyrax/featured_work_lists_controller_spec.rb +3 -3
- data/spec/controllers/hyrax/featured_works_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/file_sets_controller_spec.rb +26 -25
- data/spec/controllers/hyrax/{audits_controller_spec.rb → fixity_checks_controller_spec.rb} +17 -10
- data/spec/controllers/hyrax/generic_works_controller_json_spec.rb +6 -10
- data/spec/controllers/hyrax/generic_works_controller_spec.rb +104 -82
- data/spec/controllers/hyrax/homepage_controller_spec.rb +19 -26
- data/spec/controllers/hyrax/leases_controller_spec.rb +106 -0
- data/spec/controllers/hyrax/my/collections_controller_spec.rb +23 -16
- data/spec/controllers/hyrax/my/highlights_controller_spec.rb +2 -3
- data/spec/controllers/hyrax/my/shares_controller_spec.rb +2 -1
- data/spec/controllers/hyrax/my/works_controller_spec.rb +33 -30
- data/spec/controllers/hyrax/{mailbox_controller_spec.rb → notifications_controller_spec.rb} +2 -2
- data/spec/controllers/hyrax/operations_controller_spec.rb +2 -3
- data/spec/controllers/hyrax/pages_controller_spec.rb +100 -12
- data/spec/controllers/hyrax/permissions_controller_spec.rb +7 -3
- data/spec/controllers/hyrax/resource_sync_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/single_use_links_controller_spec.rb +4 -3
- data/spec/controllers/hyrax/single_use_links_viewer_controller_spec.rb +1 -3
- data/spec/controllers/hyrax/static_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/stats_controller_spec.rb +10 -7
- data/spec/controllers/hyrax/transfers_controller_spec.rb +12 -31
- data/spec/controllers/hyrax/uploads_controller_spec.rb +3 -1
- data/spec/controllers/hyrax/users_controller_spec.rb +17 -166
- data/spec/controllers/hyrax/workflow_actions_controller_spec.rb +3 -4
- data/spec/conversions/power_converters/polymorphic_type_spec.rb +1 -1
- data/spec/conversions/power_converters/sipity_action_name_spec.rb +1 -1
- data/spec/conversions/power_converters/sipity_action_spec.rb +1 -1
- data/spec/conversions/power_converters/sipity_entity_spec.rb +5 -0
- data/spec/conversions/power_converters/sipity_role_spec.rb +0 -2
- data/spec/conversions/power_converters/sipity_workflow_state_spec.rb +1 -2
- data/spec/factories/admin_sets.rb +1 -1
- data/spec/factories/api_items.rb +3 -3
- data/spec/factories/collections_factory.rb +2 -2
- data/spec/factories/content_blocks.rb +1 -1
- data/spec/factories/featured_works.rb +1 -1
- data/spec/factories/file_sets.rb +3 -36
- data/spec/factories/generic_works.rb +15 -15
- data/spec/factories/operations.rb +1 -1
- data/spec/factories/permission_template_accesses.rb +5 -2
- data/spec/factories/permission_templates.rb +1 -1
- data/spec/factories/proxy_deposit_requests.rb +2 -2
- data/spec/factories/single_use_links.rb +1 -1
- data/spec/factories/sipity_entities.rb +1 -1
- data/spec/factories/uploaded_files.rb +1 -1
- data/spec/factories/users.rb +2 -2
- data/spec/factories/workflow_actions.rb +1 -1
- data/spec/factories/workflow_states.rb +1 -1
- data/spec/factories/workflows.rb +1 -1
- data/spec/features/admin_admin_set_spec.rb +5 -8
- data/spec/features/admin_spec.rb +2 -4
- data/spec/features/batch_create_spec.rb +1 -1
- data/spec/features/batch_edit_spec.rb +47 -115
- data/spec/features/browse_catalog_spec.rb +1 -1
- data/spec/features/browse_dashboard_works_spec.rb +55 -0
- data/spec/features/catalog_search_spec.rb +1 -1
- data/spec/features/collection_spec.rb +14 -222
- data/spec/features/contact_form_spec.rb +1 -1
- data/spec/features/create_child_work_spec.rb +3 -2
- data/spec/features/create_work_spec.rb +52 -41
- data/spec/features/dashboard/all_works.rb +14 -0
- data/spec/features/dashboard/collection_spec.rb +262 -0
- data/spec/features/dashboard/display_dashboard_spec.rb +18 -0
- data/spec/features/delete_work_spec.rb +1 -1
- data/spec/features/edit_file_spec.rb +1 -1
- data/spec/features/edit_work_spec.rb +1 -1
- data/spec/features/embargo_spec.rb +35 -0
- data/spec/features/homepage_spec.rb +5 -8
- data/spec/features/lease_spec.rb +35 -0
- data/spec/features/notifications_spec.rb +4 -3
- data/spec/features/ownership_transfer_spec.rb +8 -7
- data/spec/features/proxy_spec.rb +11 -4
- data/spec/features/search_spec.rb +3 -3
- data/spec/features/static_pages_spec.rb +0 -2
- data/spec/features/users_spec.rb +3 -12
- data/spec/features/work_generator_spec.rb +5 -3
- data/spec/features/work_show_spec.rb +4 -1
- data/spec/features/workflow_roles_spec.rb +2 -3
- data/spec/features/workflow_state_changes_spec.rb +2 -3
- data/spec/fixtures/config/schema_org.yml +2 -0
- data/spec/fixtures/config/schema_org_second.yml +7 -0
- data/spec/forms/hyrax/forms/admin/appearance_spec.rb +46 -0
- data/spec/forms/hyrax/forms/admin_set_form_spec.rb +71 -3
- data/spec/forms/hyrax/forms/batch_edit_form_spec.rb +10 -6
- data/spec/forms/hyrax/forms/batch_upload_form_spec.rb +9 -3
- data/spec/forms/hyrax/forms/collection_form_spec.rb +39 -13
- data/spec/forms/hyrax/forms/file_manager_form_spec.rb +2 -2
- data/spec/forms/hyrax/forms/file_set_edit_form_spec.rb +3 -4
- data/spec/forms/hyrax/forms/permission_template_form_spec.rb +58 -5
- data/spec/forms/hyrax/forms/work_form_spec.rb +70 -16
- data/spec/forms/hyrax/forms/workflow_action_form_spec.rb +23 -7
- data/spec/forms/hyrax/forms/workflow_responsibility_form_spec.rb +3 -3
- data/spec/forms/hyrax/generic_work_form_spec.rb +14 -7
- data/spec/helpers/blacklight_helper_spec.rb +32 -19
- data/spec/helpers/dashboard_helper_spec.rb +4 -19
- data/spec/helpers/hyrax/ability_helper_spec.rb +10 -5
- data/spec/helpers/{batch_edits_helper_spec.rb → hyrax/batch_edits_helper_spec.rb} +6 -1
- data/spec/helpers/hyrax/charts_helper_spec.rb +4 -3
- data/spec/helpers/hyrax/collections_helper_spec.rb +11 -10
- data/spec/helpers/hyrax/content_block_helper_spec.rb +22 -51
- data/spec/helpers/hyrax/file_set_helper_spec.rb +8 -4
- data/spec/helpers/hyrax/trophy_helper_spec.rb +2 -2
- data/spec/helpers/hyrax_helper_spec.rb +49 -3
- data/spec/indexers/hyrax/collection_indexer_spec.rb +24 -11
- data/spec/indexers/hyrax/file_set_indexer_spec.rb +36 -37
- data/spec/indexers/hyrax/{work_indexer_spec.rb → generic_work_indexer_spec.rb} +42 -5
- data/spec/inputs/controlled_vocabulary_input_spec.rb +57 -0
- data/spec/inputs/multifile_input_spec.rb +2 -3
- data/spec/javascripts/authority_select_spec.js +22 -0
- data/spec/javascripts/autocomplete_spec.js.coffee +16 -8
- data/spec/javascripts/batch_select_spec.js +15 -0
- data/spec/javascripts/fixtures/chart_example.html +1 -1
- data/spec/javascripts/fixtures/dashboard_batch_forms.html +11 -0
- data/spec/javascripts/jasmine_spec.rb +1 -1
- data/spec/javascripts/save_work_spec.js +19 -6
- data/spec/javascripts/visibility_component_spec.js +17 -36
- data/spec/jobs/attach_files_to_work_job_spec.rb +17 -16
- data/spec/jobs/batch_create_job_spec.rb +2 -1
- data/spec/jobs/characterize_job_spec.rb +24 -12
- data/spec/jobs/content_delete_event_job_spec.rb +1 -1
- data/spec/jobs/content_deposit_event_job_spec.rb +6 -7
- data/spec/jobs/content_depositor_change_event_job_spec.rb +4 -3
- data/spec/jobs/content_new_version_event_job_spec.rb +2 -2
- data/spec/jobs/content_restored_version_event_job_spec.rb +3 -2
- data/spec/jobs/content_update_event_job_spec.rb +6 -7
- data/spec/jobs/create_derivatives_job_spec.rb +1 -3
- data/spec/jobs/create_work_job_spec.rb +10 -7
- data/spec/jobs/file_set_attached_event_job_spec.rb +3 -3
- data/spec/jobs/fixity_check_job_spec.rb +51 -0
- data/spec/jobs/hyrax/grant_edit_job_spec.rb +11 -0
- data/spec/jobs/hyrax/grant_edit_to_members_job_spec.rb +16 -0
- data/spec/jobs/hyrax/grant_read_job_spec.rb +11 -0
- data/spec/jobs/hyrax/grant_read_to_members_job_spec.rb +16 -0
- data/spec/jobs/hyrax/revoke_edit_from_members_job_spec.rb +16 -0
- data/spec/jobs/hyrax/revoke_edit_job_spec.rb +11 -0
- data/spec/jobs/import_export_job_spec.rb +28 -0
- data/spec/jobs/import_url_job_spec.rb +3 -19
- data/spec/jobs/ingest_local_file_job_spec.rb +1 -3
- data/spec/jobs/inherit_permissions_job_spec.rb +1 -3
- data/spec/jobs/user_edit_profile_event_job_spec.rb +2 -1
- data/spec/jobs/visibility_copy_job_spec.rb +3 -5
- data/spec/lib/hyrax/analytics_spec.rb +1 -1
- data/spec/lib/hyrax/arkivo/actor_spec.rb +18 -16
- data/spec/lib/hyrax/arkivo/create_subscription_job_spec.rb +1 -3
- data/spec/lib/hyrax/arkivo/metadata_munger_spec.rb +2 -4
- data/spec/lib/hyrax/arkivo/schema_validator_spec.rb +5 -7
- data/spec/lib/hyrax/arkivo_spec.rb +1 -3
- data/spec/lib/hyrax/collections/search_service_spec.rb +2 -3
- data/spec/lib/hyrax/configuration_spec.rb +14 -13
- data/spec/lib/hyrax/controlled_vocabulary/importer/downloader_spec.rb +3 -1
- data/spec/lib/hyrax/controlled_vocabulary/importer/language_spec.rb +1 -1
- data/spec/lib/hyrax/move_all_works_to_admin_set_spec.rb +2 -2
- data/spec/lib/hyrax/name_spec.rb +4 -3
- data/spec/lib/hyrax/redis_event_store_spec.rb +5 -1
- data/spec/lib/hyrax/resource_sync/capability_list_writer_spec.rb +1 -3
- data/spec/lib/hyrax/resource_sync/change_list_writer_spec.rb +38 -28
- data/spec/lib/hyrax/resource_sync/resource_list_writer_spec.rb +2 -4
- data/spec/lib/hyrax/resource_sync/source_description_writer_spec.rb +1 -4
- data/spec/lib/hyrax/role_registry_spec.rb +9 -2
- data/spec/lib/hyrax/search_state_spec.rb +3 -2
- data/spec/lib/hyrax/zotero/config_spec.rb +2 -4
- data/spec/lib/hyrax/zotero_spec.rb +2 -1
- data/spec/models/admin_set_spec.rb +26 -12
- data/spec/models/batch_upload_item_spec.rb +1 -2
- data/spec/models/checksum_audit_log_spec.rb +131 -35
- data/spec/models/collection_spec.rb +5 -2
- data/spec/models/content_block_spec.rb +158 -49
- data/spec/models/featured_work_list_spec.rb +32 -11
- data/spec/models/featured_work_spec.rb +5 -1
- data/spec/models/file_download_stat_spec.rb +9 -6
- data/spec/models/file_set_spec.rb +84 -57
- data/spec/models/file_view_stat_spec.rb +5 -4
- data/spec/models/flipflop_spec.rb +11 -2
- data/spec/models/generic_work_spec.rb +14 -42
- data/spec/models/hyrax/download_spec.rb +1 -1
- data/spec/models/hyrax/operation_spec.rb +10 -3
- data/spec/models/hyrax/pageview_spec.rb +1 -1
- data/spec/models/hyrax/permission_template_access_spec.rb +57 -0
- data/spec/models/hyrax/permission_template_spec.rb +38 -1
- data/spec/models/hyrax/permissions/readable_permissions_spec.rb +4 -6
- data/spec/models/hyrax/permissions/writable_permissions_spec.rb +1 -3
- data/spec/models/hyrax/uploaded_file_spec.rb +2 -1
- data/spec/models/hyrax/user_usage_stats_spec.rb +2 -2
- data/spec/models/hyrax/work_behavior_spec.rb +4 -5
- data/spec/models/job_io_wrapper_spec.rb +172 -0
- data/spec/models/proxy_deposit_request_spec.rb +4 -5
- data/spec/models/single_use_link_spec.rb +3 -3
- data/spec/models/sipity/agent_spec.rb +1 -2
- data/spec/models/sipity/comment_spec.rb +3 -1
- data/spec/models/sipity/entity_spec.rb +2 -3
- data/spec/models/sipity/entity_specific_responsibility_spec.rb +1 -0
- data/spec/models/sipity/notifiable_context_spec.rb +1 -2
- data/spec/models/sipity/notification_recipient_spec.rb +1 -2
- data/spec/models/sipity/notification_spec.rb +2 -2
- data/spec/models/sipity/role_spec.rb +1 -2
- data/spec/models/sipity/workflow_action_spec.rb +1 -0
- data/spec/models/sipity/workflow_responsibility_spec.rb +1 -0
- data/spec/models/sipity/workflow_spec.rb +4 -0
- data/spec/models/sipity/workflow_state_action_permission_spec.rb +1 -0
- data/spec/models/sipity/workflow_state_action_spec.rb +1 -0
- data/spec/models/sipity/workflow_state_spec.rb +2 -0
- data/spec/models/solr_document_spec.rb +57 -3
- data/spec/models/trophy_spec.rb +1 -1
- data/spec/models/user_mailbox_spec.rb +4 -1
- data/spec/models/user_spec.rb +33 -10
- data/spec/models/work_view_stat_spec.rb +8 -4
- data/spec/presenters/hyrax/admin/dashboard_presenter_spec.rb +3 -2
- data/spec/presenters/hyrax/admin/repository_growth_presenter_spec.rb +1 -2
- data/spec/presenters/hyrax/admin/repository_object_presenter_spec.rb +2 -2
- data/spec/presenters/hyrax/admin/user_activity_presenter_spec.rb +1 -2
- data/spec/presenters/hyrax/admin/users_presenter_spec.rb +3 -3
- data/spec/presenters/hyrax/admin/workflow_role_presenter_spec.rb +0 -2
- data/spec/presenters/hyrax/admin/workflow_roles_presenter_spec.rb +0 -2
- data/spec/presenters/hyrax/admin_set_options_presenter_spec.rb +4 -4
- data/spec/presenters/hyrax/admin_set_presenter_spec.rb +14 -19
- data/spec/presenters/hyrax/admin_stats_presenter_spec.rb +20 -114
- data/spec/presenters/hyrax/collection_options_presenter_spec.rb +1 -2
- data/spec/presenters/hyrax/collection_presenter_spec.rb +13 -2
- data/spec/presenters/hyrax/dashboard/user_presenter_spec.rb +65 -0
- data/spec/presenters/hyrax/embargo_presenter_spec.rb +6 -3
- data/spec/presenters/hyrax/file_set_presenter_spec.rb +38 -15
- data/spec/presenters/hyrax/file_usage_spec.rb +14 -10
- data/spec/presenters/hyrax/fixity_status_presenter_spec.rb +55 -0
- data/spec/presenters/hyrax/homepage_presenter_spec.rb +30 -10
- data/spec/presenters/hyrax/inspect_work_presenter_spec.rb +3 -2
- data/spec/presenters/hyrax/lease_presenter_spec.rb +6 -3
- data/spec/presenters/hyrax/member_presenter_factory_spec.rb +5 -4
- data/spec/presenters/hyrax/menu_presenter_spec.rb +51 -7
- data/spec/presenters/hyrax/permission_badge_spec.rb +14 -9
- data/spec/presenters/hyrax/presenter_factory_spec.rb +10 -9
- data/spec/presenters/hyrax/presenter_renderer_spec.rb +3 -1
- data/spec/presenters/hyrax/select_type_list_presenter_spec.rb +10 -3
- data/spec/presenters/hyrax/select_type_presenter_spec.rb +43 -2
- data/spec/presenters/hyrax/single_use_link_presenter_spec.rb +3 -3
- data/spec/presenters/hyrax/transfers_presenter_spec.rb +44 -0
- data/spec/presenters/hyrax/trophy_presenter_spec.rb +7 -0
- data/spec/presenters/hyrax/twitter_presenter_spec.rb +27 -0
- data/spec/presenters/hyrax/user_profile_presenter_spec.rb +2 -0
- data/spec/presenters/hyrax/version_list_presenter_spec.rb +1 -3
- data/spec/presenters/hyrax/version_presenter_spec.rb +6 -3
- data/spec/presenters/hyrax/work_show_presenter_spec.rb +63 -6
- data/spec/presenters/hyrax/work_usage_spec.rb +13 -7
- data/spec/presenters/hyrax/workflow_presenter_spec.rb +24 -2
- data/spec/renderers/hyrax/renderers/attribute_renderer_spec.rb +7 -5
- data/spec/renderers/hyrax/renderers/date_attribute_renderer_spec.rb +4 -3
- data/spec/renderers/hyrax/renderers/external_link_attribute_renderer_spec.rb +3 -3
- data/spec/renderers/hyrax/renderers/faceted_attribute_renderer_spec.rb +15 -3
- data/spec/renderers/hyrax/renderers/{rights_attribute_renderer_spec.rb → license_attribute_renderer_spec.rb} +7 -7
- data/spec/renderers/hyrax/renderers/linked_attribute_renderer_spec.rb +3 -3
- data/spec/requests/legacy_routing_spec.rb +1 -1
- data/spec/routing/admin_routes_spec.rb +4 -3
- data/spec/routing/api_route_spec.rb +1 -1
- data/spec/routing/citations_route_spec.rb +1 -1
- data/spec/routing/featured_works_route_spec.rb +1 -1
- data/spec/routing/operations_spec.rb +1 -1
- data/spec/routing/ownership_transfers_route_spec.rb +1 -1
- data/spec/routing/resource_sync_spec.rb +1 -1
- data/spec/routing/route_spec.rb +51 -26
- data/spec/routing/single_use_link_spec.rb +1 -3
- data/spec/routing/stats_route_spec.rb +1 -1
- data/spec/search_builders/hyrax/admin_admin_set_member_search_builder_spec.rb +1 -2
- data/spec/{search_builder → search_builders}/hyrax/admin_set_search_builder_spec.rb +7 -9
- data/spec/{search_builder → search_builders}/hyrax/catalog_search_builder_spec.rb +4 -1
- data/spec/{search_builder → search_builders}/hyrax/embargo_search_builder_spec.rb +3 -3
- data/spec/{search_builder → search_builders}/hyrax/file_set_search_builder_spec.rb +2 -3
- data/spec/{search_builder → search_builders}/hyrax/lease_search_builder_spec.rb +3 -3
- data/spec/{search_builder/hyrax → search_builders/hyrax/my}/find_works_search_builder_spec.rb +6 -3
- data/spec/{search_builder/hyrax/my_shares_search_builder_spec.rb → search_builders/hyrax/my/shares_search_builder_spec.rb} +1 -1
- data/spec/{search_builder/hyrax/my_works_search_builder_spec.rb → search_builders/hyrax/my/works_search_builder_spec.rb} +3 -1
- data/spec/{search_builder → search_builders}/hyrax/single_admin_set_search_builder_spec.rb +2 -2
- data/spec/{search_builder → search_builders}/hyrax/stats/work_status_search_builder_spec.rb +0 -2
- data/spec/{search_builder → search_builders}/hyrax/work_relation_spec.rb +2 -3
- data/spec/{search_builder → search_builders}/hyrax/work_search_builder_spec.rb +5 -1
- data/spec/search_builders/hyrax/works_search_builder_spec.rb +1 -2
- data/spec/services/hyrax/admin_set_create_service_spec.rb +32 -15
- data/spec/services/hyrax/admin_set_service_spec.rb +13 -7
- data/spec/services/hyrax/batch_create_failure_service_spec.rb +1 -1
- data/spec/services/hyrax/batch_create_success_service_spec.rb +1 -1
- data/spec/services/hyrax/change_content_depositor_service_spec.rb +1 -1
- data/spec/services/hyrax/collection_member_service_spec.rb +1 -1
- data/spec/services/hyrax/collection_size_service_spec.rb +1 -1
- data/spec/services/hyrax/collections_service_spec.rb +5 -3
- data/spec/services/hyrax/curation_concern_spec.rb +4 -5
- data/spec/services/hyrax/default_middleware_stack_spec.rb +36 -0
- data/spec/services/hyrax/derivative_path_spec.rb +7 -3
- data/spec/services/hyrax/derivative_service_spec.rb +4 -1
- data/spec/services/hyrax/embargo_service_spec.rb +6 -7
- data/spec/services/hyrax/file_set_csv_service_spec.rb +19 -10
- data/spec/services/hyrax/file_set_derivatives_service_spec.rb +2 -1
- data/spec/services/hyrax/file_set_fixity_check_service_spec.rb +116 -0
- data/spec/services/hyrax/fixity_check_failure_service_spec.rb +29 -0
- data/spec/services/hyrax/graph_exporter_spec.rb +3 -2
- data/spec/services/hyrax/import_url_failure_service_spec.rb +1 -1
- data/spec/services/hyrax/lease_service_spec.rb +2 -5
- data/spec/services/hyrax/license_service_spec.rb +1 -3
- data/spec/services/hyrax/lock_manager_spec.rb +2 -3
- data/spec/services/hyrax/microdata_spec.rb +94 -0
- data/spec/services/hyrax/noid_spec.rb +3 -6
- data/spec/services/hyrax/parent_service_spec.rb +0 -2
- data/spec/services/hyrax/persist_derivatives_spec.rb +1 -3
- data/spec/services/hyrax/persist_directly_contained_output_file_service_spec.rb +2 -3
- data/spec/services/hyrax/qa_select_service_spec.rb +8 -4
- data/spec/services/hyrax/query_service_spec.rb +17 -1
- data/spec/services/hyrax/quick_classification_query_spec.rb +6 -3
- data/spec/services/hyrax/repository_fixity_check_service_spec.rb +18 -0
- data/spec/services/hyrax/resource_types_service_spec.rb +4 -3
- data/spec/services/hyrax/rights_statements_spec.rb +1 -3
- data/spec/services/hyrax/statistics/collections/over_time_spec.rb +1 -1
- data/spec/services/hyrax/statistics/depositors/summary_spec.rb +10 -2
- data/spec/services/hyrax/statistics/file_sets/by_format_spec.rb +4 -5
- data/spec/services/hyrax/statistics/system_stats_spec.rb +5 -4
- data/spec/services/hyrax/statistics/users/over_time_spec.rb +1 -2
- data/spec/services/hyrax/statistics/works/by_depositor_spec.rb +3 -4
- data/spec/services/hyrax/statistics/works/by_resource_type_spec.rb +1 -1
- data/spec/services/hyrax/statistics/works/count_spec.rb +7 -7
- data/spec/services/hyrax/statistics/works/over_time_spec.rb +1 -1
- data/spec/services/hyrax/thumbnail_path_service_spec.rb +12 -4
- data/spec/services/hyrax/user_stat_importer_spec.rb +52 -46
- data/spec/services/hyrax/versioning_service_spec.rb +1 -3
- data/spec/services/hyrax/work_query_service_spec.rb +6 -0
- data/spec/services/hyrax/workflow/action_taken_service_spec.rb +2 -2
- data/spec/services/hyrax/workflow/activate_object_spec.rb +1 -1
- data/spec/services/hyrax/workflow/changes_required_notification_spec.rb +4 -5
- data/spec/services/hyrax/workflow/deactivate_object_spec.rb +1 -1
- data/spec/services/hyrax/workflow/deposited_notification_spec.rb +4 -5
- data/spec/services/hyrax/workflow/grant_edit_to_depositor_spec.rb +19 -1
- data/spec/services/hyrax/workflow/grant_read_to_depositor_spec.rb +48 -0
- data/spec/services/hyrax/workflow/method_generator_spec.rb +1 -2
- data/spec/services/hyrax/workflow/notification_configuration_parameter_spec.rb +1 -2
- data/spec/services/hyrax/workflow/notification_generator_spec.rb +3 -3
- data/spec/services/hyrax/workflow/notification_service_spec.rb +37 -3
- data/spec/services/hyrax/workflow/pending_review_notification_spec.rb +4 -5
- data/spec/services/hyrax/workflow/permission_generator_spec.rb +4 -6
- data/spec/services/hyrax/workflow/permission_query_spec.rb +25 -3
- data/spec/services/hyrax/workflow/revoke_edit_from_depositor_spec.rb +16 -3
- data/spec/services/hyrax/workflow/sipity_actions_generator_spec.rb +0 -2
- data/spec/services/hyrax/workflow/state_machine_generator_spec.rb +12 -13
- data/spec/services/hyrax/workflow/status_list_service_spec.rb +2 -4
- data/spec/services/hyrax/workflow/workflow_factory_spec.rb +2 -1
- data/spec/services/hyrax/workflow/workflow_importer_spec.rb +7 -0
- data/spec/services/hyrax/workflow/workflow_permissions_generator_spec.rb +2 -0
- data/spec/services/hyrax/workflow/workflow_schema_spec.rb +2 -2
- data/spec/services/hyrax/working_directory_spec.rb +3 -3
- data/spec/spec_helper.rb +35 -61
- data/spec/strategies/hyrax/strategies/yaml_strategy_spec.rb +2 -2
- data/spec/support/controller_level_helpers.rb +1 -0
- data/spec/support/features.rb +2 -2
- data/spec/support/features/batch_edit_actions.rb +28 -0
- data/spec/support/features/session_helpers.rb +1 -1
- data/spec/support/features/workflow.rb +9 -0
- data/spec/support/logging_formatter.rb +66 -0
- data/spec/support/spec_statistic.rb +23 -0
- data/spec/tasks/rake_spec.rb +1 -1
- data/spec/test_app_templates/disable_animations_in_test_environment.rb +54 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +10 -1
- data/spec/views/_flash_msg.html.erb_spec.rb +4 -1
- data/spec/views/_user_util_links.html.erb_spec.rb +8 -8
- data/spec/views/catalog/_index_list_default.html.erb_spec.rb +1 -0
- data/spec/views/catalog/_search_form.html.erb_spec.rb +0 -2
- data/spec/views/catalog/_thumbnail_list_collection.html.erb_spec.rb +1 -1
- data/spec/views/catalog/index.html.erb_spec.rb +1 -1
- data/spec/views/content_blocks/edit.html.erb_spec.rb +21 -0
- data/spec/views/hyrax/admin/admin_sets/_form.html.erb_spec.rb +7 -3
- data/spec/views/hyrax/admin/admin_sets/_form_participant_table.html.erb_spec.rb +6 -2
- data/spec/views/hyrax/admin/admin_sets/_form_participants.html.erb_spec.rb +1 -2
- data/spec/views/hyrax/admin/admin_sets/_form_visibility.html.erb_spec.rb +0 -2
- data/spec/views/hyrax/admin/admin_sets/_form_workflow.html.erb_spec.rb +1 -2
- data/spec/views/hyrax/admin/admin_sets/_show_document_list.html.erb_spec.rb +4 -18
- data/spec/views/hyrax/admin/admin_sets/_show_document_list_row.html.erb_spec.rb +2 -2
- data/spec/views/hyrax/admin/admin_sets/index.html.erb_spec.rb +11 -2
- data/spec/views/hyrax/admin/admin_sets/index.json.erb_spec.rb +30 -0
- data/spec/views/hyrax/admin/admin_sets/show.html.erb_spec.rb +7 -9
- data/spec/views/hyrax/admin/features/index.html.erb_spec.rb +2 -1
- data/spec/views/hyrax/admin/stats/show.html.erb_spec.rb +6 -1
- data/spec/views/hyrax/admin/users/index.html.erb_spec.rb +2 -2
- data/spec/views/hyrax/admin/workflow_roles/index.html.erb_spec.rb +17 -10
- data/spec/views/hyrax/base/_attribute_rows.html.erb_spec.rb +11 -4
- data/spec/views/hyrax/base/_attributes.html.erb_spec.rb +1 -3
- data/spec/views/hyrax/base/_browse_everything.html.erb_spec.rb +7 -4
- data/spec/views/hyrax/base/_citations.html.erb_spec.rb +2 -3
- data/spec/views/hyrax/base/_find_work_widget.html.erb_spec.rb +1 -2
- data/spec/views/hyrax/base/_form.html.erb_spec.rb +30 -7
- data/spec/views/hyrax/base/_form_child_work_relationships.html.erb_spec.rb +4 -3
- data/spec/views/hyrax/base/_form_metadata.html.erb_spec.rb +40 -0
- data/spec/views/hyrax/base/_form_progress.html.erb_spec.rb +17 -8
- data/spec/views/hyrax/base/_form_relationships.html.erb_spec.rb +7 -8
- data/spec/views/hyrax/base/_items.html.erb_spec.rb +25 -34
- data/spec/views/hyrax/base/_member.html.erb_spec.rb +6 -4
- data/spec/views/hyrax/base/_relationships.html.erb_spec.rb +9 -48
- data/spec/views/hyrax/base/_show_actions.html.erb_spec.rb +8 -11
- data/spec/views/hyrax/base/_social_media.html.erb_spec.rb +1 -3
- data/spec/views/hyrax/base/edit.html.erb_spec.rb +4 -4
- data/spec/views/hyrax/base/file_manager.html.erb_spec.rb +1 -3
- data/spec/views/hyrax/base/show.html.erb_spec.rb +151 -7
- data/spec/views/hyrax/base/show.json.jbuilder_spec.rb +3 -5
- data/spec/views/hyrax/base/unauthorized.html.erb_spec.rb +3 -3
- data/spec/views/hyrax/base/unavailable.html.erb_spec.rb +6 -6
- data/spec/views/hyrax/batch_edits/check_all_spec.rb +1 -1
- data/spec/views/hyrax/batch_edits/edit.html.erb_spec.rb +8 -4
- data/spec/views/hyrax/batch_uploads/_form.html.erb_spec.rb +5 -8
- data/spec/views/hyrax/citations/work.html.erb_spec.rb +1 -1
- data/spec/views/hyrax/collections/_show_descriptions.html.erb_spec.rb +14 -9
- data/spec/views/hyrax/collections/_show_document_list.html.erb_spec.rb +14 -18
- data/spec/views/hyrax/collections/_show_document_list_row.html.erb_spec.rb +1 -2
- data/spec/views/hyrax/collections/show.html.erb_spec.rb +2 -7
- data/spec/views/hyrax/dashboard/_sidebar.html.erb_spec.rb +105 -0
- data/spec/views/hyrax/dashboard/collections/_form.html.erb_spec.rb +56 -0
- data/spec/views/hyrax/dashboard/collections/_form_for_select_collection.html.erb_spec.rb +55 -0
- data/spec/views/hyrax/dashboard/collections/_form_share.erb_spec.rb +42 -0
- data/spec/views/hyrax/dashboard/collections/_show_descriptions.html.erb_spec.rb +32 -0
- data/spec/views/hyrax/dashboard/collections/_show_document_list.html.erb_spec.rb +24 -0
- data/spec/views/hyrax/{collections → dashboard/collections}/_show_document_list_menu.html.erb_spec.rb +6 -6
- data/spec/views/hyrax/dashboard/collections/_show_document_list_row.html.erb_spec.rb +31 -0
- data/spec/views/hyrax/{collections → dashboard/collections}/edit.html.erb_spec.rb +4 -4
- data/spec/views/hyrax/dashboard/collections/show.html.erb_spec.rb +37 -0
- data/spec/views/hyrax/{users → dashboard/profiles}/edit.html.erb_spec.rb +3 -2
- data/spec/views/hyrax/dashboard/show_user_spec.rb +34 -0
- data/spec/views/hyrax/embargoes/index.html.erb_spec.rb +14 -0
- data/spec/views/hyrax/file_sets/_permission.html.erb_spec.rb +1 -3
- data/spec/views/hyrax/file_sets/_permission_form.html.erb_spec.rb +1 -3
- data/spec/views/hyrax/file_sets/_show_actions.html.erb_spec.rb +2 -3
- data/spec/views/hyrax/file_sets/_show_characterization_details.html.erb_spec.rb +2 -5
- data/spec/views/hyrax/file_sets/_single_use_links.html.erb_spec.rb +2 -3
- data/spec/views/hyrax/file_sets/_versioning.html.erb_spec.rb +1 -1
- data/spec/views/hyrax/file_sets/media_display/_default.html.erb_spec.rb +1 -3
- data/spec/views/hyrax/file_sets/show.html.erb_spec.rb +13 -8
- data/spec/views/hyrax/file_sets/show.json.jbuilder_spec.rb +0 -2
- data/spec/views/hyrax/homepage/_announcement.html.erb_spec.rb +5 -28
- data/spec/views/hyrax/homepage/_featured_works.html.erb_spec.rb +4 -1
- data/spec/views/hyrax/homepage/_sortable_featured.html.erb_spec.rb +3 -1
- data/spec/views/hyrax/homepage/index.html.erb_spec.rb +5 -2
- data/spec/views/hyrax/leases/index.html.erb_spec.rb +14 -0
- data/spec/views/hyrax/my/{_sort_and_per_page.html.erb_spec.rb → _search_header.html.erb_spec.rb} +10 -11
- data/spec/views/hyrax/my/_work_action_menu.html.erb_spec.rb +1 -3
- data/spec/views/hyrax/my/{_list_collections.html.erb_spec.rb → collections/_list_collections.html.erb_spec.rb} +5 -5
- data/spec/views/hyrax/my/facet.html.erb_spec.rb +2 -1
- data/spec/views/hyrax/my/{_list_works.html.erb_spec.rb → works/_list_works.html.erb_spec.rb} +3 -3
- data/spec/views/hyrax/my/works/index.html.erb_spec.rb +64 -0
- data/spec/views/hyrax/permissions/confirm.html.erb_spec.rb +4 -5
- data/spec/views/hyrax/single_use_links_viewer/show.html.erb_spec.rb +1 -12
- data/spec/views/hyrax/single_use_links_viewer/single_use_error.html.erb_spec.rb +1 -3
- data/spec/views/hyrax/stats/file.html.erb_spec.rb +1 -1
- data/spec/views/hyrax/uploads/create.json.jbuilder_spec.rb +1 -3
- data/spec/views/hyrax/users/_user_info.html.erb_spec.rb +1 -1
- data/spec/views/hyrax/users/index.html.erb_spec.rb +2 -1
- data/spec/views/hyrax/users/show.html.erb_spec.rb +1 -1
- data/spec/views/layouts/error.html.erb_spec.rb +1 -3
- data/spec/views/pages/edit.html.erb_spec.rb +27 -0
- data/spec/views/pages/show.html.erb_spec.rb +16 -0
- data/spec/views/records/edit_fields/_based_near.html.erb_spec.rb +1 -1
- data/spec/views/records/edit_fields/_description.html.erb_spec.rb +2 -1
- data/spec/views/records/edit_fields/_language.html.erb_spec.rb +1 -1
- data/spec/views/records/edit_fields/_subject.html.erb_spec.rb +1 -1
- data/spec/views/shared/select_work_type_modal.html.erb_spec.rb +4 -11
- data/tasks/{hyrax-dev.rake → hyrax_dev.rake} +2 -2
- data/template.rb +1 -5
- data/vendor/assets/javascripts/handlebars-v4.0.5.js +4612 -0
- metadata +453 -396
- data/CONTRIBUTING.md +0 -159
- data/app/actors/hyrax/actors/actor_stack.rb +0 -70
- data/app/actors/hyrax/actors/add_as_member_of_collections_actor.rb +0 -26
- data/app/actors/hyrax/actors/attach_files_actor.rb +0 -53
- data/app/actors/hyrax/actors/root_actor.rb +0 -20
- data/app/actors/hyrax/apply_permission_template_actor.rb +0 -21
- data/app/actors/hyrax/create_with_files_actor.rb +0 -46
- data/app/actors/hyrax/create_with_remote_files_actor.rb +0 -71
- data/app/actors/hyrax/default_admin_set_actor.rb +0 -42
- data/app/assets/javascripts/batch_edit.js.coffee +0 -166
- data/app/assets/javascripts/hyrax/batch_select.js +0 -10
- data/app/assets/javascripts/hyrax/featured_researcher.js +0 -14
- data/app/assets/stylesheets/hyrax/_dashboard.scss +0 -153
- data/app/assets/stylesheets/hyrax/_multi_value_fields.css.scss +0 -18
- data/app/assets/stylesheets/hyrax/admin.scss +0 -178
- data/app/controllers/concerns/hydra/batch_edit_behavior.rb +0 -73
- data/app/controllers/concerns/hyrax/batch_edits_controller_behavior.rb +0 -84
- data/app/controllers/concerns/hyrax/batch_uploads_controller_behavior.rb +0 -69
- data/app/controllers/concerns/hyrax/contact_form_controller_behavior.rb +0 -45
- data/app/controllers/concerns/hyrax/curation_concern_controller.rb +0 -241
- data/app/controllers/concerns/hyrax/dashboard_controller_behavior.rb +0 -47
- data/app/controllers/concerns/hyrax/depositors_controller_behavior.rb +0 -48
- data/app/controllers/concerns/hyrax/download_behavior.rb +0 -87
- data/app/controllers/concerns/hyrax/file_sets_controller_behavior.rb +0 -273
- data/app/controllers/concerns/hyrax/homepage_controller_behavior.rb +0 -52
- data/app/controllers/concerns/hyrax/my_controller_behavior.rb +0 -59
- data/app/controllers/concerns/hyrax/permissions_controller_behavior.rb +0 -38
- data/app/controllers/concerns/hyrax/single_use_links_controller_behavior.rb +0 -53
- data/app/controllers/concerns/hyrax/single_use_links_viewer_controller_behavior.rb +0 -85
- data/app/controllers/concerns/hyrax/transfers_controller_behavior.rb +0 -80
- data/app/controllers/concerns/hyrax/uploads_controller_behavior.rb +0 -18
- data/app/controllers/concerns/hyrax/users_controller_behavior.rb +0 -113
- data/app/controllers/hyrax/admin_controller.rb +0 -20
- data/app/controllers/hyrax/admin_sets_controller.rb +0 -25
- data/app/controllers/hyrax/audits_controller.rb +0 -16
- data/app/controllers/hyrax/tinymce_assets_controller.rb +0 -14
- data/app/helpers/batch_edits_helper.rb +0 -14
- data/app/helpers/contact_form_helper.rb +0 -2
- data/app/helpers/file_set_helper.rb +0 -7
- data/app/helpers/hyrax/search_paths_helper.rb +0 -11
- data/app/jobs/audit_job.rb +0 -47
- data/app/jobs/ingest_file_job.rb +0 -37
- data/app/models/concerns/hyrax/admin_set_behavior.rb +0 -118
- data/app/models/concerns/hyrax/content_block_behavior.rb +0 -47
- data/app/models/concerns/hyrax/works/featured.rb +0 -23
- data/app/models/concerns/hyrax/works/trophies.rb +0 -12
- data/app/models/hyrax/classify_concern.rb +0 -43
- data/app/models/tinymce_asset.rb +0 -3
- data/app/search_builders/deposit_search_builder.rb +0 -24
- data/app/search_builders/hyrax/active_works_search_builder.rb +0 -13
- data/app/search_builders/hyrax/admin_set_member_search_builder.rb +0 -12
- data/app/search_builders/hyrax/my_collections_search_builder.rb +0 -11
- data/app/search_builders/parent_collection_search_builder.rb +0 -10
- data/app/services/hyrax/actor_factory.rb +0 -33
- data/app/services/hyrax/audit_failure_service.rb +0 -20
- data/app/services/hyrax/file_set_audit_service.rb +0 -122
- data/app/services/hyrax/import_url_success_service.rb +0 -22
- data/app/services/hyrax/repository_audit_service.rb +0 -9
- data/app/services/hyrax/workflow/workflow_by_model_name_strategy.rb +0 -14
- data/app/uploaders/tinymce_asset_uploader.rb +0 -45
- data/app/views/_toolbar.html.erb +0 -75
- data/app/views/hyrax/admin/_menu.html.erb +0 -5
- data/app/views/hyrax/admin/_sidebar.html.erb +0 -33
- data/app/views/hyrax/admin_sets/_admin_set.html.erb +0 -25
- data/app/views/hyrax/admin_sets/_document_list.html.erb +0 -30
- data/app/views/hyrax/admin_sets/_member_document.html.erb +0 -26
- data/app/views/hyrax/admin_sets/_search_form.html.erb +0 -11
- data/app/views/hyrax/admin_sets/_sort_and_per_page.html.erb +0 -5
- data/app/views/hyrax/admin_sets/index.html.erb +0 -2
- data/app/views/hyrax/admin_sets/show.html.erb +0 -32
- data/app/views/hyrax/base/_relationships_parent_row_empty.html.erb +0 -6
- data/app/views/hyrax/collections/_button_create_collection.html.erb +0 -1
- data/app/views/hyrax/collections/_dashboard_document_list.html.erb +0 -4
- data/app/views/hyrax/collections/_form.html.erb +0 -41
- data/app/views/hyrax/collections/edit.html.erb +0 -29
- data/app/views/hyrax/collections/new.html.erb +0 -3
- data/app/views/hyrax/content_blocks/_featured_researcher.html.erb +0 -3
- data/app/views/hyrax/content_blocks/index.html.erb +0 -7
- data/app/views/hyrax/dashboard/_create_work_action.html.erb +0 -20
- data/app/views/hyrax/dashboard/_index_partials/_heading_actions.html.erb +0 -25
- data/app/views/hyrax/dashboard/_index_partials/_heading_greetings.html.erb +0 -3
- data/app/views/hyrax/dashboard/index.html.erb +0 -10
- data/app/views/hyrax/file_sets/_edit.js.erb +0 -20
- data/app/views/hyrax/mailbox/_notifications.html.erb +0 -27
- data/app/views/hyrax/mailbox/index.html.erb +0 -8
- data/app/views/hyrax/my/_facets.html.erb +0 -18
- data/app/views/hyrax/static/agreement.html.erb +0 -44
- data/app/views/hyrax/static/help.html.erb +0 -4
- data/app/views/hyrax/static/terms.html.erb +0 -62
- data/app/views/hyrax/users/edit.html.erb +0 -8
- data/app/views/layouts/admin.html.erb +0 -11
- data/app/views/records/edit_fields/_default.html.erb +0 -6
- data/lib/hyrax/collections.rb +0 -7
- data/lib/hyrax/collections_migration.rb +0 -18
- data/spec/actors/hyrax/actors/actor_stack_spec.rb +0 -35
- data/spec/actors/hyrax/create_with_remote_files_actor_spec.rb +0 -105
- data/spec/controllers/hyrax/admin_controller_spec.rb +0 -19
- data/spec/controllers/hyrax/admin_sets_controller_spec.rb +0 -28
- data/spec/controllers/hyrax/tinymce_assets_controller_spec.rb +0 -37
- data/spec/features/browse_dashboard_files_spec.rb +0 -67
- data/spec/features/cloud_upload_spec.rb +0 -15
- data/spec/features/display_dashboard_spec.rb +0 -28
- data/spec/features/show_admin_set_spec.rb +0 -11
- data/spec/features/user_admin_set_spec.rb +0 -55
- data/spec/helpers/hyrax/citations_behaviors/formatters/chicago_formatter_spec.rb +0 -10
- data/spec/jobs/audit_job_spec.rb +0 -57
- data/spec/jobs/ingest_file_job_spec.rb +0 -79
- data/spec/lib/hyrax/collections_migration_spec.rb +0 -34
- data/spec/routing/admin_sets_spec.rb +0 -7
- data/spec/search_builders/hyrax/active_works_search_builder_spec.rb +0 -53
- data/spec/services/hyrax/actor_factory_spec.rb +0 -55
- data/spec/services/hyrax/audit_failure_service_spec.rb +0 -26
- data/spec/services/hyrax/file_set_audit_service_spec.rb +0 -156
- data/spec/services/hyrax/import_url_success_service_spec.rb +0 -20
- data/spec/services/hyrax/repository_audit_service_spec.rb +0 -17
- data/spec/support/locations.rb +0 -17
- data/spec/support/proxies.rb +0 -15
- data/spec/views/_toolbar.html.erb_spec.rb +0 -93
- data/spec/views/hyrax/collections/_form.html.erb_spec.rb +0 -33
- data/spec/views/hyrax/collections/_form_for_select_collection.html.erb_spec.rb +0 -51
- data/spec/views/hyrax/dashboard/create_work_action.html.erb_spec.rb +0 -27
- data/spec/views/hyrax/dashboard/index_spec.rb +0 -169
- data/vendor/assets/javascripts/jquery.validate.js +0 -1248
@@ -1,34 +1,50 @@
|
|
1
|
-
require 'spec_helper'
|
2
1
|
require 'redlock'
|
3
2
|
|
4
|
-
describe Hyrax::Actors::FileSetActor do
|
3
|
+
RSpec.describe Hyrax::Actors::FileSetActor do
|
5
4
|
include ActionDispatch::TestProcess
|
6
5
|
|
7
|
-
let(:user)
|
8
|
-
let(:
|
9
|
-
let(:
|
10
|
-
let(:
|
11
|
-
let(:
|
12
|
-
let(:
|
6
|
+
let(:user) { create(:user) }
|
7
|
+
let(:file_path) { File.join(fixture_path, 'world.png') }
|
8
|
+
let(:file) { fixture_file_upload(file_path, 'image/png') } # we will override for the different types of File objects
|
9
|
+
let(:local_file) { File.open(file_path) }
|
10
|
+
let(:file_set) { create(:file_set, content: local_file) }
|
11
|
+
let(:actor) { described_class.new(file_set, user) }
|
12
|
+
let(:relation) { :original_file }
|
13
|
+
let(:file_actor) { Hyrax::Actors::FileActor.new(file_set, relation, user) }
|
14
|
+
|
15
|
+
before { allow(CharacterizeJob).to receive(:perform_later) } # not testing that
|
16
|
+
|
17
|
+
describe 'private' do
|
18
|
+
let(:file_set) { build(:file_set) } # avoid 130+ LDP requests
|
19
|
+
|
20
|
+
describe '#assign_visibility?' do
|
21
|
+
let(:viz) { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC }
|
22
|
+
|
23
|
+
it 'without params, returns false' do
|
24
|
+
expect(actor.send(:assign_visibility?)).to eq false
|
25
|
+
end
|
26
|
+
it 'with string-keyed or symbol-keyed visibility, returns true' do
|
27
|
+
expect(actor.send(:assign_visibility?, visibility: viz)).to eq true
|
28
|
+
expect(actor.send(:assign_visibility?, 'visibility' => viz)).to eq true
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
13
32
|
|
14
33
|
describe 'creating metadata, content and attaching to a work' do
|
15
|
-
let(:
|
16
|
-
let(:work) { nil }
|
17
|
-
subject { file_set.reload }
|
34
|
+
let(:work) { create(:generic_work) }
|
18
35
|
let(:date_today) { DateTime.current }
|
19
36
|
|
37
|
+
subject { file_set.reload }
|
38
|
+
|
20
39
|
before do
|
21
40
|
allow(DateTime).to receive(:current).and_return(date_today)
|
22
|
-
expect(IngestFileJob).to receive(:perform_later).with(file_set, /world\.png/, user, ingest_options)
|
23
41
|
allow(actor).to receive(:acquire_lock_for).and_yield
|
24
42
|
actor.create_metadata
|
25
|
-
actor.create_content(
|
26
|
-
actor.
|
43
|
+
actor.create_content(file)
|
44
|
+
actor.attach_to_work(work)
|
27
45
|
end
|
28
46
|
|
29
47
|
context 'when a work is provided' do
|
30
|
-
let(:work) { create(:generic_work) }
|
31
|
-
|
32
48
|
it 'adds the FileSet to the parent work' do
|
33
49
|
expect(subject.parents).to eq [work]
|
34
50
|
expect(work.reload.file_sets).to include(subject)
|
@@ -46,36 +62,28 @@ describe Hyrax::Actors::FileSetActor do
|
|
46
62
|
end
|
47
63
|
end
|
48
64
|
|
49
|
-
describe
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
allow(actor).to receive(:acquire_lock_for).and_yield
|
54
|
-
actor.attach_file_to_work(work)
|
55
|
-
saved_file = file_set.reload
|
56
|
-
expect(saved_file.visibility).to eq Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
|
65
|
+
describe '#create_content' do
|
66
|
+
before do
|
67
|
+
expect(JobIoWrapper).to receive(:create_with_varied_file_handling!).with(any_args).and_return(JobIoWrapper.new)
|
68
|
+
expect(IngestJob).to receive(:perform_later).with(JobIoWrapper)
|
57
69
|
end
|
58
|
-
end
|
59
70
|
|
60
|
-
|
61
|
-
|
62
|
-
expect(IngestFileJob).to receive(:perform_later).with(file_set, /world\.png/, user, ingest_options)
|
63
|
-
actor.create_content(uploaded_file)
|
71
|
+
it 'calls ingest_file' do
|
72
|
+
actor.create_content(file)
|
64
73
|
end
|
65
74
|
|
66
75
|
context 'when an alternative relationship is specified' do
|
67
|
-
let(:
|
68
|
-
|
69
|
-
|
70
|
-
actor.create_content(
|
76
|
+
let(:relation) { :remastered }
|
77
|
+
|
78
|
+
it 'calls ingest_file' do
|
79
|
+
actor.create_content(file, :remastered)
|
71
80
|
end
|
72
81
|
end
|
73
82
|
|
74
83
|
context 'using ::File' do
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
end
|
84
|
+
let(:file) { local_file }
|
85
|
+
|
86
|
+
before { actor.create_content(local_file) }
|
79
87
|
|
80
88
|
it 'sets the label and title' do
|
81
89
|
expect(file_set.label).to eq(File.basename(local_file))
|
@@ -88,21 +96,15 @@ describe Hyrax::Actors::FileSetActor do
|
|
88
96
|
end
|
89
97
|
|
90
98
|
context 'when file_set.title is empty and file_set.label is not' do
|
91
|
-
let(:
|
92
|
-
|
93
|
-
|
94
|
-
'messes up the display of the page which should not need ' \
|
95
|
-
'to be this big in order to show this impossibly long, ' \
|
96
|
-
'long, long, oh so long string'
|
99
|
+
let(:long_name) do
|
100
|
+
'an absurdly long title that goes on way to long and messes up the display of the page which should not need ' \
|
101
|
+
'to be this big in order to show this impossibly long, long, long, oh so long string'
|
97
102
|
end
|
98
103
|
let(:short_name) { 'Nice Short Name' }
|
99
|
-
let(:actor) { described_class.new(file_set, user) }
|
100
104
|
|
101
105
|
before do
|
102
|
-
allow(IngestFileJob).to receive(:perform_later)
|
103
106
|
allow(file_set).to receive(:label).and_return(short_name)
|
104
|
-
|
105
|
-
actor.create_content(fixture_file_upload(file))
|
107
|
+
actor.create_content(file)
|
106
108
|
end
|
107
109
|
|
108
110
|
subject { file_set.title }
|
@@ -111,23 +113,22 @@ describe Hyrax::Actors::FileSetActor do
|
|
111
113
|
end
|
112
114
|
|
113
115
|
context 'when a label is already specified' do
|
114
|
-
let(:
|
115
|
-
let(:
|
116
|
-
let(:file_set_with_label) do
|
116
|
+
let(:label) { 'test_file.png' }
|
117
|
+
let(:file_set) do
|
117
118
|
FileSet.new do |f|
|
118
119
|
f.apply_depositor_metadata(user.user_key)
|
119
120
|
f.label = label
|
120
121
|
end
|
121
122
|
end
|
122
|
-
let(:actor) { described_class.new(
|
123
|
+
let(:actor) { described_class.new(file_set, user) }
|
123
124
|
|
124
125
|
before do
|
125
|
-
allow(
|
126
|
-
actor.create_content(
|
126
|
+
allow(IngestJob).to receive(:perform_later).with(JobIoWrapper)
|
127
|
+
actor.create_content(file)
|
127
128
|
end
|
128
129
|
|
129
130
|
it "retains the object's original label" do
|
130
|
-
expect(
|
131
|
+
expect(file_set.label).to eql(label)
|
131
132
|
end
|
132
133
|
end
|
133
134
|
end
|
@@ -140,26 +141,16 @@ describe Hyrax::Actors::FileSetActor do
|
|
140
141
|
end
|
141
142
|
|
142
143
|
describe "#update_content" do
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
allow(actor).to receive(:build_file_actor).with(relation).and_return(file_actor)
|
147
|
-
end
|
148
|
-
it 'calls ingest_file' do
|
149
|
-
expect(file_actor).to receive(:ingest_file).with(local_file, true)
|
150
|
-
actor.update_content(local_file)
|
144
|
+
it 'calls ingest_file and returns queued job' do
|
145
|
+
expect(IngestJob).to receive(:perform_later).with(any_args).and_return(IngestJob.new)
|
146
|
+
expect(actor.update_content(local_file)).to be_a(IngestJob)
|
151
147
|
end
|
152
148
|
it 'runs callbacks' do
|
153
|
-
# Do not bother ingesting the file -- test only
|
154
|
-
allow(file_actor).to receive(:ingest_file).with(
|
155
|
-
expect(
|
149
|
+
# Do not bother ingesting the file -- test only the result of callback
|
150
|
+
allow(file_actor).to receive(:ingest_file).with(any_args).and_return(double)
|
151
|
+
expect(ContentNewVersionEventJob).to receive(:perform_later).with(file_set, user)
|
156
152
|
actor.update_content(local_file)
|
157
153
|
end
|
158
|
-
it "returns true" do
|
159
|
-
# Do not bother ingesting the file -- test only the return value
|
160
|
-
allow(file_actor).to receive(:ingest_file).with(local_file, true)
|
161
|
-
expect(actor.update_content(local_file)).to be true
|
162
|
-
end
|
163
154
|
end
|
164
155
|
|
165
156
|
describe "#destroy" do
|
@@ -185,161 +176,97 @@ describe Hyrax::Actors::FileSetActor do
|
|
185
176
|
expect(gw.representative_id).to eq(file_set.id)
|
186
177
|
expect(gw.thumbnail_id).to eq(file_set.id)
|
187
178
|
expect { actor.destroy }.to change { ActiveFedora::Aggregation::Proxy.count }.by(-1)
|
188
|
-
gw
|
179
|
+
gw.reload
|
189
180
|
expect(gw.representative_id).to be_nil
|
190
181
|
expect(gw.thumbnail_id).to be_nil
|
191
182
|
end
|
192
183
|
end
|
193
184
|
end
|
194
185
|
|
195
|
-
describe "#
|
196
|
-
|
197
|
-
# stub out redis connection
|
198
|
-
client = double('redlock client')
|
199
|
-
allow(client).to receive(:lock).and_yield(true)
|
200
|
-
allow(Redlock::Client).to receive(:new).and_return(client)
|
201
|
-
end
|
202
|
-
|
203
|
-
# The first version of the work has no members.
|
204
|
-
let!(:work_v1) { create(:generic_work) }
|
205
|
-
|
206
|
-
# Create another version of the same work with a member.
|
207
|
-
let!(:work_v2) do
|
208
|
-
work = ActiveFedora::Base.find(work_v1.id)
|
209
|
-
work.ordered_members << create(:file_set)
|
210
|
-
work.save
|
211
|
-
work
|
212
|
-
end
|
213
|
-
|
214
|
-
it "writes to the most up to date version" do
|
215
|
-
actor.attach_file_to_work(work_v1, {})
|
216
|
-
expect(work_v1.members.size).to eq 2
|
217
|
-
end
|
218
|
-
end
|
219
|
-
|
220
|
-
describe "#assign_visibility?" do
|
221
|
-
context "when no params are specified" do
|
222
|
-
it "does not need to assign visibility" do
|
223
|
-
expect(actor.send(:assign_visibility?)).to eq false
|
224
|
-
end
|
225
|
-
end
|
226
|
-
|
227
|
-
context "when file set params with visibility are specified with symbols as keys" do
|
228
|
-
let(:file_set_params) { { visibility: Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC } }
|
229
|
-
|
230
|
-
it "does need to assign visibility" do
|
231
|
-
expect(actor.send(:assign_visibility?, file_set_params)).to eq true
|
232
|
-
end
|
233
|
-
end
|
234
|
-
|
235
|
-
context "when file set params with visibility are specified with strings as keys" do
|
236
|
-
let(:file_set_params) { { "visibility" => Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC } }
|
237
|
-
|
238
|
-
it "does need to assign visibility" do
|
239
|
-
expect(actor.send(:assign_visibility?, file_set_params)).to eq true
|
240
|
-
end
|
241
|
-
end
|
242
|
-
end
|
243
|
-
|
244
|
-
describe "#set_representative" do
|
245
|
-
let!(:work) { build(:generic_work, representative: rep) }
|
246
|
-
let!(:file_set) { build(:file_set) }
|
186
|
+
describe "#attach_to_work" do
|
187
|
+
let(:work) { build(:public_generic_work) }
|
247
188
|
|
248
189
|
before do
|
249
|
-
actor.
|
190
|
+
allow(actor).to receive(:acquire_lock_for).and_yield
|
250
191
|
end
|
251
192
|
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
it 'sets the representative' do
|
256
|
-
expect(work.representative).to eq file_set
|
257
|
-
end
|
193
|
+
it 'copies file_set visibility from the parent' do
|
194
|
+
actor.attach_to_work(work)
|
195
|
+
expect(file_set.reload.visibility).to eq Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
|
258
196
|
end
|
259
197
|
|
260
|
-
context '
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
expect(work.
|
198
|
+
context 'without representative and thumbnail' do
|
199
|
+
it 'assigns them (with persistence)' do
|
200
|
+
actor.attach_to_work(work)
|
201
|
+
expect(work.representative).to eq(file_set)
|
202
|
+
expect(work.thumbnail).to eq(file_set)
|
203
|
+
expect { work.reload }.not_to change { [work.representative, work.thumbnail] }
|
265
204
|
end
|
266
205
|
end
|
267
|
-
end
|
268
|
-
|
269
|
-
describe "#set_thumbnail" do
|
270
|
-
let!(:work) { build(:generic_work, thumbnail: thumb) }
|
271
|
-
let!(:file_set) { build(:file_set) }
|
272
206
|
|
273
|
-
|
274
|
-
|
207
|
+
context 'with representative and thumbnail' do
|
208
|
+
it 'does not (re)assign them' do
|
209
|
+
allow(work).to receive(:thumbnail_id).and_return('ab123c78h')
|
210
|
+
allow(work).to receive(:representative_id).and_return('zz365c78h')
|
211
|
+
expect(work).not_to receive(:representative=)
|
212
|
+
expect(work).not_to receive(:thumbnail=)
|
213
|
+
actor.attach_to_work(work)
|
214
|
+
end
|
275
215
|
end
|
276
216
|
|
277
|
-
context
|
278
|
-
let(:
|
217
|
+
context 'with multiple versions' do
|
218
|
+
let(:work_v1) { create(:generic_work) } # this version of the work has no members
|
279
219
|
|
280
|
-
|
281
|
-
|
220
|
+
before do # another version of the same work is saved with a member
|
221
|
+
work_v2 = ActiveFedora::Base.find(work_v1.id)
|
222
|
+
work_v2.ordered_members << create(:file_set)
|
223
|
+
work_v2.save!
|
282
224
|
end
|
283
|
-
end
|
284
|
-
|
285
|
-
context 'when the thumbnail is already set' do
|
286
|
-
let(:thumb) { build(:file_set, id: '123') }
|
287
225
|
|
288
|
-
it
|
289
|
-
|
226
|
+
it "writes to the most up to date version" do
|
227
|
+
actor.attach_to_work(work_v1)
|
228
|
+
expect(work_v1.members.size).to eq 2
|
290
229
|
end
|
291
230
|
end
|
292
231
|
end
|
293
232
|
|
294
233
|
describe "#file_actor_class" do
|
295
|
-
|
296
|
-
it "is a FileActor" do
|
297
|
-
expect(actor.file_actor_class).to eq(Hyrax::Actors::FileActor)
|
298
|
-
end
|
299
|
-
end
|
234
|
+
subject { actor.file_actor_class }
|
300
235
|
|
301
|
-
|
302
|
-
let(:actor) { CustomFileSetActor.new(file_set, user) }
|
236
|
+
it { is_expected.to eq(Hyrax::Actors::FileActor) }
|
303
237
|
|
304
|
-
|
305
|
-
|
238
|
+
context "overridden" do
|
239
|
+
let(:custom_fs_actor_class) do
|
240
|
+
class ::CustomFileActor < Hyrax::Actors::FileActor
|
306
241
|
end
|
307
|
-
|
242
|
+
Class.new(described_class) do
|
308
243
|
def file_actor_class
|
309
244
|
CustomFileActor
|
310
245
|
end
|
311
246
|
end
|
312
247
|
end
|
248
|
+
let(:actor) { custom_fs_actor_class.new(file_set, user) }
|
313
249
|
|
314
|
-
after
|
315
|
-
|
316
|
-
Object.send(:remove_const, :CustomFileSetActor)
|
317
|
-
end
|
318
|
-
|
319
|
-
it "is a custom class" do
|
320
|
-
expect(actor.file_actor_class).to eq(CustomFileActor)
|
321
|
-
end
|
250
|
+
after { Object.send(:remove_const, :CustomFileActor) }
|
251
|
+
it { is_expected.to eq(CustomFileActor) }
|
322
252
|
end
|
323
253
|
end
|
324
254
|
|
325
255
|
describe '#revert_content' do
|
326
256
|
let(:file_set) { create(:file_set, user: user) }
|
327
257
|
let(:file1) { "small_file.txt" }
|
328
|
-
let(:file2) { "hyrax_generic_stub.txt" }
|
329
258
|
let(:version1) { "version1" }
|
259
|
+
let(:restored_content) { file_set.reload.original_file }
|
330
260
|
|
331
261
|
before do
|
332
262
|
original_adapter = ActiveJob::Base.queue_adapter
|
333
263
|
ActiveJob::Base.queue_adapter = :inline
|
334
|
-
allow(CharacterizeJob).to receive(:perform_later)
|
335
264
|
actor.create_content(fixture_file_upload(file1))
|
336
|
-
actor.create_content(fixture_file_upload(
|
265
|
+
actor.create_content(fixture_file_upload('hyrax_generic_stub.txt'))
|
337
266
|
ActiveJob::Base.queue_adapter = original_adapter
|
338
267
|
actor.file_set.reload
|
339
268
|
end
|
340
269
|
|
341
|
-
let(:restored_content) { file_set.reload.original_file }
|
342
|
-
|
343
270
|
it "restores the first versions's content and metadata" do
|
344
271
|
actor.revert_content(version1)
|
345
272
|
expect(restored_content.original_name).to eq file1
|
@@ -1,12 +1,11 @@
|
|
1
|
-
require 'spec_helper'
|
2
1
|
require 'redlock'
|
3
2
|
|
4
|
-
describe Hyrax::Actors::GenericWorkActor do
|
3
|
+
RSpec.describe Hyrax::Actors::GenericWorkActor do
|
5
4
|
include ActionDispatch::TestProcess
|
6
|
-
|
5
|
+
let(:env) { Hyrax::Actors::Environment.new(curation_concern, ability, attributes) }
|
7
6
|
let(:user) { create(:user) }
|
8
|
-
let(:
|
9
|
-
let(:
|
7
|
+
let(:ability) { ::Ability.new(user) }
|
8
|
+
let(:admin_set) { build(:admin_set, with_permission_template: { with_active_workflow: true }) }
|
10
9
|
# stub out redis connection
|
11
10
|
let(:redlock_client_stub) do
|
12
11
|
client = double('redlock client')
|
@@ -15,24 +14,39 @@ describe Hyrax::Actors::GenericWorkActor do
|
|
15
14
|
client
|
16
15
|
end
|
17
16
|
|
18
|
-
subject
|
19
|
-
Hyrax::CurationConcern.actor(curation_concern, ::Ability.new(user))
|
20
|
-
end
|
21
|
-
|
22
|
-
let(:admin_set) { create(:admin_set, with_permission_template: { with_active_workflow: true }) }
|
17
|
+
subject { Hyrax::CurationConcern.actor }
|
23
18
|
|
24
19
|
describe '#create' do
|
25
|
-
let(:curation_concern) {
|
20
|
+
let(:curation_concern) { create(:generic_work, user: user) }
|
26
21
|
let(:xmas) { DateTime.parse('2014-12-25 11:30').iso8601 }
|
22
|
+
let(:attributes) { {} }
|
23
|
+
let(:file) { fixture_file_upload('/world.png', 'image/png') }
|
24
|
+
let(:uploaded_file) { Hyrax::UploadedFile.create(file: file, user: user) }
|
25
|
+
let(:terminator) { Hyrax::Actors::Terminator.new }
|
26
|
+
|
27
|
+
subject(:middleware) do
|
28
|
+
stack = ActionDispatch::MiddlewareStack.new.tap do |middleware|
|
29
|
+
middleware.use Hyrax::Actors::CreateWithFilesActor
|
30
|
+
middleware.use Hyrax::Actors::AddToWorkActor
|
31
|
+
middleware.use Hyrax::Actors::InterpretVisibilityActor
|
32
|
+
middleware.use described_class
|
33
|
+
end
|
34
|
+
stack.build(terminator)
|
35
|
+
end
|
36
|
+
|
37
|
+
before do
|
38
|
+
allow(terminator).to receive(:create).and_return(true)
|
39
|
+
end
|
27
40
|
|
28
41
|
context 'failure' do
|
29
42
|
before do
|
30
|
-
allow(
|
43
|
+
allow(middleware).to receive(:attach_files).and_return(true)
|
31
44
|
end
|
32
45
|
|
33
|
-
|
46
|
+
# The clean is here because this test depends on the repo not having an AdminSet/PermissionTemplate created yet
|
47
|
+
it 'returns false', :clean_repo do
|
34
48
|
expect(curation_concern).to receive(:save).and_return(false)
|
35
|
-
expect(
|
49
|
+
expect(middleware.create(env)).to be false
|
36
50
|
end
|
37
51
|
end
|
38
52
|
|
@@ -40,17 +54,19 @@ describe Hyrax::Actors::GenericWorkActor do
|
|
40
54
|
before do
|
41
55
|
redlock_client_stub
|
42
56
|
end
|
57
|
+
let(:attributes) { { title: ['Foo Bar'], admin_set_id: admin_set.id } }
|
43
58
|
|
44
59
|
it "invokes the after_create_concern callback" do
|
45
60
|
allow(CharacterizeJob).to receive(:perform_later).and_return(true)
|
46
61
|
expect(Hyrax.config.callback).to receive(:run)
|
47
62
|
.with(:after_create_concern, curation_concern, user)
|
48
|
-
|
63
|
+
middleware.create(env)
|
49
64
|
end
|
50
65
|
end
|
51
66
|
|
52
67
|
context 'valid attributes' do
|
53
68
|
let(:visibility) { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED }
|
69
|
+
|
54
70
|
before do
|
55
71
|
redlock_client_stub
|
56
72
|
end
|
@@ -58,26 +74,26 @@ describe Hyrax::Actors::GenericWorkActor do
|
|
58
74
|
context 'with embargo' do
|
59
75
|
context "with attached files" do
|
60
76
|
let(:date) { Time.zone.today + 2 }
|
77
|
+
let(:uploaded_file_ids) { [uploaded_file.id] }
|
61
78
|
let(:attributes) do
|
62
79
|
{ title: ['New embargo'], visibility: Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_EMBARGO,
|
63
80
|
visibility_during_embargo: 'authenticated', embargo_release_date: date.to_s,
|
64
81
|
visibility_after_embargo: 'open', visibility_during_lease: 'open',
|
65
82
|
lease_expiration_date: '2014-06-12', visibility_after_lease: 'restricted',
|
66
83
|
admin_set_id: admin_set.id,
|
67
|
-
|
68
|
-
|
69
|
-
],
|
70
|
-
rights: ['http://creativecommons.org/licenses/by/3.0/us/'] }
|
84
|
+
uploaded_files: uploaded_file_ids,
|
85
|
+
license: ['http://creativecommons.org/licenses/by/3.0/us/'] }
|
71
86
|
end
|
72
87
|
|
73
88
|
it "applies embargo to attached files" do
|
74
89
|
allow(CharacterizeJob).to receive(:perform_later).and_return(true)
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
expect(
|
79
|
-
expect(
|
80
|
-
expect(
|
90
|
+
middleware.create(env)
|
91
|
+
curation_concern.reload
|
92
|
+
file_set = curation_concern.file_sets.first
|
93
|
+
expect(file_set).to be_persisted
|
94
|
+
expect(file_set.visibility_during_embargo).to eq 'authenticated'
|
95
|
+
expect(file_set.visibility_after_embargo).to eq 'open'
|
96
|
+
expect(file_set.visibility).to eq 'authenticated'
|
81
97
|
end
|
82
98
|
end
|
83
99
|
end
|
@@ -85,31 +101,33 @@ describe Hyrax::Actors::GenericWorkActor do
|
|
85
101
|
context 'with in_work_ids' do
|
86
102
|
let(:parent) { create(:generic_work, user: user) }
|
87
103
|
let(:attributes) do
|
88
|
-
|
104
|
+
FactoryGirl.attributes_for(:generic_work, visibility: visibility, admin_set_id: admin_set.id).merge(
|
89
105
|
in_works_ids: [parent.id]
|
90
106
|
)
|
91
107
|
end
|
108
|
+
|
92
109
|
it "attaches the parent" do
|
93
110
|
allow_any_instance_of(Hyrax::Actors::AddToWorkActor).to receive(:can_edit_both_works?).and_return(true)
|
94
|
-
expect(
|
95
|
-
expect(curation_concern.in_works).to eq [parent]
|
111
|
+
expect(middleware.create(env)).to be true
|
112
|
+
expect(curation_concern.reload.in_works).to eq [parent]
|
96
113
|
end
|
97
114
|
it "does not attach the parent" do
|
98
115
|
allow_any_instance_of(Hyrax::Actors::AddToWorkActor).to receive(:can_edit_both_works?).and_return(false)
|
99
|
-
expect(
|
100
|
-
expect(curation_concern.in_works).to eq []
|
116
|
+
expect(middleware.create(env)).to be false
|
117
|
+
expect(curation_concern.reload.in_works).to eq []
|
101
118
|
end
|
102
119
|
end
|
103
120
|
|
104
121
|
context 'with a file' do
|
105
122
|
let(:attributes) do
|
106
|
-
|
107
|
-
a[:
|
123
|
+
FactoryGirl.attributes_for(:generic_work, admin_set_id: admin_set.id, visibility: visibility).tap do |a|
|
124
|
+
a[:uploaded_files] = [uploaded_file.id]
|
108
125
|
end
|
109
126
|
end
|
110
127
|
|
111
128
|
context 'authenticated visibility' do
|
112
129
|
let(:file_actor) { double }
|
130
|
+
|
113
131
|
before do
|
114
132
|
allow(Hyrax::TimeService).to receive(:time_in_utc) { xmas }
|
115
133
|
allow(Hyrax::Actors::FileActor).to receive(:new).and_return(file_actor)
|
@@ -120,7 +138,8 @@ describe Hyrax::Actors::GenericWorkActor do
|
|
120
138
|
expect(Hyrax.config.callback).to receive(:run).with(:after_create_fileset, FileSet, user)
|
121
139
|
|
122
140
|
expect(file_actor).to receive(:ingest_file).and_return(true)
|
123
|
-
expect(
|
141
|
+
expect(middleware.create(env)).to be true
|
142
|
+
curation_concern.reload
|
124
143
|
expect(curation_concern).to be_persisted
|
125
144
|
expect(curation_concern.date_uploaded).to eq xmas
|
126
145
|
expect(curation_concern.date_modified).to eq xmas
|
@@ -137,9 +156,10 @@ describe Hyrax::Actors::GenericWorkActor do
|
|
137
156
|
|
138
157
|
context 'with multiple files' do
|
139
158
|
let(:file_actor) { double }
|
159
|
+
let(:uploaded_file2) { Hyrax::UploadedFile.create(file: file, user: user) }
|
140
160
|
let(:attributes) do
|
141
|
-
|
142
|
-
a[:
|
161
|
+
FactoryGirl.attributes_for(:generic_work, admin_set_id: admin_set.id, visibility: visibility).tap do |a|
|
162
|
+
a[:uploaded_files] = [uploaded_file.id, uploaded_file2.id]
|
143
163
|
end
|
144
164
|
end
|
145
165
|
|
@@ -152,7 +172,8 @@ describe Hyrax::Actors::GenericWorkActor do
|
|
152
172
|
it 'stamps each file with the access rights' do
|
153
173
|
expect(file_actor).to receive(:ingest_file).and_return(true).twice
|
154
174
|
|
155
|
-
expect(
|
175
|
+
expect(middleware.create(env)).to be true
|
176
|
+
curation_concern.reload
|
156
177
|
expect(curation_concern).to be_persisted
|
157
178
|
expect(curation_concern.date_uploaded).to eq xmas
|
158
179
|
expect(curation_concern.date_modified).to eq xmas
|
@@ -168,11 +189,11 @@ describe Hyrax::Actors::GenericWorkActor do
|
|
168
189
|
|
169
190
|
context 'with a present and a blank title' do
|
170
191
|
let(:attributes) do
|
171
|
-
|
192
|
+
FactoryGirl.attributes_for(:generic_work, admin_set_id: admin_set.id, title: ['this is present', ''])
|
172
193
|
end
|
173
194
|
|
174
195
|
it 'stamps each link with the access rights' do
|
175
|
-
expect(
|
196
|
+
expect(middleware.create(env)).to be true
|
176
197
|
expect(curation_concern).to be_persisted
|
177
198
|
expect(curation_concern.title).to eq ['this is present']
|
178
199
|
end
|
@@ -188,15 +209,17 @@ describe Hyrax::Actors::GenericWorkActor do
|
|
188
209
|
|
189
210
|
it 'returns false' do
|
190
211
|
expect(curation_concern).to receive(:save).and_return(false)
|
191
|
-
expect(subject.update(
|
212
|
+
expect(subject.update(env)).to be false
|
192
213
|
end
|
193
214
|
end
|
194
215
|
|
195
216
|
context 'success' do
|
217
|
+
let(:attributes) { { title: ['Other Title'] } }
|
218
|
+
|
196
219
|
it "invokes the after_update_metadata callback" do
|
197
220
|
expect(Hyrax.config.callback).to receive(:run)
|
198
221
|
.with(:after_update_metadata, curation_concern, user)
|
199
|
-
subject.update(
|
222
|
+
subject.update(env)
|
200
223
|
end
|
201
224
|
end
|
202
225
|
|
@@ -204,27 +227,30 @@ describe Hyrax::Actors::GenericWorkActor do
|
|
204
227
|
let(:parent) { create(:generic_work, user: user) }
|
205
228
|
let(:old_parent) { create(:generic_work, user: user) }
|
206
229
|
let(:attributes) do
|
207
|
-
|
230
|
+
FactoryGirl.attributes_for(:generic_work).merge(
|
208
231
|
in_works_ids: [parent.id]
|
209
232
|
)
|
210
233
|
end
|
234
|
+
|
211
235
|
before do
|
212
236
|
old_parent.ordered_members << curation_concern
|
213
237
|
old_parent.save!
|
214
238
|
end
|
215
239
|
it "attaches the parent" do
|
216
|
-
expect(subject.update(
|
240
|
+
expect(subject.update(env)).to be true
|
217
241
|
expect(curation_concern.in_works).to eq [parent]
|
218
242
|
expect(old_parent.reload.members).to eq []
|
219
243
|
end
|
220
244
|
end
|
245
|
+
|
221
246
|
context 'without in_works_ids' do
|
222
|
-
let(:old_parent) {
|
247
|
+
let(:old_parent) { FactoryGirl.create(:generic_work) }
|
223
248
|
let(:attributes) do
|
224
|
-
|
249
|
+
FactoryGirl.attributes_for(:generic_work).merge(
|
225
250
|
in_works_ids: []
|
226
251
|
)
|
227
252
|
end
|
253
|
+
|
228
254
|
before do
|
229
255
|
curation_concern.apply_depositor_metadata(user.user_key)
|
230
256
|
curation_concern.save!
|
@@ -233,18 +259,20 @@ describe Hyrax::Actors::GenericWorkActor do
|
|
233
259
|
end
|
234
260
|
it "removes the old parent" do
|
235
261
|
allow(curation_concern).to receive(:depositor).and_return(old_parent.depositor)
|
236
|
-
expect(subject.update(
|
262
|
+
expect(subject.update(env)).to be true
|
237
263
|
expect(curation_concern.in_works).to eq []
|
238
264
|
expect(old_parent.reload.members).to eq []
|
239
265
|
end
|
240
266
|
end
|
267
|
+
|
241
268
|
context 'with nil in_works_ids' do
|
242
|
-
let(:parent) {
|
269
|
+
let(:parent) { FactoryGirl.create(:generic_work) }
|
243
270
|
let(:attributes) do
|
244
|
-
|
271
|
+
FactoryGirl.attributes_for(:generic_work).merge(
|
245
272
|
in_works_ids: nil
|
246
273
|
)
|
247
274
|
end
|
275
|
+
|
248
276
|
before do
|
249
277
|
curation_concern.apply_depositor_metadata(user.user_key)
|
250
278
|
curation_concern.save!
|
@@ -252,16 +280,18 @@ describe Hyrax::Actors::GenericWorkActor do
|
|
252
280
|
parent.save!
|
253
281
|
end
|
254
282
|
it "does nothing" do
|
255
|
-
expect(subject.update(
|
283
|
+
expect(subject.update(env)).to be true
|
256
284
|
expect(curation_concern.in_works).to eq [parent]
|
257
285
|
end
|
258
286
|
end
|
287
|
+
|
259
288
|
context 'adding to collections' do
|
260
289
|
let!(:collection1) { create(:collection, user: user) }
|
261
290
|
let!(:collection2) { create(:collection, user: user) }
|
262
291
|
let(:attributes) do
|
263
|
-
|
292
|
+
FactoryGirl.attributes_for(:generic_work, member_of_collection_ids: [collection2.id])
|
264
293
|
end
|
294
|
+
|
265
295
|
before do
|
266
296
|
curation_concern.apply_depositor_metadata(user.user_key)
|
267
297
|
curation_concern.member_of_collections = [collection1]
|
@@ -273,7 +303,7 @@ describe Hyrax::Actors::GenericWorkActor do
|
|
273
303
|
expect(curation_concern.member_of_collection_ids).to eq [collection1.id]
|
274
304
|
# before running actor.update, the work is in collection1
|
275
305
|
|
276
|
-
expect(subject.update(
|
306
|
+
expect(subject.update(env)).to be true
|
277
307
|
|
278
308
|
curation_concern.reload
|
279
309
|
expect(curation_concern.identifier).to be_blank
|
@@ -288,11 +318,12 @@ describe Hyrax::Actors::GenericWorkActor do
|
|
288
318
|
let(:file_set2) { create(:file_set) }
|
289
319
|
let(:curation_concern) { create(:generic_work, user: user, ordered_members: [file_set1, file_set2], admin_set_id: admin_set.id) }
|
290
320
|
let(:attributes) do
|
291
|
-
|
321
|
+
FactoryGirl.attributes_for(:generic_work, ordered_member_ids: [file_set2.id, file_set1.id])
|
292
322
|
end
|
323
|
+
|
293
324
|
it 'updates the order of file sets' do
|
294
325
|
expect(curation_concern.ordered_members.to_a).to eq [file_set1, file_set2]
|
295
|
-
expect(subject.update(
|
326
|
+
expect(subject.update(env)).to be true
|
296
327
|
|
297
328
|
curation_concern.reload
|
298
329
|
expect(curation_concern.ordered_members.to_a).to eq [file_set2, file_set1]
|
@@ -300,12 +331,13 @@ describe Hyrax::Actors::GenericWorkActor do
|
|
300
331
|
## Is this something we want to support?
|
301
332
|
context "when told to stop ordering a file set" do
|
302
333
|
let(:attributes) do
|
303
|
-
|
334
|
+
FactoryGirl.attributes_for(:generic_work, ordered_member_ids: [file_set2.id])
|
304
335
|
end
|
336
|
+
|
305
337
|
it "works" do
|
306
338
|
expect(curation_concern.ordered_members.to_a).to eq [file_set1, file_set2]
|
307
339
|
|
308
|
-
expect(subject.update(
|
340
|
+
expect(subject.update(env)).to be true
|
309
341
|
|
310
342
|
curation_concern.reload
|
311
343
|
expect(curation_concern.ordered_members.to_a).to eq [file_set2]
|