hyrax 2.1.0.beta1 → 2.1.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +9 -49
- data/.rubocop_fixme.yml +1 -0
- data/.travis.yml +1 -1
- data/Gemfile +3 -3
- data/README.md +4 -2
- data/app/actors/hyrax/actors/file_set_actor.rb +0 -1
- data/app/actors/hyrax/actors/interpret_visibility_actor.rb +1 -3
- data/app/actors/hyrax/actors/model_actor.rb +4 -0
- data/app/assets/javascripts/hyrax.js +1 -1
- data/app/assets/javascripts/hyrax/app.js.erb +1 -1
- data/app/assets/javascripts/hyrax/authority_select.es6 +15 -7
- data/app/assets/javascripts/hyrax/collections.js +188 -9
- data/app/assets/javascripts/hyrax/content_blocks.js +13 -1
- data/app/assets/javascripts/hyrax/editor.es6 +2 -1
- data/app/assets/javascripts/hyrax/proxy_rights.js +2 -2
- data/app/assets/javascripts/hyrax/turbolinks_events.js +5 -0
- data/app/assets/stylesheets/hyrax/_accessibility.scss +21 -0
- data/app/assets/stylesheets/hyrax/_catalog.scss +21 -16
- data/app/assets/stylesheets/hyrax/_collections.scss +48 -7
- data/app/assets/stylesheets/hyrax/_modal.scss +4 -0
- data/app/assets/stylesheets/hyrax/_settings.scss +1 -1
- data/app/assets/stylesheets/hyrax/dashboard.scss +0 -1
- data/app/controllers/concerns/hyrax/breadcrumbs.rb +3 -1
- data/app/controllers/concerns/hyrax/embargoes_controller_behavior.rb +17 -1
- data/app/controllers/concerns/hyrax/leases_controller_behavior.rb +10 -0
- data/app/controllers/concerns/hyrax/local_file_downloads_controller_behavior.rb +86 -0
- data/app/controllers/concerns/hyrax/works_controller_behavior.rb +14 -11
- data/app/controllers/hyrax/admin/collection_types_controller.rb +11 -1
- data/app/controllers/hyrax/api/items_controller.rb +2 -6
- data/app/controllers/hyrax/batch_edits_controller.rb +6 -0
- data/app/controllers/hyrax/batch_uploads_controller.rb +1 -1
- data/app/controllers/hyrax/dashboard/collections_controller.rb +4 -7
- data/app/controllers/hyrax/dashboard/profiles_controller.rb +2 -0
- data/app/controllers/hyrax/dashboard_controller.rb +2 -2
- data/app/controllers/hyrax/depositors_controller.rb +19 -0
- data/app/controllers/hyrax/downloads_controller.rb +3 -4
- data/app/controllers/hyrax/embargoes_controller.rb +2 -0
- data/app/controllers/hyrax/file_sets_controller.rb +12 -0
- data/app/controllers/hyrax/leases_controller.rb +2 -0
- data/app/controllers/hyrax/my/works_controller.rb +9 -0
- data/app/controllers/hyrax/my_controller.rb +0 -1
- data/app/controllers/hyrax/transfers_controller.rb +1 -3
- data/app/controllers/hyrax/users_controller.rb +1 -3
- data/app/forms/hyrax/forms/admin/collection_type_form.rb +1 -1
- data/app/forms/hyrax/forms/permission_template_form.rb +1 -4
- data/app/forms/hyrax/forms/work_form.rb +1 -3
- data/app/helpers/hyrax/citations_behaviors/common_behavior.rb +1 -3
- data/app/helpers/hyrax/citations_behaviors/formatters/chicago_formatter.rb +1 -5
- data/app/helpers/hyrax/collections_helper.rb +7 -4
- data/app/helpers/hyrax/file_set_helper.rb +0 -1
- data/app/helpers/hyrax/hyrax_helper_behavior.rb +0 -1
- data/app/helpers/hyrax/trophy_helper.rb +0 -1
- data/app/indexers/hyrax/admin_set_indexer.rb +2 -0
- data/app/inputs/multi_value_select_input.rb +1 -3
- data/app/jobs/attach_files_to_work_job.rb +5 -1
- data/app/jobs/import_url_job.rb +9 -8
- data/app/models/admin_set.rb +1 -5
- data/app/models/concerns/hyrax/ability.rb +3 -4
- data/app/models/concerns/hyrax/collection_behavior.rb +0 -4
- data/app/models/concerns/hyrax/collection_nesting.rb +12 -0
- data/app/models/concerns/hyrax/suppressible.rb +1 -5
- data/app/models/featured_work_list.rb +1 -3
- data/app/models/hyrax/collection_type.rb +3 -2
- data/app/models/hyrax/permission_template_access.rb +6 -4
- data/app/models/proxy_deposit_request.rb +1 -1
- data/app/presenters/hyrax/collection_presenter.rb +0 -24
- data/app/presenters/hyrax/displays_image.rb +1 -1
- data/app/presenters/hyrax/file_set_presenter.rb +1 -1
- data/app/presenters/hyrax/menu_presenter.rb +1 -1
- data/app/presenters/hyrax/work_show_presenter.rb +15 -10
- data/app/search_builders/hyrax/abstract_type_relation.rb +2 -1
- data/app/search_builders/hyrax/collection_member_search_builder.rb +1 -1
- data/app/search_builders/hyrax/dashboard/collections_search_builder.rb +3 -1
- data/app/search_builders/hyrax/parent_collection_search_builder.rb +2 -2
- data/app/services/hyrax/admin_set_create_service.rb +1 -3
- data/app/services/hyrax/analytics.rb +1 -3
- data/app/services/hyrax/collection_member_service.rb +6 -5
- data/app/services/hyrax/collection_types/create_service.rb +37 -10
- data/app/services/hyrax/collections/permissions_create_service.rb +1 -3
- data/app/services/hyrax/collections/permissions_service.rb +6 -4
- data/app/views/catalog/_index_header_list_collection.html.erb +1 -1
- data/app/views/catalog/_index_header_list_default.html.erb +1 -1
- data/app/views/catalog/_index_list_default.html.erb +6 -10
- data/app/views/catalog/_search_form.html.erb +10 -11
- data/app/views/catalog/_thumbnail_list_collection.html.erb +1 -1
- data/app/views/catalog/_thumbnail_list_default.html.erb +1 -1
- data/app/views/hyrax/admin/admin_sets/_form.html.erb +1 -1
- data/app/views/hyrax/admin/admin_sets/_form_participant_table.html.erb +1 -1
- data/app/views/hyrax/admin/admin_sets/_form_participants.html.erb +1 -1
- data/app/views/hyrax/admin/admin_sets/_form_visibility.html.erb +3 -3
- data/app/views/hyrax/admin/admin_sets/_show_document_list_row.html.erb +2 -2
- data/app/views/hyrax/admin/admin_sets/index.html.erb +1 -1
- data/app/views/hyrax/admin/appearances/show.html.erb +4 -4
- data/app/views/hyrax/admin/collection_types/_form_settings.html.erb +3 -2
- data/app/views/hyrax/admin/collection_types/index.html.erb +2 -2
- data/app/views/hyrax/admin/features/index.html.erb +2 -4
- data/app/views/hyrax/admin/stats/_date_form.html.erb +3 -3
- data/app/views/hyrax/admin/stats/_top_data.html.erb +1 -1
- data/app/views/hyrax/admin/stats/show.html.erb +1 -1
- data/app/views/hyrax/admin/workflows/index.html.erb +0 -1
- data/app/views/hyrax/base/_file_manager_actions.html.erb +2 -2
- data/app/views/hyrax/base/_file_manager_member.html.erb +1 -1
- data/app/views/hyrax/base/_form_child_work_relationships.html.erb +1 -2
- data/app/views/hyrax/base/_form_files.html.erb +3 -3
- data/app/views/hyrax/base/_form_member_of_collections.html.erb +1 -2
- data/app/views/hyrax/base/_form_progress.html.erb +3 -3
- data/app/views/hyrax/base/_form_relationships.html.erb +2 -3
- data/app/views/hyrax/base/_form_representative.html.erb +0 -1
- data/app/views/hyrax/base/_form_share.html.erb +1 -3
- data/app/views/hyrax/base/_form_thumbnail.html.erb +0 -1
- data/app/views/hyrax/base/_form_visibility_component.html.erb +6 -6
- data/app/views/hyrax/base/_relationships_parent_rows.html.erb +3 -1
- data/app/views/hyrax/base/_representative_media.html.erb +1 -1
- data/app/views/hyrax/base/_share_with.html.erb +3 -3
- data/app/views/hyrax/base/_show_actions.html.erb +14 -1
- data/app/views/hyrax/base/_social_media.html.erb +5 -5
- data/app/views/hyrax/base/_work_title.erb +3 -1
- data/app/views/hyrax/base/_workflow_actions.html.erb +1 -1
- data/app/views/hyrax/base/inspect_work.html.erb +1 -1
- data/app/views/hyrax/base/show.html.erb +2 -2
- data/app/views/hyrax/batch_edits/_check_all.html.erb +2 -2
- data/app/views/hyrax/batch_edits/edit.html.erb +47 -44
- data/app/views/hyrax/batch_select/_add_button.html.erb +2 -2
- data/app/views/hyrax/citations/work.html.erb +3 -3
- data/app/views/hyrax/collections/_collection.html.erb +1 -1
- data/app/views/hyrax/collections/_default_group.html.erb +1 -1
- data/app/views/hyrax/collections/_list_collections.html.erb +2 -2
- data/app/views/hyrax/collections/_list_works.html.erb +1 -1
- data/app/views/hyrax/collections/_show_descriptions.html.erb +6 -6
- data/app/views/hyrax/collections/_show_document_list_row.html.erb +2 -2
- data/app/views/hyrax/collections/_show_parent_collections.html.erb +11 -38
- data/app/views/hyrax/collections/_sort_and_per_page.html.erb +13 -13
- data/app/views/hyrax/collections/_subcollection_list.html.erb +1 -1
- data/app/views/hyrax/collections/_view_type_group.html.erb +1 -1
- data/app/views/hyrax/collections/show.html.erb +122 -122
- data/app/views/hyrax/content_blocks/_form.html.erb +13 -12
- data/app/views/hyrax/content_blocks/_modal_content_block.html.erb +15 -0
- data/app/views/hyrax/dashboard/_index_partials/_proxy_rights.html.erb +25 -19
- data/app/views/hyrax/dashboard/_sidebar.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_button_for_remove_selected_from_collection.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_collection_title.html.erb +16 -16
- data/app/views/hyrax/dashboard/collections/_form.html.erb +3 -1
- data/app/views/hyrax/dashboard/collections/_form_branding.html.erb +11 -11
- data/app/views/hyrax/dashboard/collections/_form_default_group_delt.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_form_discovery.html.erb +2 -2
- data/app/views/hyrax/dashboard/collections/_form_for_select_collection.html.erb +4 -4
- data/app/views/hyrax/dashboard/collections/_form_share.html.erb +51 -44
- data/app/views/hyrax/dashboard/collections/_form_share_table.html.erb +2 -2
- data/app/views/hyrax/dashboard/collections/_list_collections.html.erb +4 -4
- data/app/views/hyrax/dashboard/collections/_list_works.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_modal_remove_from_collection.html.erb +10 -5
- data/app/views/hyrax/dashboard/collections/_modal_remove_sub_collection.html.erb +10 -5
- data/app/views/hyrax/dashboard/collections/_show_actions.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_show_add_items_actions.html.erb +2 -2
- data/app/views/hyrax/dashboard/collections/_show_document_list_row.html.erb +2 -2
- data/app/views/hyrax/dashboard/collections/_show_parent_collection_row.html.erb +10 -5
- data/app/views/hyrax/dashboard/collections/_show_parent_collections.html.erb +11 -34
- data/app/views/hyrax/dashboard/collections/_sort_and_per_page.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_subcollection_list.html.erb +23 -17
- data/app/views/hyrax/dashboard/collections/show.html.erb +6 -6
- data/app/views/hyrax/dashboard/profiles/_edit_primary.html.erb +0 -4
- data/app/views/hyrax/dashboard/profiles/_trophy_edit.html.erb +16 -14
- data/app/views/hyrax/dashboard/profiles/show.html.erb +6 -0
- data/app/views/hyrax/dashboard/show_admin.html.erb +19 -3
- data/app/views/hyrax/dashboard/sidebar/_activity.html.erb +6 -0
- data/app/views/hyrax/dashboard/works/_list_works.html.erb +1 -1
- data/app/views/hyrax/depositors/index.html.erb +13 -0
- data/app/views/hyrax/embargoes/_list_expired_active_embargoes.html.erb +1 -1
- data/app/views/hyrax/embargoes/edit.html.erb +47 -35
- data/app/views/hyrax/embargoes/index.html.erb +6 -7
- data/app/views/hyrax/file_sets/_actions.html.erb +6 -2
- data/app/views/hyrax/file_sets/_extra_fields_modal.html.erb +3 -3
- data/app/views/hyrax/file_sets/_groups_description.html.erb +0 -1
- data/app/views/hyrax/file_sets/_permission_form.html.erb +3 -3
- data/app/views/hyrax/file_sets/edit.html.erb +24 -20
- data/app/views/hyrax/file_sets/media_display/_audio.html.erb +23 -6
- data/app/views/hyrax/file_sets/media_display/_default.html.erb +1 -1
- data/app/views/hyrax/file_sets/media_display/_video.html.erb +23 -6
- data/app/views/hyrax/leases/_list_expired_active_leases.html.erb +1 -1
- data/app/views/hyrax/leases/edit.html.erb +47 -35
- data/app/views/hyrax/leases/index.html.erb +6 -6
- data/app/views/hyrax/my/_collection_action_menu.html.erb +1 -1
- data/app/views/hyrax/my/_facet_limit.html.erb +1 -2
- data/app/views/hyrax/my/_facet_pagination.html.erb +6 -6
- data/app/views/hyrax/my/_facet_pivot.html.erb +1 -1
- data/app/views/hyrax/my/_results_pagination.html.erb +1 -1
- data/app/views/hyrax/my/collections/_facets.html.erb +1 -1
- data/app/views/hyrax/my/collections/_list_collections.html.erb +5 -5
- data/app/views/hyrax/my/collections/_modal_add_subcollection.html.erb +3 -2
- data/app/views/hyrax/my/collections/_modal_add_to_collection.html.erb +3 -1
- data/app/views/hyrax/my/collections/_modal_add_to_collection_permission_deny.html.erb +1 -1
- data/app/views/hyrax/my/collections/_modal_collection_types_to_create.html.erb +2 -2
- data/app/views/hyrax/my/collections/_modal_delete_collection.html.erb +1 -2
- data/app/views/hyrax/my/collections/_modal_delete_deny.html.erb +1 -1
- data/app/views/hyrax/my/collections/_modal_delete_selected_collections.html.erb +2 -2
- data/app/views/hyrax/my/collections/_tabs.html.erb +2 -2
- data/app/views/hyrax/my/collections/index.html.erb +7 -3
- data/app/views/hyrax/my/facet.html.erb +1 -1
- data/app/views/hyrax/my/index.html.erb +6 -2
- data/app/views/hyrax/my/works/_facets.html.erb +1 -1
- data/app/views/hyrax/my/works/_list_works.html.erb +1 -1
- data/app/views/hyrax/my/works/_tabs.html.erb +2 -2
- data/app/views/hyrax/my/works/index.html.erb +6 -2
- data/app/views/hyrax/notifications/_notifications.html.erb +1 -1
- data/app/views/hyrax/pages/_form.html.erb +12 -12
- data/app/views/hyrax/pages/show.html.erb +1 -1
- data/app/views/hyrax/single_use_links_viewer/show.html.erb +1 -1
- data/app/views/hyrax/stats/file.html.erb +6 -2
- data/app/views/hyrax/stats/work.html.erb +6 -2
- data/app/views/hyrax/transfers/_received.html.erb +6 -6
- data/app/views/hyrax/transfers/_sent.html.erb +2 -2
- data/app/views/hyrax/transfers/new.html.erb +0 -1
- data/app/views/hyrax/users/_activity_log.html.erb +2 -2
- data/app/views/hyrax/users/_profile_tabs.html.erb +1 -1
- data/app/views/hyrax/users/_search_form.html.erb +1 -1
- data/app/views/hyrax/users/_user.html.erb +0 -1
- data/app/views/hyrax/users/index.html.erb +1 -1
- data/app/views/kaminari/blacklight_compact/_paginator.html.erb +1 -2
- data/app/views/layouts/_head_tag_content.html.erb +2 -2
- data/app/views/layouts/error.html.erb +1 -1
- data/app/views/layouts/hyrax.html.erb +6 -3
- data/app/views/layouts/hyrax/dashboard.html.erb +6 -3
- data/app/views/records/show_fields/_based_near.html.erb +0 -1
- data/app/views/records/show_fields/_contributor.html.erb +0 -1
- data/app/views/records/show_fields/_date_created.html.erb +0 -1
- data/app/views/records/show_fields/_description.html.erb +1 -1
- data/app/views/records/show_fields/_identifier.html.erb +0 -1
- data/app/views/records/show_fields/_language.html.erb +0 -1
- data/app/views/records/show_fields/_publisher.html.erb +0 -1
- data/app/views/records/show_fields/_related_url.html.erb +0 -1
- data/app/views/records/show_fields/_resource_type.html.erb +0 -1
- data/app/views/records/show_fields/_subject.html.erb +0 -1
- data/app/views/shared/_citations.html.erb +17 -17
- data/app/views/shared/_select_work_type_modal.html.erb +2 -2
- data/config/locales/hyrax.de.yml +198 -189
- data/config/locales/hyrax.en.yml +21 -14
- data/config/locales/hyrax.es.yml +9 -0
- data/config/locales/hyrax.fr.yml +9 -0
- data/config/locales/hyrax.it.yml +9 -0
- data/config/locales/hyrax.pt-BR.yml +9 -0
- data/config/locales/hyrax.zh.yml +9 -0
- data/config/routes.rb +1 -0
- data/hyrax.gemspec +7 -18
- data/lib/generators/hyrax/models_generator.rb +0 -1
- data/lib/generators/hyrax/templates/db/migrate/20180302200051_add_branding_to_collection_type.rb.erb +5 -0
- data/lib/generators/hyrax/work/templates/feature_spec.rb.erb +1 -1
- data/lib/hyrax/configuration.rb +2 -4
- data/lib/hyrax/engine.rb +22 -4
- data/lib/hyrax/version.rb +1 -1
- data/spec/actors/hyrax/actors/lease_actor_spec.rb +16 -0
- data/spec/controllers/hyrax/admin/appearances_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/admin/collection_types_controller_spec.rb +2 -0
- data/spec/controllers/hyrax/admin/features_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/admin/workflow_roles_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/admin/workflows_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/batch_edits_controller_spec.rb +14 -1
- data/spec/controllers/hyrax/batch_uploads_controller_spec.rb +2 -2
- data/spec/controllers/hyrax/citations_controller_spec.rb +4 -2
- data/spec/controllers/hyrax/collections_controller_spec.rb +32 -4
- data/spec/controllers/hyrax/content_blocks_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/dashboard/collections_controller_spec.rb +11 -6
- data/spec/controllers/hyrax/depositors_controller_spec.rb +11 -0
- data/spec/controllers/hyrax/downloads_controller_spec.rb +42 -0
- data/spec/controllers/hyrax/embargoes_controller_spec.rb +40 -1
- data/spec/controllers/hyrax/file_sets_controller_spec.rb +10 -2
- data/spec/controllers/hyrax/generic_works_controller_spec.rb +38 -6
- data/spec/controllers/hyrax/leases_controller_spec.rb +11 -0
- data/spec/controllers/hyrax/my/collections_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/my/works_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/pages_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/stats_controller_spec.rb +2 -0
- data/spec/controllers/hyrax/transfers_controller_spec.rb +1 -1
- data/spec/factories/collection_types.rb +10 -1
- data/spec/factories/collections.rb +5 -3
- data/spec/factories/collections_factory.rb +3 -3
- data/spec/factories/file_sets.rb +2 -6
- data/spec/factories/generic_works.rb +68 -4
- data/spec/factory_tests/collections_factory_spec.rb +2 -1
- data/spec/features/batch_create_spec.rb +60 -0
- data/spec/features/batch_edit_spec.rb +1 -0
- data/spec/features/browse_dashboard_works_spec.rb +1 -0
- data/spec/features/collection_multi_membership_spec.rb +9 -6
- data/spec/features/collection_spec.rb +1 -1
- data/spec/features/collection_type_spec.rb +49 -1
- data/spec/features/create_work_admin_spec.rb +2 -2
- data/spec/features/create_work_spec.rb +1 -0
- data/spec/features/dashboard/all_works.rb +10 -2
- data/spec/features/dashboard/collection_spec.rb +38 -17
- data/spec/features/dashboard/display_admin_dashboard_spec.rb +29 -0
- data/spec/features/dashboard/display_dashboard_spec.rb +1 -1
- data/spec/features/edit_content_block_admin_spec.rb +45 -0
- data/spec/features/edit_work_spec.rb +40 -2
- data/spec/features/ownership_transfer_spec.rb +1 -0
- data/spec/features/proxy_spec.rb +2 -2
- data/spec/features/search_spec.rb +2 -5
- data/spec/features/work_show_spec.rb +14 -4
- data/spec/forms/hyrax/forms/admin/collection_type_form_spec.rb +1 -0
- data/spec/forms/hyrax/forms/collection_form_spec.rb +1 -1
- data/spec/helpers/hyrax/ability_helper_spec.rb +2 -2
- data/spec/helpers/hyrax/collections_helper_spec.rb +12 -4
- data/spec/javascripts/authority_select_spec.js +1 -1
- data/spec/javascripts/settings_spec.js +1 -0
- data/spec/jobs/attach_files_to_work_job_spec.rb +13 -0
- data/spec/jobs/import_url_job_spec.rb +14 -0
- data/spec/models/collection_spec.rb +1 -0
- data/spec/models/concerns/hyrax/collection_nesting_spec.rb +16 -0
- data/spec/models/hyrax/collection_type_spec.rb +1 -0
- data/spec/presenters/hyrax/collection_presenter_spec.rb +1 -100
- data/spec/presenters/hyrax/file_set_presenter_spec.rb +17 -2
- data/spec/presenters/hyrax/menu_presenter_spec.rb +6 -0
- data/spec/presenters/hyrax/work_show_presenter_spec.rb +15 -3
- data/spec/search_builders/hyrax/abstract_type_relation_spec.rb +18 -0
- data/spec/search_builders/hyrax/dashboard/collections_search_builder_spec.rb +30 -19
- data/spec/search_builders/hyrax/parent_collection_search_builder_spec.rb +15 -0
- data/spec/services/hyrax/collection_member_service_spec.rb +10 -19
- data/spec/services/hyrax/collection_types/create_service_spec.rb +35 -2
- data/spec/services/hyrax/collections/collection_member_service_spec.rb +1 -1
- data/spec/services/hyrax/qa_select_service_spec.rb +0 -1
- data/spec/support/selectors.rb +15 -0
- data/spec/views/hyrax/admin/admin_sets/_show_document_list_row.html.erb_spec.rb +2 -0
- data/spec/views/hyrax/admin/collection_types/_form_settings.html.erb_spec.rb +1 -0
- data/spec/views/hyrax/admin/stats/show.html.erb_spec.rb +9 -0
- data/spec/views/hyrax/base/_attributes.html.erb_spec.rb +1 -1
- data/spec/views/hyrax/base/_relationships.html.erb_spec.rb +13 -1
- data/spec/views/hyrax/base/_show_actions.html.erb_spec.rb +10 -0
- data/spec/views/hyrax/base/show.html.erb_spec.rb +8 -0
- data/spec/views/hyrax/collections/_show_parent_collections.html.erb_spec.rb +3 -53
- data/spec/views/hyrax/dashboard/_sidebar.html.erb_spec.rb +22 -0
- data/spec/views/hyrax/dashboard/collections/_form_share.erb_spec.rb +2 -1
- data/spec/views/hyrax/dashboard/collections/_show_actions.html.erb_spec.rb +13 -0
- data/spec/views/hyrax/dashboard/collections/_show_parent_collection_row.html.erb_spec.rb +26 -8
- data/spec/views/hyrax/dashboard/collections/_show_parent_collections.html.erb_spec.rb +7 -43
- data/spec/views/hyrax/dashboard/collections/_subcollection_list.html.erb_spec.rb +13 -1
- data/spec/views/hyrax/dashboard/collections/show.html.erb_spec.rb +1 -0
- data/spec/views/hyrax/dashboard/profiles/_trophy_edit.html.erb_spec.rb +36 -0
- data/spec/views/hyrax/dashboard/profiles/edit.html.erb_spec.rb +0 -38
- data/spec/views/hyrax/dashboard/profiles/show.html.erb_spec.rb +37 -0
- data/spec/views/hyrax/depositors/index.html.erb_spec.rb +13 -0
- data/spec/views/hyrax/file_sets/_actions.html.erb_spec.rb +15 -0
- data/spec/views/hyrax/file_sets/media_display/_audio.html.erb_spec.rb +29 -0
- data/spec/views/hyrax/file_sets/media_display/_default.html.erb_spec.rb +1 -1
- data/spec/views/hyrax/file_sets/media_display/_video.html.erb_spec.rb +29 -0
- data/spec/views/hyrax/my/collections/_list_collections.html.erb_spec.rb +6 -2
- data/tasks/hyrax_dev.rake +1 -3
- data/template.rb +1 -1
- metadata +49 -41
- data/app/assets/javascripts/hyrax/collections_forms.js +0 -108
@@ -66,6 +66,48 @@ RSpec.describe Hyrax::DownloadsController do
|
|
66
66
|
expect(ActiveFedora::Base).not_to receive(:find).with(file_set.id)
|
67
67
|
get :show, params: { id: file_set, file: 'thumbnail' }
|
68
68
|
end
|
69
|
+
|
70
|
+
context "stream" do
|
71
|
+
it "head request" do
|
72
|
+
request.env["HTTP_RANGE"] = 'bytes=0-15'
|
73
|
+
head :show, params: { id: file_set, file: 'thumbnail' }
|
74
|
+
expect(response.headers['Content-Length']).to eq '4218'
|
75
|
+
expect(response.headers['Accept-Ranges']).to eq 'bytes'
|
76
|
+
expect(response.headers['Content-Type']).to start_with 'image/png'
|
77
|
+
end
|
78
|
+
|
79
|
+
it "sends the whole thing" do
|
80
|
+
request.env["HTTP_RANGE"] = 'bytes=0-4217'
|
81
|
+
get :show, params: { id: file_set, file: 'thumbnail' }
|
82
|
+
expect(response.headers["Content-Range"]).to eq 'bytes 0-4217/4218'
|
83
|
+
expect(response.headers["Content-Length"]).to eq '4218'
|
84
|
+
expect(response.headers['Accept-Ranges']).to eq 'bytes'
|
85
|
+
expect(response.headers['Content-Type']).to start_with "image/png"
|
86
|
+
expect(response.headers["Content-Disposition"]).to eq "inline; filename=\"world.png\""
|
87
|
+
expect(response.body).to eq content
|
88
|
+
expect(response.status).to eq 206
|
89
|
+
end
|
90
|
+
|
91
|
+
it "sends the whole thing when the range is open ended" do
|
92
|
+
request.env["HTTP_RANGE"] = 'bytes=0-'
|
93
|
+
get :show, params: { id: file_set, file: 'thumbnail' }
|
94
|
+
expect(response.body).to eq content
|
95
|
+
end
|
96
|
+
|
97
|
+
it "gets a range not starting at the beginning" do
|
98
|
+
request.env["HTTP_RANGE"] = 'bytes=4200-4217'
|
99
|
+
get :show, params: { id: file_set, file: 'thumbnail' }
|
100
|
+
expect(response.headers["Content-Range"]).to eq 'bytes 4200-4217/4218'
|
101
|
+
expect(response.headers["Content-Length"]).to eq '18'
|
102
|
+
end
|
103
|
+
|
104
|
+
it "gets a range not ending at the end" do
|
105
|
+
request.env["HTTP_RANGE"] = 'bytes=4-11'
|
106
|
+
get :show, params: { id: file_set, file: 'thumbnail' }
|
107
|
+
expect(response.headers["Content-Range"]).to eq 'bytes 4-11/4218'
|
108
|
+
expect(response.headers["Content-Length"]).to eq '8'
|
109
|
+
end
|
110
|
+
end
|
69
111
|
end
|
70
112
|
|
71
113
|
context "that isn't persisted" do
|
@@ -2,7 +2,6 @@ RSpec.describe Hyrax::EmbargoesController do
|
|
2
2
|
let(:user) { create(:user) }
|
3
3
|
let(:a_work) { create(:generic_work, user: user) }
|
4
4
|
let(:not_my_work) { create(:generic_work) }
|
5
|
-
|
6
5
|
before { sign_in user }
|
7
6
|
|
8
7
|
describe '#index' do
|
@@ -16,8 +15,12 @@ RSpec.describe Hyrax::EmbargoesController do
|
|
16
15
|
let(:user) { create(:user, groups: ['admin']) }
|
17
16
|
|
18
17
|
it 'shows me the page' do
|
18
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', root_path)
|
19
|
+
expect(controller).to receive(:add_breadcrumb).with('Dashboard', dashboard_path)
|
20
|
+
expect(controller).to receive(:add_breadcrumb).with('Manage Embargoes', embargoes_path)
|
19
21
|
get :index
|
20
22
|
expect(response).to be_success
|
23
|
+
expect(response).to render_template('dashboard')
|
21
24
|
end
|
22
25
|
end
|
23
26
|
end
|
@@ -32,8 +35,13 @@ RSpec.describe Hyrax::EmbargoesController do
|
|
32
35
|
end
|
33
36
|
context 'when I have permission to edit the object' do
|
34
37
|
it 'shows me the page' do
|
38
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', root_path)
|
39
|
+
expect(controller).to receive(:add_breadcrumb).with('Dashboard', dashboard_path)
|
40
|
+
expect(controller).to receive(:add_breadcrumb).with('Manage Embargoes', embargoes_path)
|
41
|
+
expect(controller).to receive(:add_breadcrumb).with('Update Embargo', '#')
|
35
42
|
get :edit, params: { id: a_work }
|
36
43
|
expect(response).to be_success
|
44
|
+
expect(response).to render_template('dashboard')
|
37
45
|
end
|
38
46
|
end
|
39
47
|
end
|
@@ -101,6 +109,37 @@ RSpec.describe Hyrax::EmbargoesController do
|
|
101
109
|
expect(response).to redirect_to embargoes_path
|
102
110
|
end
|
103
111
|
end
|
112
|
+
|
113
|
+
context 'with an expired embargo and filesets in batch_document_ids and in embargoes' do
|
114
|
+
let(:file_set2) { create(:file_set, id: 'fileset_2', visibility: Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED) }
|
115
|
+
let(:file_set3) { create(:file_set, id: 'fileset_3', visibility: Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED) }
|
116
|
+
let(:release_date) { Time.zone.today - 2 }
|
117
|
+
let(:batch) { [file_set2.id, a_work.id] }
|
118
|
+
before do
|
119
|
+
file_set2.visibility = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED
|
120
|
+
file_set2.visibility_during_embargo = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED
|
121
|
+
file_set2.visibility_after_embargo = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
|
122
|
+
file_set2.embargo_release_date = release_date.to_s
|
123
|
+
file_set2.embargo.save(validate: false)
|
124
|
+
file_set2.save(validate: false)
|
125
|
+
file_set3.visibility = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED
|
126
|
+
file_set3.visibility_during_embargo = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED
|
127
|
+
file_set3.visibility_after_embargo = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
|
128
|
+
file_set3.embargo_release_date = release_date.to_s
|
129
|
+
file_set3.embargo.save(validate: false)
|
130
|
+
file_set3.save(validate: false)
|
131
|
+
end
|
132
|
+
|
133
|
+
it 'deactivates embargo, updates the visibility and redirects' do
|
134
|
+
allow(controller).to receive(:filter_docs_with_edit_access!).and_return(true)
|
135
|
+
patch :update, params: { batch_document_ids: batch, embargoes: { '0' => { copy_visibility: file_set2.id }, '1' => { copy_visibility: a_work.id } } }
|
136
|
+
expect(a_work.reload.visibility).to eq Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
|
137
|
+
expect(file_set.reload.visibility).to eq Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
|
138
|
+
expect(file_set2.reload.visibility).to eq Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
|
139
|
+
expect(file_set3.reload.visibility).to eq Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED
|
140
|
+
expect(response).to redirect_to embargoes_path
|
141
|
+
end
|
142
|
+
end
|
104
143
|
end
|
105
144
|
end
|
106
145
|
end
|
@@ -56,6 +56,7 @@ RSpec.describe Hyrax::FileSetsController do
|
|
56
56
|
end
|
57
57
|
|
58
58
|
it "sets the breadcrumbs and versions presenter" do
|
59
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', Hyrax::Engine.routes.url_helpers.root_path(locale: 'en'))
|
59
60
|
expect(controller).to receive(:add_breadcrumb).with(I18n.t('hyrax.dashboard.title'), Hyrax::Engine.routes.url_helpers.dashboard_path(locale: 'en'))
|
60
61
|
expect(controller).to receive(:add_breadcrumb).with(I18n.t('hyrax.dashboard.my.works'), Hyrax::Engine.routes.url_helpers.my_works_path(locale: 'en'))
|
61
62
|
expect(controller).to receive(:add_breadcrumb).with(I18n.t('hyrax.file_set.browse_view'), Rails.application.routes.url_helpers.hyrax_file_set_path(file_set, locale: 'en'))
|
@@ -66,6 +67,7 @@ RSpec.describe Hyrax::FileSetsController do
|
|
66
67
|
expect(assigns[:version_list]).to be_kind_of Hyrax::VersionListPresenter
|
67
68
|
expect(assigns[:parent]).to eq parent
|
68
69
|
expect(response).to render_template(:edit)
|
70
|
+
expect(response).to render_template('dashboard')
|
69
71
|
end
|
70
72
|
end
|
71
73
|
|
@@ -150,6 +152,7 @@ RSpec.describe Hyrax::FileSetsController do
|
|
150
152
|
post :update, params: { id: file_set, revision: version1 }
|
151
153
|
expect(response.code).to eq '401'
|
152
154
|
expect(response).to render_template 'unauthorized'
|
155
|
+
expect(response).to render_template('dashboard')
|
153
156
|
end
|
154
157
|
end
|
155
158
|
end
|
@@ -196,6 +199,7 @@ RSpec.describe Hyrax::FileSetsController do
|
|
196
199
|
post :update, params: { id: file_set, file_set: { keyword: [''] } }
|
197
200
|
expect(response.code).to eq '422'
|
198
201
|
expect(response).to render_template('edit')
|
202
|
+
expect(response).to render_template('dashboard')
|
199
203
|
expect(assigns[:file_set]).to eq file_set
|
200
204
|
end
|
201
205
|
end
|
@@ -220,6 +224,7 @@ RSpec.describe Hyrax::FileSetsController do
|
|
220
224
|
get :edit, params: { id: file_set }
|
221
225
|
expect(response.code).to eq '401'
|
222
226
|
expect(response).to render_template('unauthorized')
|
227
|
+
expect(response).to render_template('dashboard')
|
223
228
|
end
|
224
229
|
end
|
225
230
|
end
|
@@ -231,6 +236,7 @@ RSpec.describe Hyrax::FileSetsController do
|
|
231
236
|
|
232
237
|
context "without a referer" do
|
233
238
|
it "shows me the file and set breadcrumbs" do
|
239
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', Hyrax::Engine.routes.url_helpers.root_path(locale: 'en'))
|
234
240
|
expect(controller).to receive(:add_breadcrumb).with(I18n.t('hyrax.dashboard.title'), Hyrax::Engine.routes.url_helpers.dashboard_path(locale: 'en'))
|
235
241
|
get :show, params: { id: file_set }
|
236
242
|
expect(response).to be_successful
|
@@ -257,8 +263,9 @@ RSpec.describe Hyrax::FileSetsController do
|
|
257
263
|
end
|
258
264
|
|
259
265
|
it "shows me the breadcrumbs" do
|
260
|
-
expect(controller).to receive(:add_breadcrumb).with('
|
261
|
-
expect(controller).to receive(:add_breadcrumb).with('
|
266
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', Hyrax::Engine.routes.url_helpers.root_path(locale: 'en'))
|
267
|
+
expect(controller).to receive(:add_breadcrumb).with('Dashboard', Hyrax::Engine.routes.url_helpers.dashboard_path(locale: 'en'))
|
268
|
+
expect(controller).to receive(:add_breadcrumb).with('Works', Hyrax::Engine.routes.url_helpers.my_works_path(locale: 'en'))
|
262
269
|
expect(controller).to receive(:add_breadcrumb).with('test title', main_app.hyrax_generic_work_path(work.id, locale: 'en'))
|
263
270
|
expect(controller).to receive(:add_breadcrumb).with('test file', main_app.hyrax_file_set_path(file_set, locale: 'en'))
|
264
271
|
get :show, params: { id: file_set }
|
@@ -278,6 +285,7 @@ RSpec.describe Hyrax::FileSetsController do
|
|
278
285
|
get :edit, params: { id: public_file_set }
|
279
286
|
expect(response.code).to eq '401'
|
280
287
|
expect(response).to render_template(:unauthorized)
|
288
|
+
expect(response).to render_template('dashboard')
|
281
289
|
end
|
282
290
|
end
|
283
291
|
|
@@ -48,6 +48,36 @@ RSpec.describe Hyrax::GenericWorksController do
|
|
48
48
|
before do
|
49
49
|
create(:sipity_entity, proxy_for_global_id: work.to_global_id.to_s)
|
50
50
|
end
|
51
|
+
|
52
|
+
context 'while logged out' do
|
53
|
+
let(:work) { create(:public_generic_work, user: user, title: ['public thing']) }
|
54
|
+
|
55
|
+
before { sign_out user }
|
56
|
+
|
57
|
+
context "without a referer" do
|
58
|
+
it "sets the default breadcrumbs" do
|
59
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', Hyrax::Engine.routes.url_helpers.root_path(locale: 'en'))
|
60
|
+
get :show, params: { id: work }
|
61
|
+
expect(response).to be_successful
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
context "with a referer" do
|
66
|
+
before do
|
67
|
+
request.env['HTTP_REFERER'] = 'http://test.host/foo'
|
68
|
+
end
|
69
|
+
|
70
|
+
it "sets breadcrumbs to authorized pages" do
|
71
|
+
expect(controller).not_to receive(:add_breadcrumb).with('Dashboard', hyrax.dashboard_path(locale: 'en'))
|
72
|
+
expect(controller).not_to receive(:add_breadcrumb).with('Your Works', hyrax.my_works_path(locale: 'en'))
|
73
|
+
expect(controller).to receive(:add_breadcrumb).with('public thing', main_app.hyrax_generic_work_path(work.id, locale: 'en'))
|
74
|
+
get :show, params: { id: work }
|
75
|
+
expect(response).to be_successful
|
76
|
+
expect(response).to render_template("layouts/hyrax/1_column")
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
51
81
|
context 'my own private work' do
|
52
82
|
let(:work) { create(:private_generic_work, user: user, title: ['test title']) }
|
53
83
|
|
@@ -59,7 +89,8 @@ RSpec.describe Hyrax::GenericWorksController do
|
|
59
89
|
|
60
90
|
context "without a referer" do
|
61
91
|
it "sets breadcrumbs" do
|
62
|
-
expect(controller).to receive(:add_breadcrumb).with(
|
92
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', Hyrax::Engine.routes.url_helpers.root_path(locale: 'en'))
|
93
|
+
expect(controller).to receive(:add_breadcrumb).with("Dashboard", hyrax.dashboard_path(locale: 'en'))
|
63
94
|
get :show, params: { id: work }
|
64
95
|
expect(response).to be_successful
|
65
96
|
end
|
@@ -71,8 +102,9 @@ RSpec.describe Hyrax::GenericWorksController do
|
|
71
102
|
end
|
72
103
|
|
73
104
|
it "sets breadcrumbs" do
|
74
|
-
expect(controller).to receive(:add_breadcrumb).with('
|
75
|
-
expect(controller).to receive(:add_breadcrumb).with('
|
105
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', Hyrax::Engine.routes.url_helpers.root_path(locale: 'en'))
|
106
|
+
expect(controller).to receive(:add_breadcrumb).with('Dashboard', hyrax.dashboard_path(locale: 'en'))
|
107
|
+
expect(controller).to receive(:add_breadcrumb).with('Works', hyrax.my_works_path(locale: 'en'))
|
76
108
|
expect(controller).to receive(:add_breadcrumb).with('test title', main_app.hyrax_generic_work_path(work.id, locale: 'en'))
|
77
109
|
get :show, params: { id: work }
|
78
110
|
expect(response).to be_successful
|
@@ -120,7 +152,7 @@ RSpec.describe Hyrax::GenericWorksController do
|
|
120
152
|
end
|
121
153
|
end
|
122
154
|
|
123
|
-
context 'someone
|
155
|
+
context 'someone else\'s public work' do
|
124
156
|
let(:work) { create(:public_generic_work) }
|
125
157
|
|
126
158
|
context "html" do
|
@@ -352,8 +384,8 @@ RSpec.describe Hyrax::GenericWorksController do
|
|
352
384
|
|
353
385
|
it 'shows me the page and sets breadcrumbs' do
|
354
386
|
expect(controller).to receive(:add_breadcrumb).with("Home", root_path(locale: 'en'))
|
355
|
-
expect(controller).to receive(:add_breadcrumb).with("
|
356
|
-
expect(controller).to receive(:add_breadcrumb).with("
|
387
|
+
expect(controller).to receive(:add_breadcrumb).with("Dashboard", hyrax.dashboard_path(locale: 'en'))
|
388
|
+
expect(controller).to receive(:add_breadcrumb).with("Works", hyrax.my_works_path(locale: 'en'))
|
357
389
|
expect(controller).to receive(:add_breadcrumb).with(work.title.first, main_app.hyrax_generic_work_path(work.id, locale: 'en'))
|
358
390
|
expect(controller).to receive(:add_breadcrumb).with('Edit', main_app.edit_hyrax_generic_work_path(work.id))
|
359
391
|
|
@@ -16,8 +16,13 @@ RSpec.describe Hyrax::LeasesController do
|
|
16
16
|
let(:user) { create(:user, groups: ['admin']) }
|
17
17
|
|
18
18
|
it 'shows me the page' do
|
19
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', root_path)
|
20
|
+
expect(controller).to receive(:add_breadcrumb).with('Dashboard', dashboard_path)
|
21
|
+
expect(controller).to receive(:add_breadcrumb).with('Manage Leases', leases_path)
|
22
|
+
|
19
23
|
get :index
|
20
24
|
expect(response).to be_success
|
25
|
+
expect(response).to render_template('dashboard')
|
21
26
|
end
|
22
27
|
end
|
23
28
|
end
|
@@ -32,8 +37,14 @@ RSpec.describe Hyrax::LeasesController do
|
|
32
37
|
end
|
33
38
|
context 'when I have permission to edit the object' do
|
34
39
|
it 'shows me the page' do
|
40
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', root_path)
|
41
|
+
expect(controller).to receive(:add_breadcrumb).with('Dashboard', dashboard_path)
|
42
|
+
expect(controller).to receive(:add_breadcrumb).with('Manage Leases', leases_path)
|
43
|
+
expect(controller).to receive(:add_breadcrumb).with('Update Lease', '#')
|
44
|
+
|
35
45
|
get :edit, params: { id: a_work }
|
36
46
|
expect(response).to be_success
|
47
|
+
expect(response).to render_template('dashboard')
|
37
48
|
end
|
38
49
|
end
|
39
50
|
end
|
@@ -13,7 +13,7 @@ RSpec.describe Hyrax::My::CollectionsController, type: :controller do
|
|
13
13
|
expect(controller).to receive(:search_results).with(ActionController::Parameters).and_return([response, doc_list])
|
14
14
|
|
15
15
|
expect(controller).to receive(:add_breadcrumb).with('Home', root_path(locale: 'en'))
|
16
|
-
expect(controller).to receive(:add_breadcrumb).with('
|
16
|
+
expect(controller).to receive(:add_breadcrumb).with('Dashboard', dashboard_path(locale: 'en'))
|
17
17
|
expect(controller).to receive(:add_breadcrumb).with('Collections', my_collections_path(locale: 'en'))
|
18
18
|
|
19
19
|
get :index, params: { per_page: 2 }
|
@@ -17,7 +17,7 @@ RSpec.describe Hyrax::My::WorksController, type: :controller do
|
|
17
17
|
it "shows search results and breadcrumbs" do
|
18
18
|
expect(controller).to receive(:search_results).with(ActionController::Parameters).and_return([response, doc_list])
|
19
19
|
expect(controller).to receive(:add_breadcrumb).with('Home', root_path(locale: 'en'))
|
20
|
-
expect(controller).to receive(:add_breadcrumb).with('
|
20
|
+
expect(controller).to receive(:add_breadcrumb).with('Dashboard', dashboard_path(locale: 'en'))
|
21
21
|
expect(controller).to receive(:add_breadcrumb).with('Works', my_works_path(locale: 'en'))
|
22
22
|
expect(collection_service).to receive(:search_results).with(:deposit).and_return([my_collection])
|
23
23
|
get :index, params: { per_page: 2 }
|
@@ -68,7 +68,7 @@ RSpec.describe Hyrax::PagesController, type: :controller do
|
|
68
68
|
describe "GET #edit" do
|
69
69
|
it "renders breadcrumbs and dashboard layout" do
|
70
70
|
expect(controller).to receive(:add_breadcrumb).with('Home', root_path)
|
71
|
-
expect(controller).to receive(:add_breadcrumb).with('
|
71
|
+
expect(controller).to receive(:add_breadcrumb).with('Dashboard', dashboard_path)
|
72
72
|
expect(controller).to receive(:add_breadcrumb).with('Configuration', '#')
|
73
73
|
expect(controller).to receive(:add_breadcrumb).with('Pages', edit_pages_path)
|
74
74
|
get :edit
|
@@ -17,6 +17,7 @@ RSpec.describe Hyrax::StatsController do
|
|
17
17
|
|
18
18
|
it 'renders the stats view' do
|
19
19
|
expect(Hyrax::FileUsage).to receive(:new).with(file_set.id).and_return(usage)
|
20
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', Hyrax::Engine.routes.url_helpers.root_path(locale: 'en'))
|
20
21
|
expect(controller).to receive(:add_breadcrumb).with(I18n.t('hyrax.dashboard.title'), Hyrax::Engine.routes.url_helpers.dashboard_path(locale: 'en'))
|
21
22
|
expect(controller).to receive(:add_breadcrumb).with(I18n.t('hyrax.dashboard.my.works'), Hyrax::Engine.routes.url_helpers.my_works_path(locale: 'en'))
|
22
23
|
expect(controller).to receive(:add_breadcrumb).with(I18n.t('hyrax.file_set.browse_view'), Rails.application.routes.url_helpers.hyrax_file_set_path(file_set, locale: 'en'))
|
@@ -60,6 +61,7 @@ RSpec.describe Hyrax::StatsController do
|
|
60
61
|
|
61
62
|
it 'renders the stats view' do
|
62
63
|
expect(Hyrax::WorkUsage).to receive(:new).with(work.id).and_return(usage)
|
64
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', Hyrax::Engine.routes.url_helpers.root_path(locale: 'en'))
|
63
65
|
expect(controller).to receive(:add_breadcrumb).with(I18n.t('hyrax.dashboard.my.works'), Hyrax::Engine.routes.url_helpers.my_works_path(locale: 'en'))
|
64
66
|
expect(controller).to receive(:add_breadcrumb).with(I18n.t('hyrax.dashboard.title'), Hyrax::Engine.routes.url_helpers.dashboard_path(locale: 'en'))
|
65
67
|
expect(controller).to receive(:add_breadcrumb).with('Test title', main_app.hyrax_generic_work_path(work, locale: 'en'))
|
@@ -64,7 +64,7 @@ RSpec.describe Hyrax::TransfersController, type: :controller do
|
|
64
64
|
# AND A NOTIFICATION SHOULD HAVE BEEN CREATED
|
65
65
|
notification = another_user.reload.mailbox.inbox[0].messages[0]
|
66
66
|
expect(notification.subject).to eq("Ownership Change Request")
|
67
|
-
expect(notification.body).to eq("<a href=\"
|
67
|
+
expect(notification.body).to eq("<a href=\"#{routes.url_helpers.user_path(user)}\">#{user.name}</a> " \
|
68
68
|
"wants to transfer a work to you. Review all " \
|
69
69
|
"<a href=\"#{routes.url_helpers.transfers_path}\">transfer requests</a>")
|
70
70
|
end
|
@@ -1,12 +1,13 @@
|
|
1
1
|
FactoryBot.define do
|
2
2
|
factory :collection_type, class: Hyrax::CollectionType do
|
3
|
-
sequence(:title) { |n| "
|
3
|
+
sequence(:title) { |n| "Collection Type #{n}" }
|
4
4
|
sequence(:machine_id) { |n| "title_#{n}" }
|
5
5
|
|
6
6
|
description 'Collection type with all options'
|
7
7
|
nestable true
|
8
8
|
discoverable true
|
9
9
|
sharable true
|
10
|
+
brandable true
|
10
11
|
share_applies_to_new_works true
|
11
12
|
allow_multiple_membership true
|
12
13
|
require_membership false
|
@@ -70,6 +71,14 @@ FactoryBot.define do
|
|
70
71
|
discoverable false
|
71
72
|
end
|
72
73
|
|
74
|
+
trait :brandable do
|
75
|
+
brandable true
|
76
|
+
end
|
77
|
+
|
78
|
+
trait :not_brandable do
|
79
|
+
brandable false
|
80
|
+
end
|
81
|
+
|
73
82
|
trait :sharable do
|
74
83
|
sharable true
|
75
84
|
share_applies_to_new_works true
|
@@ -52,6 +52,7 @@ FactoryBot.define do
|
|
52
52
|
# let(:settings) { [
|
53
53
|
# :nestable, # OR :not_nestable,
|
54
54
|
# :discoverable, # OR :not_discoverable
|
55
|
+
# :brandable, # OR :not_brandable
|
55
56
|
# :sharable, # OR :not_sharable OR :sharable_no_work_permissions
|
56
57
|
# :allow_multiple_membership, # OR :not_allow_multiple_membership
|
57
58
|
# ] }
|
@@ -63,6 +64,7 @@ FactoryBot.define do
|
|
63
64
|
# let(:settings) { [
|
64
65
|
# :nestable, # OR :not_nestable,
|
65
66
|
# :discoverable, # OR :not_discoverable
|
67
|
+
# :brandable, # OR :not_brandable
|
66
68
|
# :sharable, # OR :not_sharable OR :sharable_no_work_permissions
|
67
69
|
# :allow_multiple_membership, # OR :not_allow_multiple_membership
|
68
70
|
# ] }
|
@@ -105,7 +107,7 @@ FactoryBot.define do
|
|
105
107
|
with_nesting_attributes nil
|
106
108
|
with_solr_document false
|
107
109
|
end
|
108
|
-
sequence(:title) { |n| ["Title #{n}"] }
|
110
|
+
sequence(:title) { |n| ["Collection Title #{n}"] }
|
109
111
|
|
110
112
|
after(:build) do |collection, evaluator|
|
111
113
|
collection.apply_depositor_metadata(evaluator.user.user_key)
|
@@ -162,7 +164,7 @@ FactoryBot.define do
|
|
162
164
|
user { create(:user) }
|
163
165
|
end
|
164
166
|
|
165
|
-
sequence(:title) { |n| ["Title #{n}"] }
|
167
|
+
sequence(:title) { |n| ["User Collection Title #{n}"] }
|
166
168
|
|
167
169
|
after(:build) do |collection, evaluator|
|
168
170
|
collection.apply_depositor_metadata(evaluator.user.user_key)
|
@@ -181,7 +183,7 @@ FactoryBot.define do
|
|
181
183
|
do_save false
|
182
184
|
end
|
183
185
|
|
184
|
-
sequence(:title) { |n| ["Title #{n}"] }
|
186
|
+
sequence(:title) { |n| ["Typeless Collection Title #{n}"] }
|
185
187
|
|
186
188
|
after(:build) do |collection, evaluator|
|
187
189
|
collection.apply_depositor_metadata(evaluator.user.user_key)
|
@@ -25,7 +25,7 @@ FactoryBot.define do
|
|
25
25
|
create_access false
|
26
26
|
with_nesting_attributes nil
|
27
27
|
end
|
28
|
-
sequence(:title) { |n| ["Title #{n}"] }
|
28
|
+
sequence(:title) { |n| ["Collection Title #{n}"] }
|
29
29
|
|
30
30
|
after(:build) do |collection, evaluator|
|
31
31
|
collection.apply_depositor_metadata(evaluator.user.user_key)
|
@@ -88,7 +88,7 @@ FactoryBot.define do
|
|
88
88
|
user { create(:user) }
|
89
89
|
end
|
90
90
|
|
91
|
-
sequence(:title) { |n| ["Title #{n}"] }
|
91
|
+
sequence(:title) { |n| ["User Collection Title #{n}"] }
|
92
92
|
|
93
93
|
after(:build) do |collection, evaluator|
|
94
94
|
collection.apply_depositor_metadata(evaluator.user.user_key)
|
@@ -108,7 +108,7 @@ FactoryBot.define do
|
|
108
108
|
do_save false
|
109
109
|
end
|
110
110
|
|
111
|
-
sequence(:title) { |n| ["Title #{n}"] }
|
111
|
+
sequence(:title) { |n| ["Typeless Collection Title #{n}"] }
|
112
112
|
|
113
113
|
after(:build) do |collection, evaluator|
|
114
114
|
collection.apply_depositor_metadata(evaluator.user.user_key)
|