curation_concerns 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/.rspec +2 -0
- data/.travis.yml +18 -0
- data/Gemfile +31 -0
- data/LICENSE.txt +15 -0
- data/README.md +46 -0
- data/RELEASING.md +2 -0
- data/Rakefile +26 -0
- data/VERSION +1 -0
- data/app/assets/images/default.png +0 -0
- data/app/assets/images/nope.png +0 -0
- data/app/assets/javascripts/.gitkeep +0 -0
- data/app/assets/javascripts/curation_concerns/.gitkeep +0 -0
- data/app/assets/javascripts/curation_concerns/application.js +18 -0
- data/app/assets/javascripts/curation_concerns/browse_everything_implement.js +7 -0
- data/app/assets/javascripts/curation_concerns/curation_concerns.js +28 -0
- data/app/assets/javascripts/curation_concerns/embargoes.js +17 -0
- data/app/assets/javascripts/curation_concerns/facet_mine.js +22 -0
- data/app/assets/javascripts/curation_concerns/help_modal.js +36 -0
- data/app/assets/javascripts/curation_concerns/link_groups.js.coffee +123 -0
- data/app/assets/javascripts/curation_concerns/link_users.js.coffee +126 -0
- data/app/assets/javascripts/curation_concerns/proxy_rights.js.coffee +95 -0
- data/app/assets/javascripts/curation_concerns/proxy_submission.js +23 -0
- data/app/assets/javascripts/curation_concerns/select_works.js.coffee +20 -0
- data/app/assets/javascripts/modernizr.js +3 -0
- data/app/assets/stylesheets/curation_concerns/_curation_concerns.scss +9 -0
- data/app/assets/stylesheets/curation_concerns/_global-variables.scss +5 -0
- data/app/assets/stylesheets/curation_concerns/_modules.scss +13 -0
- data/app/assets/stylesheets/curation_concerns/_positioning.scss +138 -0
- data/app/assets/stylesheets/curation_concerns/_theme.scss +46 -0
- data/app/assets/stylesheets/curation_concerns/_typography.scss +137 -0
- data/app/assets/stylesheets/curation_concerns/_variables_bootstrap.scss +7 -0
- data/app/assets/stylesheets/curation_concerns/downloads.scss +3 -0
- data/app/assets/stylesheets/curation_concerns/help_requests.scss +3 -0
- data/app/assets/stylesheets/curation_concerns/modules/accessibility.scss +50 -0
- data/app/assets/stylesheets/curation_concerns/modules/accordion.scss +33 -0
- data/app/assets/stylesheets/curation_concerns/modules/attributes.scss +31 -0
- data/app/assets/stylesheets/curation_concerns/modules/classify_work.scss +100 -0
- data/app/assets/stylesheets/curation_concerns/modules/embargoes.scss +15 -0
- data/app/assets/stylesheets/curation_concerns/modules/emphatic_action_area.scss +14 -0
- data/app/assets/stylesheets/curation_concerns/modules/forms.scss +116 -0
- data/app/assets/stylesheets/curation_concerns/modules/multi_value_fields.scss +52 -0
- data/app/assets/stylesheets/curation_concerns/modules/pagination.scss +4 -0
- data/app/assets/stylesheets/curation_concerns/modules/search_results.scss +55 -0
- data/app/assets/stylesheets/curation_concerns/modules/site_actions.scss +53 -0
- data/app/assets/stylesheets/curation_concerns/modules/site_search.scss +46 -0
- data/app/controllers/catalog_controller.rb +3 -0
- data/app/controllers/collections_controller.rb +3 -0
- data/app/controllers/concerns/curation_concerns/application_controller_behavior.rb +28 -0
- data/app/controllers/concerns/curation_concerns/catalog_controller.rb +321 -0
- data/app/controllers/concerns/curation_concerns/collections_controller_behavior.rb +76 -0
- data/app/controllers/concerns/curation_concerns/curation_concern_controller.rb +125 -0
- data/app/controllers/concerns/curation_concerns/download_behavior.rb +60 -0
- data/app/controllers/concerns/curation_concerns/embargoes_controller_behavior.rb +44 -0
- data/app/controllers/concerns/curation_concerns/generic_files_controller_behavior.rb +149 -0
- data/app/controllers/concerns/curation_concerns/leases_controller_behavior.rb +36 -0
- data/app/controllers/concerns/curation_concerns/manages_embargoes.rb +26 -0
- data/app/controllers/concerns/curation_concerns/parent_container.rb +33 -0
- data/app/controllers/concerns/curation_concerns/themed_layout_controller.rb +31 -0
- data/app/controllers/concerns/curation_concerns/without_namespace.rb +15 -0
- data/app/controllers/curation_concerns/application_controller.rb +7 -0
- data/app/controllers/curation_concerns/classify_concerns_controller.rb +35 -0
- data/app/controllers/curation_concerns/generic_files_controller.rb +13 -0
- data/app/controllers/curation_concerns/permissions_controller.rb +19 -0
- data/app/controllers/downloads_controller.rb +4 -0
- data/app/controllers/embargoes_controller.rb +5 -0
- data/app/controllers/leases_controller.rb +5 -0
- data/app/controllers/registrations_controller.rb +20 -0
- data/app/controllers/sessions_controller.rb +4 -0
- data/app/datastreams/curation_concerns/generic_work_rdf_properties.rb +57 -0
- data/app/datastreams/generic_work_metadata.rb +3 -0
- data/app/forms/curation_concerns/forms/collection_edit_form.rb +17 -0
- data/app/forms/curation_concerns/forms/generic_file_edit_form.rb +15 -0
- data/app/forms/curation_concerns/forms/generic_work_edit_form.rb +9 -0
- data/app/helpers/curation_concerns/ability_helper.rb +46 -0
- data/app/helpers/curation_concerns/attribute_helper.rb +67 -0
- data/app/helpers/curation_concerns/catalog_helper.rb +38 -0
- data/app/helpers/curation_concerns/collections_helper.rb +63 -0
- data/app/helpers/curation_concerns/embargo_helper.rb +17 -0
- data/app/helpers/curation_concerns/generic_file_helper.rb +19 -0
- data/app/helpers/curation_concerns/lease_helper.rb +18 -0
- data/app/helpers/curation_concerns/main_app_helpers.rb +13 -0
- data/app/helpers/curation_concerns/render_constraints_helper.rb +42 -0
- data/app/helpers/curation_concerns/search_paths_helper.rb +13 -0
- data/app/helpers/curation_concerns/thumbnail_helper.rb +11 -0
- data/app/helpers/curation_concerns/title_helper.rb +23 -0
- data/app/helpers/curation_concerns/url_helper.rb +29 -0
- data/app/presenters/curation_concerns/collection_presenter.rb +40 -0
- data/app/presenters/curation_concerns/generic_file_presenter.rb +14 -0
- data/app/presenters/curation_concerns/generic_work_presenter.rb +13 -0
- data/app/search_builders/curation_concerns/search_builder.rb +49 -0
- data/app/services/curation_concerns/curation_concern.rb +14 -0
- data/app/services/curation_concerns/embargo_service.rb +26 -0
- data/app/services/curation_concerns/lease_service.rb +23 -0
- data/app/views/catalog/_action_menu_partials/_collection.html.erb +27 -0
- data/app/views/catalog/_action_menu_partials/_default.html.erb +27 -0
- data/app/views/catalog/_document.html.erb +3 -0
- data/app/views/catalog/_document_list.html.erb +5 -0
- data/app/views/catalog/_home_text.html.erb +8 -0
- data/app/views/catalog/_index_default.html.erb +17 -0
- data/app/views/catalog/_index_header_list_default.html.erb +8 -0
- data/app/views/catalog/_navbar.html.erb +12 -0
- data/app/views/catalog/_show_partials/_default.html.erb +22 -0
- data/app/views/catalog/_show_partials/_default_details.html.erb +15 -0
- data/app/views/catalog/_show_partials/_facets.html.erb +52 -0
- data/app/views/catalog/index.html.erb +47 -0
- data/app/views/collections/_add_to_collection_modal.html.erb +15 -0
- data/app/views/collections/_batch_edits_actions.html.erb +3 -0
- data/app/views/collections/_button_for_creating_empty_collection.html.erb +3 -0
- data/app/views/collections/_collection.html.erb +1 -0
- data/app/views/collections/_dashboard_document_list.html.erb +6 -0
- data/app/views/collections/_document_list.html.erb +7 -0
- data/app/views/collections/_edit_actions.html.erb +5 -0
- data/app/views/collections/_edit_descriptions.html.erb +20 -0
- data/app/views/collections/_form.html.erb +26 -0
- data/app/views/collections/_form_additional_information.html.erb +6 -0
- data/app/views/collections/_form_for_select_collection.html.erb +34 -0
- data/app/views/collections/_form_permission.html.erb +36 -0
- data/app/views/collections/_form_representative_image.html.erb +13 -0
- data/app/views/collections/_form_required_information.html.erb +11 -0
- data/app/views/collections/_form_to_add_member.html.erb +21 -0
- data/app/views/collections/_identifier_and_action.html.erb +15 -0
- data/app/views/collections/_media_display.html.erb +1 -0
- data/app/views/collections/_paginate.html.erb +6 -0
- data/app/views/collections/_search_collection_dashboard_form.html.erb +10 -0
- data/app/views/collections/_show_actions.html.erb +8 -0
- data/app/views/collections/_show_descriptions.html.erb +10 -0
- data/app/views/collections/_show_fields.html.erb +0 -0
- data/app/views/collections/_single_item_action_fields.html.erb +6 -0
- data/app/views/collections/_sort_and_per_page.html.erb +29 -0
- data/app/views/collections/_view_type_group.html.erb +13 -0
- data/app/views/collections/edit.html.erb +17 -0
- data/app/views/collections/show.html.erb +24 -0
- data/app/views/curation_concerns/base/_attributes.html.erb +25 -0
- data/app/views/curation_concerns/base/_collections.html.erb +26 -0
- data/app/views/curation_concerns/base/_form.html.erb +25 -0
- data/app/views/curation_concerns/base/_form_additional_information.html.erb +7 -0
- data/app/views/curation_concerns/base/_form_content_license.html.erb +16 -0
- data/app/views/curation_concerns/base/_form_descriptive_fields.erb +11 -0
- data/app/views/curation_concerns/base/_form_editors.html.erb +15 -0
- data/app/views/curation_concerns/base/_form_files_and_links.html.erb +23 -0
- data/app/views/curation_concerns/base/_form_permission.html.erb +52 -0
- data/app/views/curation_concerns/base/_form_permission_embargo.html.erb +6 -0
- data/app/views/curation_concerns/base/_form_permission_lease.html.erb +6 -0
- data/app/views/curation_concerns/base/_form_permission_under_embargo.html.erb +16 -0
- data/app/views/curation_concerns/base/_form_permission_under_lease.html.erb +18 -0
- data/app/views/curation_concerns/base/_form_representative_image.html.erb +13 -0
- data/app/views/curation_concerns/base/_form_required_information.html.erb +11 -0
- data/app/views/curation_concerns/base/_form_supplementary_fields.html.erb +15 -0
- data/app/views/curation_concerns/base/_legally_binding_text.html.erb +33 -0
- data/app/views/curation_concerns/base/_related_files.html.erb +24 -0
- data/app/views/curation_concerns/base/_representative_media.html.erb +8 -0
- data/app/views/curation_concerns/base/edit.html.erb +13 -0
- data/app/views/curation_concerns/base/new.html.erb +12 -0
- data/app/views/curation_concerns/base/show.html.erb +21 -0
- data/app/views/curation_concerns/base/unauthorized.html.erb +3 -0
- data/app/views/curation_concerns/classify_concerns/new.html.erb +25 -0
- data/app/views/curation_concerns/collections/_form_additional_information.html.erb +6 -0
- data/app/views/curation_concerns/generic_files/_actions.html.erb +16 -0
- data/app/views/curation_concerns/generic_files/_form.html.erb +35 -0
- data/app/views/curation_concerns/generic_files/_generic_file.html.erb +12 -0
- data/app/views/curation_concerns/generic_files/_media_display.html.erb +19 -0
- data/app/views/curation_concerns/generic_files/edit.html.erb +5 -0
- data/app/views/curation_concerns/generic_files/jq_upload.json.jbuilder +8 -0
- data/app/views/curation_concerns/generic_files/show.html.erb +15 -0
- data/app/views/curation_concerns/permissions/confirm.html.erb +21 -0
- data/app/views/embargoes/_embargo_history.html.erb +7 -0
- data/app/views/embargoes/_list_active_embargoes.html.erb +16 -0
- data/app/views/embargoes/_list_deactivated_embargoes.html.erb +10 -0
- data/app/views/embargoes/_list_expired_active_embargoes.html.erb +44 -0
- data/app/views/embargoes/edit.html.erb +43 -0
- data/app/views/embargoes/index.html.erb +18 -0
- data/app/views/layouts/boilerplate.html.erb +22 -0
- data/app/views/layouts/curation_concerns/1_column.html.erb +11 -0
- data/app/views/layouts/curation_concerns/catalog.html.erb +37 -0
- data/app/views/layouts/curation_concerns.html.erb +22 -0
- data/app/views/leases/_lease_history.html.erb +7 -0
- data/app/views/leases/_list_active_leases.html.erb +16 -0
- data/app/views/leases/_list_deactivated_leases.html.erb +4 -0
- data/app/views/leases/_list_expired_active_leases.html.erb +38 -0
- data/app/views/leases/edit.html.erb +43 -0
- data/app/views/leases/index.html.erb +18 -0
- data/app/views/shared/_add_content.html.erb +32 -0
- data/app/views/shared/_brand_bar.html.erb +10 -0
- data/app/views/shared/_flash_message.html.erb +17 -0
- data/app/views/shared/_footer.html.erb +10 -0
- data/app/views/shared/_ga.html.erb +6 -0
- data/app/views/shared/_header.html.erb +12 -0
- data/app/views/shared/_my_actions.html.erb +21 -0
- data/app/views/shared/_site_actions.html.erb +7 -0
- data/app/views/shared/_site_search.html.erb +12 -0
- data/app/views/shared/_title_bar.html.erb +16 -0
- data/app/workers/visibility_copy_worker.rb +30 -0
- data/config/initializers/simple_form.rb +31 -0
- data/config/locales/curation_concerns.en.yml +96 -0
- data/config/routes.rb +4 -0
- data/curation_concerns-models/.gitignore +17 -0
- data/curation_concerns-models/Gemfile +4 -0
- data/curation_concerns-models/LICENSE.md +177 -0
- data/curation_concerns-models/README.md +42 -0
- data/curation_concerns-models/Rakefile +1 -0
- data/curation_concerns-models/app/actors/concerns/curation_concerns/manages_embargoes_actor.rb +99 -0
- data/curation_concerns-models/app/actors/curation_concerns/base_actor.rb +90 -0
- data/curation_concerns-models/app/actors/curation_concerns/generic_file_actor.rb +150 -0
- data/curation_concerns-models/app/actors/curation_concerns/work_actor_behavior.rb +88 -0
- data/curation_concerns-models/app/jobs/active_fedora_id_based_job.rb +22 -0
- data/curation_concerns-models/app/jobs/active_fedora_pid_based_job.rb +6 -0
- data/curation_concerns-models/app/jobs/audit_job.rb +58 -0
- data/curation_concerns-models/app/jobs/characterize_job.rb +11 -0
- data/curation_concerns-models/app/jobs/copy_permissions_job.rb +24 -0
- data/curation_concerns-models/app/jobs/create_derivatives_job.rb +15 -0
- data/curation_concerns-models/app/jobs/import_url_job.rb +56 -0
- data/curation_concerns-models/app/jobs/ingest_local_file_job.rb +48 -0
- data/curation_concerns-models/app/jobs/resolrize_job.rb +9 -0
- data/curation_concerns-models/app/models/checksum_audit_log.rb +21 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/ability.rb +34 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/basic_metadata.rb +87 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/collection_behavior.rb +47 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file/belongs_to_works.rb +53 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file/characterization.rb +89 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file/content.rb +8 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file/export.rb +343 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file/full_text_indexing.rb +12 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file/indexing.rb +14 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file/versions.rb +16 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file.rb +5 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file_behavior.rb +44 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/generic_work_behavior.rb +38 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/has_representative.rb +14 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/human_readable_type.rb +23 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/permissions/readable.rb +19 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/permissions/writable.rb +75 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/permissions.rb +7 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/serializers.rb +15 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/solr_document_behavior.rb +135 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/user.rb +65 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/with_basic_metadata.rb +98 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/with_generic_files.rb +29 -0
- data/curation_concerns-models/app/models/curation_concerns/classify_concern.rb +47 -0
- data/curation_concerns-models/app/models/curation_concerns/quick_classification_query.rb +31 -0
- data/curation_concerns-models/app/models/datastreams/fits_datastream.rb +148 -0
- data/curation_concerns-models/app/models/version_committer.rb +2 -0
- data/curation_concerns-models/app/services/curation_concerns/characterization_service.rb +71 -0
- data/curation_concerns-models/app/services/curation_concerns/full_text_extraction_service.rb +38 -0
- data/curation_concerns-models/app/services/curation_concerns/generic_file_audit_service.rb +85 -0
- data/curation_concerns-models/app/services/curation_concerns/generic_file_indexing_service.rb +14 -0
- data/curation_concerns-models/app/services/curation_concerns/generic_work_indexing_service.rb +16 -0
- data/curation_concerns-models/app/services/curation_concerns/noid.rb +23 -0
- data/curation_concerns-models/app/services/curation_concerns/repository_audit_service.rb +9 -0
- data/curation_concerns-models/app/services/curation_concerns/versioning_service.rb +27 -0
- data/curation_concerns-models/config/locales/curation_concerns.en.yml +6 -0
- data/curation_concerns-models/curation_concerns-models.gemspec +34 -0
- data/curation_concerns-models/lib/curation_concerns/messages.rb +66 -0
- data/curation_concerns-models/lib/curation_concerns/models/engine.rb +61 -0
- data/curation_concerns-models/lib/curation_concerns/models/resque.rb +36 -0
- data/curation_concerns-models/lib/curation_concerns/models/utils.rb +22 -0
- data/curation_concerns-models/lib/curation_concerns/models/version.rb +5 -0
- data/curation_concerns-models/lib/curation_concerns/models.rb +32 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/abstract_migration_generator.rb +30 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/clamav_generator.rb +19 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/fulltext_generator.rb +28 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/install_generator.rb +70 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/templates/app/models/collection.rb +4 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/templates/app/models/generic_file.rb +4 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/clamav.rb +1 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/curation_concerns.rb +123 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/mime_types.rb +6 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/redis.yml +9 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/redis_config.rb +32 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/resque-pool.yml +1 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/resque_admin.rb +10 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/resque_config.rb +5 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/templates/migrations/create_checksum_audit_logs.rb +19 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/templates/migrations/create_version_committers.rb +15 -0
- data/curation_concerns-models/lib/tasks/curation_concerns-models_tasks.rake +75 -0
- data/curation_concerns-models/lib/tasks/migrate.rake +13 -0
- data/curation_concerns-models/lib/tasks/resque.rake +13 -0
- data/curation_concerns-models/lib/tasks/solr_reindex.rake +8 -0
- data/curation_concerns.gemspec +46 -0
- data/lib/curation_concerns/configuration.rb +74 -0
- data/lib/curation_concerns/controller_resource.rb +10 -0
- data/lib/curation_concerns/engine.rb +20 -0
- data/lib/curation_concerns/rails/routes.rb +76 -0
- data/lib/curation_concerns/spec_support.rb +10 -0
- data/lib/curation_concerns/version.rb +3 -0
- data/lib/curation_concerns.rb +8 -0
- data/lib/generators/curation_concerns/install_generator.rb +103 -0
- data/lib/generators/curation_concerns/templates/curation_concerns.css.scss +3 -0
- data/lib/generators/curation_concerns/templates/curation_concerns.js +1 -0
- data/lib/generators/curation_concerns/templates/curation_concerns_config.rb +2 -0
- data/lib/generators/curation_concerns/templates/curation_concerns_helper.rb +4 -0
- data/lib/generators/curation_concerns/work/USAGE +19 -0
- data/lib/generators/curation_concerns/work/templates/README +13 -0
- data/lib/generators/curation_concerns/work/templates/actor.rb.erb +7 -0
- data/lib/generators/curation_concerns/work/templates/actor_spec.rb.erb +9 -0
- data/lib/generators/curation_concerns/work/templates/controller.rb.erb +7 -0
- data/lib/generators/curation_concerns/work/templates/controller_spec.rb.erb +9 -0
- data/lib/generators/curation_concerns/work/templates/model.rb.erb +7 -0
- data/lib/generators/curation_concerns/work/templates/model_spec.rb.erb +9 -0
- data/lib/generators/curation_concerns/work/work_generator.rb +78 -0
- data/solr_conf/conf/solrconfig.xml +223 -0
- data/spec/abilities/collection_abilities_spec.rb +48 -0
- data/spec/abilities/generic_file_abilities_spec.rb +62 -0
- data/spec/abilities/generic_work_abilities_spec.rb +58 -0
- data/spec/actors/curation_concerns/generic_file_actor_spec.rb +116 -0
- data/spec/actors/curation_concerns/manages_embargoes_actor_spec.rb +95 -0
- data/spec/actors/curation_concerns/work_actor_spec.rb +203 -0
- data/spec/controllers/catalog_controller_spec.rb +115 -0
- data/spec/controllers/curation_concerns/classify_concerns_controller_spec.rb +43 -0
- data/spec/controllers/curation_concerns/collections_controller_spec.rb +171 -0
- data/spec/controllers/curation_concerns/generic_files_controller_spec.rb +251 -0
- data/spec/controllers/curation_concerns/generic_works_controller_spec.rb +167 -0
- data/spec/controllers/curation_concerns/permissions_controller_spec.rb +29 -0
- data/spec/controllers/downloads_controller_spec.rb +51 -0
- data/spec/controllers/embargoes_controller_spec.rb +114 -0
- data/spec/controllers/leases_controller_spec.rb +94 -0
- data/spec/factories/collections.rb +15 -0
- data/spec/factories/create_curation_concern.rb +3 -0
- data/spec/factories/generic_files.rb +31 -0
- data/spec/factories/generic_works.rb +54 -0
- data/spec/factories/users.rb +28 -0
- data/spec/features/add_file_spec.rb +30 -0
- data/spec/features/collection_spec.rb +222 -0
- data/spec/features/create_work_spec.rb +43 -0
- data/spec/features/embargo_spec.rb +51 -0
- data/spec/features/lease_spec.rb +49 -0
- data/spec/features/update_file_spec.rb +32 -0
- data/spec/features/work_generator_spec.rb +58 -0
- data/spec/fixtures/Example.ogg +0 -0
- data/spec/fixtures/charter.docx +0 -0
- data/spec/fixtures/countdown.avi +0 -0
- data/spec/fixtures/curation_concerns_generic_stub.txt +1 -0
- data/spec/fixtures/files/image.png +0 -0
- data/spec/fixtures/image.jp2 +0 -0
- data/spec/fixtures/image.jpg +0 -0
- data/spec/fixtures/piano_note.wav +0 -0
- data/spec/fixtures/sample_mpeg4.mp4 +0 -0
- data/spec/fixtures/small_file.txt +1 -0
- data/spec/fixtures/spoken-text.m4a +0 -0
- data/spec/fixtures/test4.pdf +0 -0
- data/spec/fixtures/test5.mp3 +0 -0
- data/spec/fixtures/world.png +0 -0
- data/spec/forms/collection_edit_form_spec.rb +20 -0
- data/spec/forms/generic_file_edit_form_spec.rb +33 -0
- data/spec/helpers/catalog_helper_spec.rb +58 -0
- data/spec/helpers/configuration_helper_spec.rb +13 -0
- data/spec/helpers/curation_concerns/.keep +0 -0
- data/spec/helpers/curation_concerns/collections_helper_spec.rb +49 -0
- data/spec/helpers/render_constraints_helper_spec.rb +19 -0
- data/spec/helpers/thumbnail_helper_spec.rb +21 -0
- data/spec/helpers/url_helper_spec.rb +22 -0
- data/spec/jobs/active_fedora_id_based_job_spec.rb +14 -0
- data/spec/jobs/audit_job_spec.rb +53 -0
- data/spec/jobs/characterize_job_spec.rb +23 -0
- data/spec/jobs/copy_permissions_job_spec.rb +49 -0
- data/spec/jobs/create_derivatives_job_spec.rb +23 -0
- data/spec/jobs/curation_concerns_resque_queue_spec.rb +49 -0
- data/spec/jobs/import_url_job_spec.rb +45 -0
- data/spec/jobs/ingest_local_file_job_spec.rb +25 -0
- data/spec/lib/curation_concerns/messages_spec.rb +70 -0
- data/spec/lib/curation_concerns/readable_permissions_spec.rb +56 -0
- data/spec/lib/curation_concerns/writable_permissions_spec.rb +16 -0
- data/spec/matchers/metadata_field_matchers.rb +28 -0
- data/spec/matchers/response_matchers.rb +7 -0
- data/spec/matchers.rb +24 -0
- data/spec/models/checksum_audit_log_spec.rb +66 -0
- data/spec/models/curation_concerns/collection_behavior_spec.rb +107 -0
- data/spec/models/curation_concerns/generic_file/derivatives_spec.rb +88 -0
- data/spec/models/curation_concerns/generic_work_behavior_spec.rb +35 -0
- data/spec/models/fits_datastream_spec.rb +127 -0
- data/spec/models/generic_file_spec.rb +619 -0
- data/spec/models/generic_work_spec.rb +43 -0
- data/spec/models/user_spec.rb +23 -0
- data/spec/presenters/curation_concerns/collection_presenter_spec.rb +34 -0
- data/spec/presenters/curation_concerns/generic_file_presenter_spec.rb +16 -0
- data/spec/routing/curation_concerns/routes_spec.rb +36 -0
- data/spec/routing/route_spec.rb +86 -0
- data/spec/services/characterization_service_spec.rb +30 -0
- data/spec/services/embargo_service_spec.rb +38 -0
- data/spec/services/full_text_extraction_service_spec.rb +5 -0
- data/spec/services/generic_file_audit_service_spec.rb +71 -0
- data/spec/services/generic_file_indexing_service_spec.rb +57 -0
- data/spec/services/generic_work_indexing_service_spec.rb +18 -0
- data/spec/services/lease_service_spec.rb +53 -0
- data/spec/services/repository_audit_service_spec.rb +18 -0
- data/spec/services/versioning_service_spec.rb +32 -0
- data/spec/spec_helper.rb +94 -0
- data/spec/support/controllers/engine_helpers.rb +7 -0
- data/spec/support/curation_concerns/factory_helpers.rb +14 -0
- data/spec/support/features/fixture_file_upload.rb +14 -0
- data/spec/support/features/session_helpers.rb +41 -0
- data/spec/support/features.rb +19 -0
- data/spec/support/shared/shared_examples_has_dc_metadata.rb +17 -0
- data/spec/support/shared/shared_examples_is_embargoable.rb +8 -0
- data/spec/support/shared/shared_examples_with_access_rights.rb +63 -0
- data/spec/tasks/rake_spec.rb +24 -0
- data/spec/test_app_templates/Gemfile.extra +1 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +55 -0
- data/spec/views/catalog/index.html.erb_spec.rb +59 -0
- data/spec/views/curation_concerns/base/_attributes.html.erb_spec.rb +25 -0
- data/spec/views/curation_concerns/base/show.html.erb_spec.rb +29 -0
- data/spec/views/curation_concerns/permissions/confirm.html.erb_spec.rb +33 -0
- data/spec/views/shared/_add_content.html.erb_spec.rb +42 -0
- data/spec/views/shared/_my_actions.html.erb_spec.rb +23 -0
- data/spec/workers/visibility_copy_worker_spec.rb +70 -0
- data/tasks/jetty.rake +15 -0
- data/tasks/release.rake +93 -0
- data/vendor/assets/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/vendor/assets/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/vendor/assets/javascripts/handlebars.js +2278 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.autocomplete.js +602 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.core.js +356 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.effect-highlight.js +50 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.effect.js +1276 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.menu.js +610 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.position.js +498 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.widget.js +528 -0
- data/vendor/assets/javascripts/jquery.tokeninput.js +1061 -0
- data/vendor/assets/stylesheets/jquery-ui-lightness.css +474 -0
- data/vendor/assets/stylesheets/token-input-facebook.css +122 -0
- data/vendor/assets/stylesheets/token-input-mac.css +204 -0
- data/vendor/assets/stylesheets/token-input.css +127 -0
- metadata +888 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'embargo' do
|
|
4
|
+
let(:user) { FactoryGirl.create(:user) }
|
|
5
|
+
before do
|
|
6
|
+
sign_in user
|
|
7
|
+
end
|
|
8
|
+
describe "creating an embargoed object" do
|
|
9
|
+
before do
|
|
10
|
+
visit '/'
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
let(:future_date) { 5.days.from_now }
|
|
14
|
+
let(:later_future_date) { 10.days.from_now }
|
|
15
|
+
|
|
16
|
+
it "can be created, displayed and updated" do
|
|
17
|
+
click_link 'New Generic Work'
|
|
18
|
+
fill_in 'Title', with: 'Embargo test'
|
|
19
|
+
choose 'Embargo'
|
|
20
|
+
fill_in "generic_work_embargo_release_date", with: future_date
|
|
21
|
+
select 'Private', from: 'Restricted to'
|
|
22
|
+
select 'Open Access', from: 'then open it up to'
|
|
23
|
+
click_button 'Create Generic work'
|
|
24
|
+
|
|
25
|
+
expect(page).to have_content(future_date.to_datetime.iso8601) # chosen embargo date is on the show page
|
|
26
|
+
|
|
27
|
+
click_link "Edit This Generic Work"
|
|
28
|
+
click_link "Embargo Management Page"
|
|
29
|
+
|
|
30
|
+
expect(page).to have_content("This work is under embargo.")
|
|
31
|
+
expect(page).to have_xpath("//input[@name='generic_work[embargo_release_date]' and @value='#{future_date.to_datetime.iso8601}']") # current embargo date is pre-populated in edit field
|
|
32
|
+
|
|
33
|
+
fill_in "until", with: later_future_date.to_s
|
|
34
|
+
|
|
35
|
+
click_button "Update Embargo"
|
|
36
|
+
expect(page).to have_content(later_future_date.to_date.to_formatted_s(:long_ordinal))
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
describe "managing embargoes" do
|
|
41
|
+
before do
|
|
42
|
+
# admin privs
|
|
43
|
+
allow_any_instance_of(Ability).to receive(:user_groups).and_return(['admin'])
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
it "should show lists of objects under lease" do
|
|
47
|
+
visit '/embargoes'
|
|
48
|
+
expect(page).to have_content 'Manage Embargoes'
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "leases" do
|
|
4
|
+
let(:user) { FactoryGirl.create(:user) }
|
|
5
|
+
before do
|
|
6
|
+
sign_in user
|
|
7
|
+
end
|
|
8
|
+
describe "create a new leased object" do
|
|
9
|
+
|
|
10
|
+
let(:future_date) { 5.days.from_now }
|
|
11
|
+
let(:later_future_date) { 10.days.from_now }
|
|
12
|
+
|
|
13
|
+
it "can be created, displayed and updated" do
|
|
14
|
+
visit '/'
|
|
15
|
+
click_link 'New Generic Work'
|
|
16
|
+
fill_in 'Title', with: 'Lease test'
|
|
17
|
+
choose 'Lease'
|
|
18
|
+
fill_in "generic_work_lease_expiration_date", with: future_date
|
|
19
|
+
select 'Open Access', from: 'Is available for'
|
|
20
|
+
select 'Private', from: 'then restrict it to'
|
|
21
|
+
click_button 'Create Generic work'
|
|
22
|
+
|
|
23
|
+
expect(page).to have_content(future_date.to_datetime.iso8601) # chosen lease date is on the show page
|
|
24
|
+
|
|
25
|
+
click_link "Edit This Generic Work"
|
|
26
|
+
click_link "Lease Management Page"
|
|
27
|
+
|
|
28
|
+
expect(page).to have_content("This work is under lease.")
|
|
29
|
+
expect(page).to have_xpath("//input[@name='generic_work[lease_expiration_date]' and @value='#{future_date.to_datetime.iso8601}']") # current lease date is pre-populated in edit field
|
|
30
|
+
|
|
31
|
+
fill_in "until", with: later_future_date.to_s
|
|
32
|
+
|
|
33
|
+
click_button "Update Lease"
|
|
34
|
+
expect(page).to have_content(later_future_date.to_date.to_formatted_s(:long_ordinal)) # new lease date is displayed in message
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
describe "managing leases" do
|
|
40
|
+
before do
|
|
41
|
+
# admin privs
|
|
42
|
+
allow_any_instance_of(Ability).to receive(:user_groups).and_return(['admin'])
|
|
43
|
+
end
|
|
44
|
+
it "should show lists of objects under lease" do
|
|
45
|
+
visit '/leases'
|
|
46
|
+
expect(page).to have_content 'Manage Leases'
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "Editing attached files" do
|
|
4
|
+
let(:user) { create(:user) }
|
|
5
|
+
let!(:parent) { create(:work_with_one_file, user: user) }
|
|
6
|
+
let!(:generic_file) { parent.generic_files.first }
|
|
7
|
+
|
|
8
|
+
before do
|
|
9
|
+
sign_in user
|
|
10
|
+
|
|
11
|
+
# stub out characterization. Travis doesn't have fits installed, and it's not relevant to the test.
|
|
12
|
+
s2 = double('resque message')
|
|
13
|
+
expect(CharacterizeJob).to receive(:new).and_return(s2)
|
|
14
|
+
expect(CurationConcerns.queue).to receive(:push).with(s2).once
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
it "updates the file" do
|
|
18
|
+
visit "/concern/generic_works/#{parent.id}"
|
|
19
|
+
click_link 'Edit'
|
|
20
|
+
expect(page).to have_content "Updating Attached File to \"Test title\""
|
|
21
|
+
|
|
22
|
+
attach_file("Upload a file", fixture_file_path('files/image.png'))
|
|
23
|
+
click_button "Update Attached File"
|
|
24
|
+
|
|
25
|
+
expect(page).to have_content "The file A Contained Generic File has been updated."
|
|
26
|
+
|
|
27
|
+
#TODO this stuff belongs in an Actor or Controller test:
|
|
28
|
+
generic_file.reload
|
|
29
|
+
expect(generic_file.original_file.original_name).to eq 'image.png'
|
|
30
|
+
expect(generic_file.original_file.mime_type).to eq 'image/png'
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'rails/generators'
|
|
3
|
+
|
|
4
|
+
describe "Creating a new Work" do
|
|
5
|
+
let(:user) { FactoryGirl.create(:user) }
|
|
6
|
+
|
|
7
|
+
before do
|
|
8
|
+
Rails::Generators.invoke("curation_concerns:work", ["Catapult"], destination_root: Rails.root)
|
|
9
|
+
load 'spec/internal/app/models/catapult.rb'
|
|
10
|
+
load 'spec/internal/app/controllers/curation_concerns/catapults_controller.rb'
|
|
11
|
+
load 'spec/internal/app/actors/curation_concerns/catapult_actor.rb'
|
|
12
|
+
load 'spec/internal/config/initializers/curation_concerns_config.rb'
|
|
13
|
+
load 'spec/internal/config/routes.rb'
|
|
14
|
+
load 'app/helpers/curation_concerns/url_helper.rb'
|
|
15
|
+
sign_in user
|
|
16
|
+
|
|
17
|
+
# stub out characterization. Travis doesn't have fits installed, and it's not relevant to the test.
|
|
18
|
+
s2 = double('resque message')
|
|
19
|
+
expect(CharacterizeJob).to receive(:new).and_return(s2)
|
|
20
|
+
expect(CurationConcerns.queue).to receive(:push).with(s2).once
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
after do
|
|
24
|
+
Rails::Generators.invoke("curation_concerns:work", ["Catapult"], behavior: :revoke, destination_root: Rails.root)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
it "catapults should behave like generic works" do
|
|
28
|
+
visit "/concern/catapults/new"
|
|
29
|
+
# within("form.new_generic_file") do
|
|
30
|
+
# attach_file("Upload a file", fixture_file_path('files/image.png'))
|
|
31
|
+
# click_button "Attach to Generic Work"
|
|
32
|
+
# end
|
|
33
|
+
catapult_title = 'My Test Work'
|
|
34
|
+
within("form.new_catapult") do
|
|
35
|
+
fill_in("Title", with: catapult_title)
|
|
36
|
+
attach_file("Upload a file", fixture_file_path('files/image.png'))
|
|
37
|
+
choose("visibility_open")
|
|
38
|
+
click_on("Create Catapult")
|
|
39
|
+
end
|
|
40
|
+
click_on("Edit This Catapult")
|
|
41
|
+
within("form.edit_catapult") do
|
|
42
|
+
fill_in("Subject", with: 'test')
|
|
43
|
+
click_on("Update Catapult")
|
|
44
|
+
end
|
|
45
|
+
title = "Genealogies of the American West"
|
|
46
|
+
click_link 'Add a Collection'
|
|
47
|
+
fill_in('Title', with: title)
|
|
48
|
+
click_button("Create Collection")
|
|
49
|
+
click_on("Add files from your dashboard")
|
|
50
|
+
find("#facet-human_readable_type_sim").click_link('Catapult')
|
|
51
|
+
within(".modal.fade", :match => :first) do
|
|
52
|
+
select title, :from => "id"
|
|
53
|
+
click_on("Add to collection")
|
|
54
|
+
end
|
|
55
|
+
expect(page).to have_content('Collection was successfully updated.')
|
|
56
|
+
expect(page).to have_content(catapult_title)
|
|
57
|
+
end
|
|
58
|
+
end
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This is a test fixture for curation_concerns: <%= @id %>.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
small
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe CurationConcerns::Forms::CollectionEditForm do
|
|
4
|
+
let(:collection) { Collection.new }
|
|
5
|
+
let(:form) { described_class.new(collection) }
|
|
6
|
+
|
|
7
|
+
describe "#terms" do
|
|
8
|
+
subject { form.terms}
|
|
9
|
+
it { is_expected.to eq [:resource_type, :title, :creator, :contributor, :description,
|
|
10
|
+
:tag, :rights, :publisher, :date_created, :subject, :language,
|
|
11
|
+
:identifier, :based_near, :related_url] }
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
describe "unique?" do
|
|
15
|
+
context "with :title" do
|
|
16
|
+
subject { CurationConcerns::Forms::CollectionEditForm.unique?(:title) }
|
|
17
|
+
it { is_expected.to be true }
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe CurationConcerns::Forms::GenericFileEditForm do
|
|
4
|
+
subject { described_class.new(GenericFile.new) }
|
|
5
|
+
|
|
6
|
+
describe "#terms" do
|
|
7
|
+
it "should return a list" do
|
|
8
|
+
expect(subject.terms).to eq([:resource_type, :title, :creator, :contributor, :description, :tag,
|
|
9
|
+
:rights, :publisher, :date_created, :subject, :language, :identifier, :based_near, :related_url])
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
it "doesn't contain fields that users shouldn't be allowed to edit" do
|
|
13
|
+
# date_uploaded is reserved for the original creation date of the record.
|
|
14
|
+
expect(subject.terms).not_to include(:date_uploaded)
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it "should initialize multivalued fields" do
|
|
19
|
+
expect(subject.title).to eq ['']
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
describe ".model_attributes" do
|
|
23
|
+
let(:params) { ActionController::Parameters.new(title: ['foo'], description: [''], "permissions_attributes"=>{"2"=>{"access"=>"edit", "_destroy"=>"true", "id"=>"a987551e-b87f-427a-8721-3e5942273125"}})}
|
|
24
|
+
subject { described_class.model_attributes(params) }
|
|
25
|
+
|
|
26
|
+
it "should only change title" do
|
|
27
|
+
expect(subject['title']).to eq ["foo"]
|
|
28
|
+
expect(subject['description']).to be_empty
|
|
29
|
+
expect(subject['permissions_attributes']).to eq("2" => {"access"=>"edit", "id"=>"a987551e-b87f-427a-8721-3e5942273125", "_destroy"=>"true"})
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe CurationConcerns::CatalogHelper do
|
|
4
|
+
before do
|
|
5
|
+
helper.params[:controller] = 'catalog'
|
|
6
|
+
allow(helper).to receive(:blacklight_config).and_return(CatalogController.blacklight_config)
|
|
7
|
+
allow(helper).to receive(:search_action_path) do |*args|
|
|
8
|
+
catalog_index_path *args
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
describe "all_type_tab" do
|
|
13
|
+
subject { helper.all_type_tab('All') }
|
|
14
|
+
|
|
15
|
+
context "when it is the active tab" do
|
|
16
|
+
it { should eq "<li class=\"active\"><a href=\"#\">All</a></li>" }
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
context "when it is not the active tab" do
|
|
20
|
+
before do
|
|
21
|
+
helper.params[:f] = { 'generic_type_sim' => ['Work'] }
|
|
22
|
+
end
|
|
23
|
+
it { should eq "<li><a href=\"/catalog\">All</a></li>" }
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
context "when other parameters are present" do
|
|
27
|
+
before do
|
|
28
|
+
helper.params[:f] = { 'generic_type_sim' => ['Work'] }
|
|
29
|
+
helper.params[:page] = 4
|
|
30
|
+
end
|
|
31
|
+
it("should clear them") { should eq "<li><a href=\"/catalog\">All</a></li>" }
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
describe "type_tab" do
|
|
36
|
+
subject { helper.type_tab('Works', 'Work') }
|
|
37
|
+
|
|
38
|
+
context "when it is the active tab" do
|
|
39
|
+
before do
|
|
40
|
+
helper.params[:f] = { 'generic_type_sim' => ['Work'] }
|
|
41
|
+
end
|
|
42
|
+
it { should eq "<li class=\"active\"><a href=\"#\">Works</a></li>" }
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
context "when it is not the active tab" do
|
|
46
|
+
it { should eq "<li><a href=\"/catalog?f%5Bgeneric_type_sim%5D%5B%5D=Work\">Works</a></li>" }
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# context "when other parameters are present" do
|
|
50
|
+
# before do
|
|
51
|
+
# helper.params[:f] = { 'generic_type_sim' => ['Collection'] }
|
|
52
|
+
# helper.params[:page] = 4
|
|
53
|
+
# end
|
|
54
|
+
# it("should clear them") { should eq "<li><a href=\"/catalog?f%5Bgeneric_type_sim%5D%5B%5D=Work\">Works</a></li>" }
|
|
55
|
+
# end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe Blacklight::ConfigurationHelperBehavior do
|
|
4
|
+
|
|
5
|
+
describe "creator facet" do
|
|
6
|
+
before do
|
|
7
|
+
allow(helper).to receive(:blacklight_config).and_return(CatalogController.blacklight_config)
|
|
8
|
+
end
|
|
9
|
+
let(:field) { 'creator_sim' }
|
|
10
|
+
subject { helper.facet_field_label field }
|
|
11
|
+
it { should eq 'Creator' }
|
|
12
|
+
end
|
|
13
|
+
end
|
|
File without changes
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe CurationConcerns::CollectionsHelper do
|
|
4
|
+
|
|
5
|
+
describe "#link_to_select_collection" do
|
|
6
|
+
let(:collection) { double(id: '123') }
|
|
7
|
+
let(:collectible) { double(id: '456', human_readable_type: 'Generic Work', to_param: '456') }
|
|
8
|
+
before do
|
|
9
|
+
assign(:collection, collection)
|
|
10
|
+
end
|
|
11
|
+
subject { helper.link_to_select_collection(collectible) }
|
|
12
|
+
|
|
13
|
+
it "has a link that pops up a modal" do
|
|
14
|
+
expect(subject).to have_selector 'a[data-toggle=modal][data-target="#456-modal"]'
|
|
15
|
+
expect(subject).to have_link 'Add to a Collection', href: '#'
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
describe "#link_to_remove_from_collection" do
|
|
20
|
+
let(:collection) { double(id: '123') }
|
|
21
|
+
let(:collectible) { double(id: '456') }
|
|
22
|
+
before do
|
|
23
|
+
assign(:collection, collection)
|
|
24
|
+
end
|
|
25
|
+
subject { helper.link_to_remove_from_collection(collectible) }
|
|
26
|
+
|
|
27
|
+
it "has a form that routes to remove the collectible" do
|
|
28
|
+
expect(subject).to have_selector 'a[data-method=put]'
|
|
29
|
+
expect(subject).to have_link 'Remove From Collection',
|
|
30
|
+
href: collections.collection_path('123', collection: { members: 'remove'},
|
|
31
|
+
batch_document_ids: [ '456' ])
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
describe "#collection_options_for_select" do
|
|
36
|
+
before do
|
|
37
|
+
allow(helper).to receive(:current_user).and_return(user)
|
|
38
|
+
end
|
|
39
|
+
let(:user) { FactoryGirl.create(:user) }
|
|
40
|
+
let!(:collection1) { FactoryGirl.create(:collection, user: user, title: 'One') }
|
|
41
|
+
let!(:collection2) { FactoryGirl.create(:collection, user: user, title: 'Two') }
|
|
42
|
+
let!(:collection3) { FactoryGirl.create(:collection, user: user, title: 'Three') }
|
|
43
|
+
subject { helper.collection_options_for_select(collection2) }
|
|
44
|
+
|
|
45
|
+
it "excludes the passed in collection" do
|
|
46
|
+
expect(subject).to eq "<option value=\"#{collection1.id}\">#{collection1.title}</option>\n<option value=\"#{collection3.id}\">#{collection3.title}</option>"
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe CurationConcernsHelper do
|
|
4
|
+
describe "render_constraints_query" do
|
|
5
|
+
before do
|
|
6
|
+
# Stub methods from Blacklight::SearchFields
|
|
7
|
+
allow(helper).to receive(:default_search_field).and_return(CatalogController.blacklight_config.default_search_field)
|
|
8
|
+
allow(helper).to receive(:label_for_search_field).and_return("Foo")
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
let(:search_params) { { q: 'Simon', search_field: 'publisher', controller: 'catalog' } }
|
|
12
|
+
subject { helper.render_constraints_query(search_params) }
|
|
13
|
+
|
|
14
|
+
it "removes search_field" do
|
|
15
|
+
node = Capybara::Node::Simple.new(subject)
|
|
16
|
+
expect(node).to have_link 'Remove constraint Foo: Simon', href: '/'
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe CurationConcerns::ThumbnailHelper do
|
|
4
|
+
let(:work) { GenericWork.new }
|
|
5
|
+
let(:document) { SolrDocument.new work.to_solr }
|
|
6
|
+
subject { helper.thumbnail_tag document, {} }
|
|
7
|
+
|
|
8
|
+
context "with a representative" do
|
|
9
|
+
before do
|
|
10
|
+
allow(work).to receive(:representative).and_return('curation_concerns:test123')
|
|
11
|
+
end
|
|
12
|
+
it "draws the thumbnail" do
|
|
13
|
+
expect(subject).to eq "<img alt=\"Thumbnail\" class=\"canonical-image\" " \
|
|
14
|
+
"src=\"/downloads/curation_concerns:test123?datastream_id=thumbnail\" />"
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it "draws the default thumbnail" do
|
|
19
|
+
expect(subject).to eq "<span class=\"canonical-image\"></span>"
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe CurationConcerns::UrlHelper do
|
|
4
|
+
before do
|
|
5
|
+
GenericWork.destroy_all
|
|
6
|
+
end
|
|
7
|
+
let(:profile) { ["{\"datastreams\":{}}"] }
|
|
8
|
+
let(:work) { FactoryGirl.create(:generic_work) }
|
|
9
|
+
let(:document) { SolrDocument.new(work.to_solr) }
|
|
10
|
+
subject { helper.url_for_document document }
|
|
11
|
+
|
|
12
|
+
it { should eq "/concern/generic_works/#{work.id}" }
|
|
13
|
+
it "should use the curation_concern namespace" do
|
|
14
|
+
expect(helper.url_for_document document).to eq "/concern/generic_works/#{work.id}"
|
|
15
|
+
end
|
|
16
|
+
context "when document is a GenericFile" do
|
|
17
|
+
let(:file) { FactoryGirl.create(:generic_file) }
|
|
18
|
+
subject { helper.url_for_document file }
|
|
19
|
+
it { should eq "/concern/generic_files/#{file.id}" }
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe ActiveFedoraIdBasedJob do
|
|
4
|
+
let (:user) {FactoryGirl.find_or_create(:jill)}
|
|
5
|
+
let (:file) {GenericFile.new.tap do |gf|
|
|
6
|
+
gf.apply_depositor_metadata(user)
|
|
7
|
+
gf.save!
|
|
8
|
+
end}
|
|
9
|
+
|
|
10
|
+
it "finds object" do
|
|
11
|
+
job = ActiveFedoraIdBasedJob.new(file.id)
|
|
12
|
+
expect(job.generic_file).to_not be_nil
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe AuditJob do
|
|
4
|
+
let(:user) { FactoryGirl.create(:user) }
|
|
5
|
+
|
|
6
|
+
let(:file) do
|
|
7
|
+
generic_file = GenericFile.create do |file|
|
|
8
|
+
file.apply_depositor_metadata(user)
|
|
9
|
+
Hydra::Works::AddFileToGenericFile.call(file, File.open(fixture_file_path('world.png')), :original_file, versioning: true)
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
let(:file_id) { file.original_file.id }
|
|
13
|
+
|
|
14
|
+
let(:job) { AuditJob.new(file.id, file_id, uri) }
|
|
15
|
+
|
|
16
|
+
describe "audit on content" do
|
|
17
|
+
let(:uri) { file.original_file.uri }
|
|
18
|
+
it "should pass" do
|
|
19
|
+
expect(job.run).to eq(true)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
describe "audit on a version of the content" do
|
|
24
|
+
let(:uri) { CurationConcerns::VersioningService.latest_version_of(file.original_file).uri }
|
|
25
|
+
it "should pass" do
|
|
26
|
+
expect(job.run).to eq(true)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe "audit on an invalid version of the content" do
|
|
31
|
+
let(:uri) { CurationConcerns::VersioningService.latest_version_of(file.original_file).uri + "bogus" }
|
|
32
|
+
it "should fail" do
|
|
33
|
+
expect(job.run).to eq(false)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
describe "run_audit" do
|
|
38
|
+
let(:uri) { CurationConcerns::VersioningService.latest_version_of(file.original_file).uri }
|
|
39
|
+
let!(:old) { ChecksumAuditLog.create(generic_file_id: file.id, file_id: file_id, version: uri, pass: 1, created_at: 2.minutes.ago) }
|
|
40
|
+
let!(:new) { ChecksumAuditLog.create(generic_file_id: file.id, file_id: file_id, version: uri, pass: 0) }
|
|
41
|
+
let(:mock_service) { double('mock fixity check service') }
|
|
42
|
+
|
|
43
|
+
before do
|
|
44
|
+
allow(ActiveFedora::FixityService).to receive(:new).and_return(mock_service)
|
|
45
|
+
allow(mock_service).to receive(:check).and_return(true, false, false, true, false)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
it "should not prune failed audits" do
|
|
49
|
+
5.times { job.send(:run_audit) }
|
|
50
|
+
expect(ChecksumAuditLog.logs_for(file.id, file_id).map(&:pass)).to eq [0, 1, 0, 0, 1, 0, 1]
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe CharacterizeJob do
|
|
4
|
+
let(:user) { FactoryGirl.find_or_create(:jill) }
|
|
5
|
+
|
|
6
|
+
let(:generic_file) do
|
|
7
|
+
GenericFile.create do |file|
|
|
8
|
+
file.apply_depositor_metadata(user)
|
|
9
|
+
Hydra::Works::AddFileToGenericFile.call(file, File.open(fixture_file_path('charter.docx')), :original_file)
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
subject { CharacterizeJob.new(generic_file.id) }
|
|
14
|
+
|
|
15
|
+
# Now that CreateDerivativesJob calls generic_file.create_derivatives directly
|
|
16
|
+
# this test needs to be travis exempt.
|
|
17
|
+
it 'runs CurationConcerns::CharacterizationService that spawns a CreateDerivativesJob', unless: $in_travis do
|
|
18
|
+
expect(CurationConcerns::CharacterizationService).to receive(:run).with(generic_file)
|
|
19
|
+
expect(CreateDerivativesJob).to receive(:new).with(generic_file.id).once.and_call_original
|
|
20
|
+
subject.run
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe CopyPermissionsJob do
|
|
4
|
+
|
|
5
|
+
let(:user) { FactoryGirl.create(:user) }
|
|
6
|
+
context 'for valid pid' do
|
|
7
|
+
let(:generic_work) { FactoryGirl.create(:generic_work, user: user ) }
|
|
8
|
+
let(:another_user) { FactoryGirl.create(:user) }
|
|
9
|
+
let(:generic_file_1) { FactoryGirl.create(:generic_file, user: user) }
|
|
10
|
+
let(:generic_file_2) { FactoryGirl.create(:generic_file, user: user) }
|
|
11
|
+
|
|
12
|
+
before do
|
|
13
|
+
generic_work.edit_users += [another_user]
|
|
14
|
+
generic_work.generic_files = [generic_file_1, generic_file_2]
|
|
15
|
+
generic_work.save
|
|
16
|
+
end
|
|
17
|
+
subject { CopyPermissionsJob.new(generic_work.id) }
|
|
18
|
+
|
|
19
|
+
it 'applies group/editors permissions to attached files' do
|
|
20
|
+
|
|
21
|
+
expect(generic_work.generic_files).to eq [generic_file_1, generic_file_2]
|
|
22
|
+
expect(generic_work.edit_users).to eq [user.user_key, another_user.user_key]
|
|
23
|
+
expect(generic_file_1.edit_users).to eq [user.user_key]
|
|
24
|
+
expect(generic_file_2.edit_users).to eq [user.user_key]
|
|
25
|
+
generic_work.save
|
|
26
|
+
|
|
27
|
+
subject.run
|
|
28
|
+
|
|
29
|
+
generic_work.reload.generic_files.each do |file|
|
|
30
|
+
expect(file.edit_users).to eq [user.user_key, another_user.user_key]
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
describe "an open access work" do
|
|
36
|
+
let(:generic_work) { FactoryGirl.create(:work_with_files) }
|
|
37
|
+
subject { CopyPermissionsJob.new(generic_work.id) }
|
|
38
|
+
|
|
39
|
+
it "copies visibility to its contained files" do
|
|
40
|
+
generic_work.visibility = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
|
|
41
|
+
generic_work.save
|
|
42
|
+
expect(generic_work.generic_files.first.visibility).to eq Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE
|
|
43
|
+
subject.run
|
|
44
|
+
generic_work.reload.generic_files.each do |file|
|
|
45
|
+
expect(file.visibility).to eq 'open'
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe CurationConcerns::CreateDerivativesJob do
|
|
4
|
+
before do
|
|
5
|
+
@ffmpeg_enabled = CurationConcerns.config.enable_ffmpeg
|
|
6
|
+
CurationConcerns.config.enable_ffmpeg = true
|
|
7
|
+
allow(ActiveFedora::Base).to receive(:find).with('123').and_return(generic_file)
|
|
8
|
+
allow(generic_file).to receive(:original_file).and_return(double("orignal_file", :has_content? => true))
|
|
9
|
+
end
|
|
10
|
+
let(:generic_file) { GenericFile.new }
|
|
11
|
+
|
|
12
|
+
after do
|
|
13
|
+
CurationConcerns.config.enable_ffmpeg = @ffmpeg_enabled
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
subject { CreateDerivativesJob.new('123') }
|
|
17
|
+
|
|
18
|
+
it "should call create_derivatives and save on a generic_file" do
|
|
19
|
+
expect(generic_file).to receive(:create_derivatives)
|
|
20
|
+
expect(generic_file).to receive(:save)
|
|
21
|
+
subject.run
|
|
22
|
+
end
|
|
23
|
+
end
|