sufia 4.0.0.beta2 → 4.0.0.beta3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -0
- data/README.md +6 -4
- data/SUFIA_VERSION +1 -1
- data/app/assets/images/folder.png +0 -0
- data/app/assets/javascripts/sufia.js +5 -0
- data/app/assets/javascripts/sufia/app.js +1 -0
- data/app/assets/javascripts/sufia/batch_select_all.js +1 -2
- data/app/assets/javascripts/sufia/dashboard_actions.js +13 -0
- data/app/assets/javascripts/sufia/editor.js +1 -1
- data/app/assets/javascripts/sufia/ga_events.js +10 -0
- data/app/assets/javascripts/sufia/search.js +67 -0
- data/app/assets/stylesheets/dashboard.css.scss +15 -1
- data/app/assets/stylesheets/sufia.css.scss +12 -0
- data/app/controllers/authorities_controller.rb +4 -4
- data/app/controllers/batch_controller.rb +4 -4
- data/app/controllers/collections_controller.rb +44 -0
- data/{lib → app/controllers/concerns}/sufia/batch_edits_controller_behavior.rb +1 -1
- data/app/controllers/concerns/sufia/catalog.rb +9 -45
- data/{lib → app/controllers/concerns}/sufia/controller.rb +11 -21
- data/app/controllers/concerns/sufia/dashboard_controller_behavior.rb +34 -6
- data/{lib → app/controllers/concerns}/sufia/downloads_controller_behavior.rb +0 -0
- data/app/controllers/concerns/sufia/files_controller/browse_everything.rb +35 -0
- data/{lib → app/controllers/concerns}/sufia/files_controller/local_ingest_behavior.rb +19 -7
- data/{lib → app/controllers/concerns}/sufia/files_controller/upload_complete_behavior.rb +1 -1
- data/app/controllers/concerns/sufia/files_controller_behavior.rb +219 -0
- data/app/controllers/concerns/sufia/homepage_controller.rb +41 -0
- data/app/controllers/concerns/sufia/users_controller_behavior.rb +3 -2
- data/app/controllers/dashboard/collections_controller.rb +19 -0
- data/app/controllers/dashboard/files_controller.rb +13 -0
- data/app/controllers/dashboard/highlights_controller.rb +20 -0
- data/app/controllers/dashboard/lists_controller.rb +13 -0
- data/app/controllers/dashboard/shares_controller.rb +19 -0
- data/app/controllers/directory_controller.rb +8 -8
- data/app/controllers/featured_work_lists_controller.rb +1 -1
- data/app/controllers/homepage_controller.rb +4 -0
- data/app/controllers/single_use_links_controller.rb +6 -6
- data/app/controllers/single_use_links_viewer_controller.rb +6 -6
- data/app/controllers/static_controller.rb +4 -3
- data/app/helpers/batch_edits_helper.rb +3 -6
- data/app/helpers/content_block_helper.rb +7 -2
- data/app/helpers/generic_file_helper.rb +33 -39
- data/app/helpers/records_helper.rb +4 -0
- data/app/helpers/sufia/blacklight_override.rb +11 -0
- data/app/helpers/sufia/records_helper_behavior.rb +38 -0
- data/app/helpers/sufia/sufia_helper_behavior.rb +109 -0
- data/{sufia-models/lib/sufia/models → app/models/concerns/sufia}/solr_document_behavior.rb +6 -1
- data/app/models/contact_form.rb +13 -13
- data/app/uploaders/tinymce_asset_uploader.rb +2 -2
- data/app/views/_controls.html.erb +1 -1
- data/app/views/_flash_msg.html.erb +2 -8
- data/app/views/_ga.html.erb +4 -0
- data/app/views/_user_util_links.html.erb +7 -7
- data/app/views/advanced/_advanced_search_facets.html.erb +1 -1
- data/app/views/advanced/_advanced_search_fields.html.erb +2 -2
- data/app/views/advanced/_advanced_search_form.html.erb +12 -12
- data/app/views/batch/_metadata.html.erb +12 -12
- data/app/views/batch/_more_metadata.html.erb +1 -2
- data/app/views/batch/edit.html.erb +5 -5
- data/app/views/batch_edits/_check_all.html.erb +1 -1
- data/app/views/batch_edits/_delete_selected.html.erb +2 -3
- data/app/views/batch_edits/edit.html.erb +20 -21
- data/app/views/catalog/_bookmark_control.html.erb +7 -8
- data/app/views/catalog/_constraints_element.html.erb +2 -2
- data/app/views/catalog/_delete_partials/_default.html.erb +9 -12
- data/app/views/catalog/_document.html.erb +5 -5
- data/app/views/catalog/_document_list.html.erb +2 -2
- data/app/views/catalog/_edit_partials/_default.html.erb +6 -9
- data/app/views/catalog/_edit_partials/_default_details.html.erb +2 -4
- data/app/views/catalog/_email_form.html.erb +1 -1
- data/app/views/catalog/_facet_limit.html.erb +6 -7
- data/app/views/catalog/_facet_selected.html.erb +3 -3
- data/app/views/catalog/_folder_control.html.erb +7 -8
- data/app/views/catalog/_index_default.html.erb +2 -2
- data/app/views/catalog/_index_header_default.html.erb +20 -0
- data/app/views/catalog/_index_partials/_default_group.html.erb +1 -1
- data/app/views/catalog/_index_partials/_list_files.html.erb +5 -2
- data/app/views/catalog/_refworks_form.html.erb +2 -2
- data/app/views/catalog/_results_pagination.html.erb +1 -1
- data/app/views/catalog/_search_form.html.erb +24 -9
- data/app/views/catalog/_show_default.html.erb +2 -2
- data/app/views/catalog/_show_partials/_default.html.erb +4 -5
- data/app/views/catalog/_show_partials/_default_details.html.erb +5 -5
- data/app/views/catalog/_show_partials/_facets.html.erb +7 -7
- data/app/views/catalog/_show_tools.html.erb +6 -6
- data/app/views/catalog/_sms_form.html.erb +1 -1
- data/app/views/catalog/_sort_and_per_page.html.erb +8 -14
- data/app/views/catalog/citation.html.erb +1 -1
- data/app/views/catalog/email.erb +1 -1
- data/app/views/catalog/index.html.erb +16 -27
- data/app/views/catalog/recent.js.erb +1 -1
- data/app/views/catalog/show.html.erb +2 -2
- data/app/views/catalog/sms.erb +1 -1
- data/app/views/collections/_action_menu.html.erb +24 -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/_dashboard_document_list.html.erb +6 -0
- data/app/views/collections/_document_list.html.erb +10 -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 +24 -0
- data/app/views/collections/_form_for_select_collection.html.erb +34 -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 +7 -0
- data/app/views/collections/_show_descriptions.html.erb +8 -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 +30 -0
- data/app/views/collections/show.html.erb +32 -0
- data/app/views/contact_form/new.html.erb +13 -13
- data/app/views/dashboard/_action_menu.html.erb +29 -0
- data/app/views/dashboard/_collection_action_menu.html.erb +15 -0
- data/app/views/dashboard/_document_list.html.erb +1 -1
- data/app/views/dashboard/_facet_limit.html.erb +2 -2
- data/app/views/dashboard/_facet_pagination.html.erb +12 -12
- data/app/views/dashboard/_facet_selected.html.erb +2 -2
- data/app/views/dashboard/_facets.html.erb +2 -0
- data/app/views/dashboard/_index_partials/_default_group.html.erb +9 -2
- data/app/views/dashboard/_index_partials/_list_collections.html.erb +45 -0
- data/app/views/dashboard/_index_partials/_list_files.html.erb +5 -25
- data/app/views/dashboard/_results_pagination.html.erb +1 -1
- data/app/views/dashboard/_search_form.html.erb +2 -2
- data/app/views/dashboard/_show_partials/_default.html.erb +3 -3
- data/app/views/dashboard/_show_partials/_default_details.html.erb +5 -5
- data/app/views/dashboard/_show_partials/_facets.html.erb +6 -6
- data/app/views/dashboard/_sort_and_per_page.html.erb +24 -8
- data/app/views/dashboard/facet.html.erb +3 -3
- data/app/views/dashboard/index.html.erb +18 -41
- data/app/views/dashboard/lists/index.html.erb +59 -0
- data/app/views/generic_files/_breadcrumbs.html.erb +4 -4
- data/app/views/generic_files/_descriptions.html.erb +4 -4
- data/app/views/generic_files/_field_form.html.erb +5 -5
- data/app/views/generic_files/_flot_stats.js.erb +120 -0
- data/app/views/generic_files/_media_display.html.erb +14 -4
- data/app/views/generic_files/_permission.html.erb +3 -3
- data/app/views/generic_files/_permission_form.html.erb +20 -21
- data/app/views/generic_files/_show_actions.html.erb +13 -10
- data/app/views/generic_files/_show_details.html.erb +16 -9
- data/app/views/generic_files/_versioning.html.erb +3 -3
- data/app/views/generic_files/edit.html.erb +7 -7
- data/app/views/generic_files/edit_fields/_default.html.erb +3 -4
- data/app/views/generic_files/edit_fields/_description.html.erb +3 -4
- data/app/views/generic_files/edit_fields/_resource_type.html.erb +1 -3
- data/app/views/generic_files/edit_fields/_rights.html.erb +3 -5
- data/app/views/generic_files/edit_fields/_suffix.html.erb +1 -1
- data/app/views/generic_files/show.html.erb +3 -3
- data/app/views/generic_files/stats.html.erb +8 -124
- data/app/views/generic_files/upload/_alerts.html.erb +2 -4
- data/app/views/generic_files/upload/_form.html.erb +1 -1
- data/app/views/generic_files/upload/_local_file_import_chooser.html.erb +1 -1
- data/app/views/generic_files/upload/_tos_checkbox.html.erb +1 -1
- data/app/views/homepage/_featured.html.erb +3 -1
- data/app/views/{catalog → homepage}/_featured_researcher.html.erb +0 -0
- data/app/views/{catalog → homepage}/_home.html.erb +1 -0
- data/app/views/{catalog → homepage}/_home_content.html.erb +4 -4
- data/app/views/homepage/_home_header.html.erb +12 -0
- data/app/views/homepage/_marketing.html.erb +4 -0
- data/app/views/{catalog → homepage}/_recent_document.html.erb +10 -5
- data/app/views/homepage/_recents.html.erb +15 -0
- data/app/views/homepage/_sortable_featured.html.erb +3 -1
- data/app/views/{catalog → homepage}/_tagcloud.html.erb +0 -0
- data/app/views/homepage/index.html.erb +1 -0
- data/app/views/kaminari/blacklight/_first_page.html.erb +1 -1
- data/app/views/kaminari/blacklight/_last_page.html.erb +1 -1
- data/app/views/kaminari/blacklight/_next_page.html.erb +1 -1
- data/app/views/kaminari/blacklight/_page.html.erb +1 -1
- data/app/views/kaminari/blacklight/_prev_page.html.erb +1 -1
- data/app/views/layouts/_head_tag_content.html.erb +1 -1
- data/app/views/layouts/error.html.erb +2 -2
- data/app/views/layouts/homepage.html.erb +4 -4
- data/app/views/layouts/sufia-dashboard.html.erb +7 -7
- data/app/views/layouts/sufia-one-column.html.erb +4 -4
- data/app/views/layouts/sufia-two-column.html.erb +7 -7
- data/app/views/mailbox/index.html.erb +2 -2
- data/app/views/pages/show.html.erb +1 -0
- data/app/views/records/_edit_field.html.erb +18 -0
- data/app/views/records/edit_fields/_description.html.erb +10 -0
- data/app/views/records/edit_fields/_resource_type.html.erb +7 -0
- data/app/views/records/edit_fields/_rights.html.erb +6 -0
- data/app/views/records/edit_fields/_suffix.html.erb +9 -0
- data/app/views/records/edit_fields/_type.html.erb +13 -0
- data/app/views/single_use_links/new_download.html.erb +1 -1
- data/app/views/users/_activity.html.erb +1 -1
- data/app/views/users/_contributions.html.erb +3 -1
- data/app/views/users/_left_sidebar.html.erb +1 -1
- data/app/views/users/_notify_link.html.erb +2 -2
- data/app/views/users/_profile.html.erb +2 -2
- data/app/views/users/_search_form.html.erb +3 -3
- data/app/views/users/edit.html.erb +15 -15
- data/app/views/users/index.html.erb +3 -3
- data/app/views/users/notifications_number.js.erb +1 -1
- data/config/locales/sufia.en.yml +13 -2
- data/config/routes.rb +56 -20
- data/db/seeds.rb +2 -2
- data/lib/generators/sufia/sufia_generator.rb +14 -4
- data/lib/generators/sufia/templates/catalog_controller.rb +98 -97
- data/lib/generators/sufia/templates/sufia_helper.rb +5 -0
- data/lib/sufia.rb +4 -0
- data/spec/{models/generic_file/actions_spec.rb → actors/generic_file/actor_spec.rb} +2 -2
- data/spec/controllers/authorities_controller_spec.rb +7 -7
- data/spec/controllers/batch_controller_spec.rb +22 -23
- data/spec/controllers/batch_edits_controller_spec.rb +4 -4
- data/spec/controllers/catalog_controller_spec.rb +27 -37
- data/spec/controllers/collections_controller_spec.rb +179 -0
- data/spec/controllers/dashboard/collections_controller_spec.rb +71 -0
- data/spec/controllers/dashboard/files_controller_spec.rb +71 -0
- data/spec/controllers/dashboard/highlights_controller_spec.rb +66 -0
- data/spec/controllers/dashboard/shares_controller_spec.rb +78 -0
- data/spec/controllers/dashboard_controller_spec.rb +0 -47
- data/spec/controllers/downloads_controller_spec.rb +10 -11
- data/spec/controllers/generic_files_controller_spec.rb +147 -118
- data/spec/controllers/homepage_controller_spec.rb +57 -0
- data/spec/controllers/mailbox_controller_spec.rb +3 -3
- data/spec/controllers/single_use_links_viewer_controller_spec.rb +3 -3
- data/spec/factories/generic_files.rb +4 -0
- data/spec/factories/users.rb +0 -1
- data/spec/features/browse_dashboard_files_spec.rb +5 -1
- data/spec/features/collection_spec.rb +232 -0
- data/spec/features/display_dashboard_spec.rb +1 -0
- data/spec/features/notifications_spec.rb +1 -1
- data/spec/features/search_spec.rb +22 -0
- data/spec/features/single_use_links_spec.rb +2 -2
- data/spec/features/users_spec.rb +1 -1
- data/spec/fixtures/charter.docx +0 -0
- data/spec/helpers/records_helper_spec.rb +61 -0
- data/spec/helpers/sufia_helper_spec.rb +40 -2
- data/spec/{models → jobs}/active_fedora_pid_based_job_spec.rb +0 -0
- data/spec/{models → jobs}/audit_job_spec.rb +0 -2
- data/spec/{models → jobs}/batch_update_job_spec.rb +2 -2
- data/spec/jobs/characterize_job_spec.rb +25 -0
- data/spec/jobs/create_derivatives_job_spec.rb +186 -0
- data/spec/{models → jobs}/event_jobs_spec.rb +0 -1
- data/spec/jobs/import_url_job_spec.rb +36 -14
- data/spec/jobs/ingest_local_file_job_spec.rb +2 -2
- data/spec/lib/sufia/analytics_spec.rb +29 -0
- data/spec/lib/sufia/upload_complete_behavior_spec.rb +1 -1
- data/spec/models/batch_spec.rb +3 -9
- data/spec/models/checksum_audit_log_spec.rb +5 -6
- data/spec/models/collection_spec.rb +24 -0
- data/spec/models/download_spec.rb +21 -0
- data/spec/models/featured_work_list_spec.rb +0 -1
- data/spec/models/file_content_datastream_spec.rb +8 -14
- data/spec/models/file_usage_spec.rb +91 -0
- data/spec/models/fits_datastream_spec.rb +1 -1
- data/spec/models/generic_file/web_form_spec.rb +2 -2
- data/spec/models/generic_file_rdf_datastream_spec.rb +12 -0
- data/spec/models/generic_file_spec.rb +150 -168
- data/spec/models/local_authority_spec.rb +9 -9
- data/spec/models/{pageview.rb → pageview_spec.rb} +0 -0
- data/spec/models/single_use_link_spec.rb +32 -35
- data/spec/routing/route_spec.rb +19 -3
- data/spec/spec_helper.rb +28 -6
- data/spec/support/features/session_helpers.rb +5 -6
- data/spec/support/lib/generators/test_app_generator.rb +6 -0
- data/spec/views/generic_file/edit.html.erb_spec.rb +4 -4
- data/spec/views/generic_file/show.html.erb_spec.rb +45 -17
- data/spec/views/generic_file/stats.html.erb_spec.rb +26 -7
- data/sufia-models/app/actors/sufia/generic_file/actor.rb +98 -0
- data/sufia-models/app/models/batch.rb +3 -3
- data/sufia-models/app/models/checksum_audit_log.rb +3 -3
- data/sufia-models/app/models/collection.rb +41 -0
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file.rb +33 -43
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file/accessible_attributes.rb +3 -3
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file/audit.rb +12 -18
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file/characterization.rb +1 -8
- data/sufia-models/app/models/concerns/sufia/generic_file/derivatives.rb +26 -0
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file/export.rb +13 -13
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file/featured.rb +0 -0
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file/metadata.rb +0 -0
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file/mime_types.rb +15 -1
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file/permissions.rb +5 -1
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file/reload_on_save.rb +0 -0
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file/trophies.rb +0 -0
- data/sufia-models/app/models/concerns/sufia/generic_file/versions.rb +16 -0
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file/virus_check.rb +2 -3
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file/web_form.rb +9 -2
- data/sufia-models/app/models/concerns/sufia/properties_datastream_behavior.rb +3 -4
- data/sufia-models/app/models/concerns/sufia/user.rb +2 -2
- data/sufia-models/app/models/datastreams/fits_datastream.rb +137 -136
- data/sufia-models/app/models/datastreams/generic_file_rdf_datastream.rb +6 -0
- data/sufia-models/app/models/datastreams/paranoid_rights_datastream.rb +3 -3
- data/sufia-models/app/models/file_usage.rb +53 -0
- data/sufia-models/app/models/follow.rb +2 -4
- data/sufia-models/app/models/geo_names_resource.rb +5 -7
- data/sufia-models/app/models/local_authority.rb +14 -14
- data/sufia-models/app/models/single_use_link.rb +1 -1
- data/sufia-models/app/models/sufia/download.rb +9 -0
- data/sufia-models/app/models/trophy.rb +1 -1
- data/sufia-models/app/services/sufia/{usage_statistics.rb → analytics.rb} +1 -24
- data/sufia-models/app/services/sufia/id_service.rb +2 -2
- data/sufia-models/lib/generators/sufia/models/install_generator.rb +5 -2
- data/sufia-models/lib/generators/sufia/models/templates/config/setup_mail.rb +1 -1
- data/sufia-models/lib/generators/sufia/models/templates/config/sufia.rb +5 -3
- data/sufia-models/lib/generators/sufia/models/templates/migrations/acts_as_follower_migration.rb +6 -6
- data/sufia-models/lib/generators/sufia/models/templates/migrations/create_checksum_audit_logs.rb +2 -3
- data/sufia-models/lib/generators/sufia/models/templates/migrations/create_local_authorities.rb +20 -20
- data/sufia-models/lib/sufia/ability.rb +1 -1
- data/sufia-models/lib/sufia/models/engine.rb +3 -9
- data/sufia-models/lib/sufia/models/file_content/versions.rb +3 -3
- data/sufia-models/lib/sufia/models/jobs/active_fedora_pid_based_job.rb +6 -2
- data/sufia-models/lib/sufia/models/jobs/batch_update_job.rb +6 -10
- data/sufia-models/lib/sufia/models/jobs/characterize_job.rb +1 -13
- data/sufia-models/lib/sufia/models/jobs/create_derivatives_job.rb +14 -0
- data/sufia-models/lib/sufia/models/jobs/import_url_job.rb +27 -23
- data/sufia-models/lib/tasks/sufia-models_tasks.rake +1 -1
- data/sufia-models/sufia-models.gemspec +1 -1
- data/sufia.gemspec +7 -2
- data/tasks/jetty.rake +4 -4
- data/tasks/release.rake +8 -8
- data/tasks/sufia-db.rake +4 -4
- data/tasks/sufia-dev.rake +11 -5
- metadata +226 -95
- data/app/helpers/sufia_helper.rb +0 -93
- data/app/views/catalog/_bookmark_form.html.erb +0 -8
- data/app/views/catalog/_home_header.html.erb +0 -15
- data/app/views/catalog/_recents.html.erb +0 -17
- data/app/views/dashboard/_index_partials/_thumbnail_display.html.erb +0 -9
- data/app/views/layouts/_homepage_sidebar2.html.erb +0 -14
- data/lib/sufia/files_controller_behavior.rb +0 -253
- data/spec/helpers/generic_file_helper_spec.rb +0 -28
- data/spec/lib/sufia/usage_statistics_spec.rb +0 -75
- data/spec/models/characterize_job_spec.rb +0 -93
- data/spec/models/transcode_audio_job_spec.rb +0 -85
- data/spec/models/transcode_video_job_spec.rb +0 -31
- data/spec/views/dashboard/index_partials/_thumbnail_display.html.erb_spec.rb +0 -22
- data/sufia-models/lib/sufia/models/generic_file/actions.rb +0 -50
- data/sufia-models/lib/sufia/models/generic_file/derivatives.rb +0 -31
- data/sufia-models/lib/sufia/models/generic_file/thumbnail.rb +0 -37
- data/sufia-models/lib/sufia/models/generic_file/versions.rb +0 -16
- data/sufia-models/lib/sufia/models/jobs/transcode_audio_job.rb +0 -15
- data/sufia-models/lib/sufia/models/jobs/transcode_video_job.rb +0 -15
data/lib/sufia.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
require "sufia/version"
|
2
2
|
require 'blacklight'
|
3
3
|
require 'blacklight_advanced_search'
|
4
|
+
require 'blacklight/gallery'
|
4
5
|
require 'hydra/head'
|
5
6
|
require 'hydra-batch-edit'
|
7
|
+
require 'hydra-editor'
|
6
8
|
require 'browse-everything'
|
7
9
|
require 'sufia/models'
|
8
10
|
|
@@ -25,6 +27,7 @@ module Sufia
|
|
25
27
|
)
|
26
28
|
|
27
29
|
config.assets.paths << config.root.join('vendor', 'assets', 'fonts')
|
30
|
+
config.assets.precompile << %r(vjs\.(?:eot|ttf|woff)$)
|
28
31
|
end
|
29
32
|
|
30
33
|
autoload :Controller
|
@@ -33,4 +36,5 @@ module Sufia
|
|
33
36
|
autoload :FilesControllerBehavior
|
34
37
|
autoload :BatchEditsControllerBehavior
|
35
38
|
autoload :DownloadsControllerBehavior
|
39
|
+
autoload :HomepageController
|
36
40
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe GenericFile do
|
3
|
+
describe Sufia::GenericFile::Actor do
|
4
4
|
describe "#virus_check" do
|
5
5
|
it "should return the results of running ClamAV scanfile method" do
|
6
6
|
ClamAV.instance.should_receive(:scanfile).and_return(1)
|
7
|
-
expect { Sufia::GenericFile::
|
7
|
+
expect { Sufia::GenericFile::Actor.virus_check(File.new(fixture_path + '/world.png')) }.to raise_error(Sufia::VirusFoundError)
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
@@ -3,14 +3,14 @@ require 'spec_helper'
|
|
3
3
|
describe AuthoritiesController do
|
4
4
|
describe "#query" do
|
5
5
|
it "should return an array of hashes" do
|
6
|
-
mock_hits = [{:
|
7
|
-
{:
|
8
|
-
{:
|
9
|
-
{:
|
10
|
-
{:
|
11
|
-
{:
|
6
|
+
mock_hits = [{label: "English", uri: "http://example.org/eng"},
|
7
|
+
{label: "Environment", uri: "http://example.org/env"},
|
8
|
+
{label: "Edge", uri: "http://example.org/edge"},
|
9
|
+
{label: "Edgar", uri: "http://example.org/edga"},
|
10
|
+
{label: "Eddie", uri: "http://example.org/edd"},
|
11
|
+
{label: "Economics", uri: "http://example.org/eco"}]
|
12
12
|
LocalAuthority.should_receive(:entries_by_term).and_return(mock_hits)
|
13
|
-
xhr :get, :query, :
|
13
|
+
xhr :get, :query, model: "generic_files", term: "subject", q: "E"
|
14
14
|
response.should be_success
|
15
15
|
JSON.parse(response.body).count.should == 6
|
16
16
|
JSON.parse(response.body)[0]["label"].should == "English"
|
@@ -15,10 +15,10 @@ describe BatchController do
|
|
15
15
|
before do
|
16
16
|
@batch = Batch.new
|
17
17
|
@batch.save
|
18
|
-
@file = GenericFile.new(:batch
|
18
|
+
@file = GenericFile.new(batch: @batch)
|
19
19
|
@file.apply_depositor_metadata(@user)
|
20
20
|
@file.save
|
21
|
-
@file2 = GenericFile.new(:batch
|
21
|
+
@file2 = GenericFile.new(batch: @batch)
|
22
22
|
@file2.apply_depositor_metadata('otherUser')
|
23
23
|
@file2.save
|
24
24
|
end
|
@@ -37,60 +37,60 @@ describe BatchController do
|
|
37
37
|
s1 = double('one')
|
38
38
|
BatchUpdateJob.should_receive(:new).with(@user.user_key, params).and_return(s1)
|
39
39
|
Sufia.queue.should_receive(:push).with(s1).once
|
40
|
-
post :update, :
|
40
|
+
post :update, id: @batch.pid, "generic_file" => {"read_groups_string" => "", "read_users_string" => "archivist1, archivist2", "tag" => [""]}
|
41
41
|
end
|
42
42
|
it "should show flash messages" do
|
43
|
-
post :update, :
|
44
|
-
response.should redirect_to @routes.url_helpers.
|
43
|
+
post :update, id: @batch.pid, "generic_file" => {"read_groups_string" => "","read_users_string" => "archivist1, archivist2", "tag" => [""]}
|
44
|
+
response.should redirect_to @routes.url_helpers.dashboard_files_path
|
45
45
|
flash[:notice].should_not be_nil
|
46
46
|
flash[:notice].should_not be_empty
|
47
47
|
flash[:notice].should include("Your files are being processed")
|
48
48
|
end
|
49
|
-
|
49
|
+
|
50
50
|
describe "when user has edit permissions on a file" do
|
51
51
|
it "should set the groups" do
|
52
|
-
post :update, :
|
52
|
+
post :update, id: @batch.pid, "generic_file"=>{"permissions"=>{"group"=>{"public"=>"1", "registered"=>"2"}}}
|
53
53
|
@file.reload.read_groups.should == []
|
54
54
|
@file.reload.edit_groups.should == []
|
55
|
-
response.should redirect_to @routes.url_helpers.
|
55
|
+
response.should redirect_to @routes.url_helpers.dashboard_files_path
|
56
56
|
end
|
57
57
|
|
58
58
|
it "should set the users with read access" do
|
59
|
-
post :update, :
|
59
|
+
post :update, id: @batch.pid, "generic_file"=>{"read_groups_string"=>"", "read_users_string"=>"archivist1, archivist2", "tag"=>[""]}
|
60
60
|
file = GenericFile.find(@file.pid)
|
61
61
|
file.read_users.should == ['archivist1', 'archivist2']
|
62
62
|
|
63
|
-
response.should redirect_to @routes.url_helpers.
|
63
|
+
response.should redirect_to @routes.url_helpers.dashboard_files_path
|
64
64
|
end
|
65
65
|
it "should set the groups with read access" do
|
66
|
-
post :update, :
|
66
|
+
post :update, id: @batch.pid, "generic_file"=>{"read_groups_string"=>"group1, group2", "read_users_string"=>"", "tag"=>[""]}
|
67
67
|
file = GenericFile.find(@file.pid)
|
68
68
|
file.read_groups.should == ['group1', 'group2']
|
69
69
|
end
|
70
70
|
it "should set public read access" do
|
71
|
-
post :update, :
|
71
|
+
post :update, id: @batch.pid, "visibility"=>"open", "generic_file"=>{"read_groups_string"=>"", "read_users_string"=>"", "tag"=>[""]}
|
72
72
|
file = GenericFile.find(@file.pid)
|
73
73
|
file.read_groups.should == ['public']
|
74
74
|
end
|
75
75
|
it "should set public read access and groups at the same time" do
|
76
|
-
post :update, :
|
76
|
+
post :update, id: @batch.pid, "visibility"=>"open", "generic_file"=>{"read_groups_string"=>"group1, group2", "read_users_string"=>"", "tag"=>[""]}
|
77
77
|
file = GenericFile.find(@file.pid)
|
78
78
|
file.read_groups.should == ['group1', 'group2', 'public']
|
79
79
|
end
|
80
80
|
it "should set public discover access and groups at the same time" do
|
81
|
-
post :update, :
|
81
|
+
post :update, id: @batch.pid, "permission"=>{"group"=>{"public"=>"none"}}, "generic_file"=>{"read_groups_string"=>"group1, group2", "read_users_string"=>"", "tag"=>[""]}
|
82
82
|
file = GenericFile.find(@file.pid)
|
83
83
|
file.read_groups.should == ['group1', 'group2']
|
84
84
|
file.discover_groups.should == []
|
85
85
|
end
|
86
86
|
it "should set metadata like title" do
|
87
|
-
post :update, :
|
87
|
+
post :update, id: @batch.pid, "generic_file"=>{"tag"=>["footag", "bartag"]}, "title"=>{@file.pid=>"New Title"}
|
88
88
|
file = GenericFile.find(@file.pid)
|
89
89
|
file.title.should == ["New Title"]
|
90
90
|
file.tag.should == ["footag", "bartag"]
|
91
91
|
end
|
92
92
|
it "should not set any tags" do
|
93
|
-
post :update, :
|
93
|
+
post :update, id: @batch.pid, "generic_file"=>{"read_groups_string"=>"", "read_users_string"=>"archivist1", "tag"=>[""]}
|
94
94
|
file = GenericFile.find(@file.pid)
|
95
95
|
file.tag.should be_empty
|
96
96
|
end
|
@@ -101,7 +101,7 @@ describe BatchController do
|
|
101
101
|
file.title = "Original Title"
|
102
102
|
file.read_groups.should == []
|
103
103
|
file.save
|
104
|
-
post :update, :
|
104
|
+
post :update, id: @batch.pid, "generic_file"=>{"read_groups_string"=>"group1, group2", "read_users_string"=>"", "tag"=>[""]}, "title"=>{@file2.pid=>"Title Wont Change"}
|
105
105
|
file = GenericFile.find(@file2.pid)
|
106
106
|
file.title.should == ["Original Title"]
|
107
107
|
file.read_groups.should == []
|
@@ -111,13 +111,12 @@ describe BatchController do
|
|
111
111
|
describe "#edit" do
|
112
112
|
before do
|
113
113
|
User.any_instance.stub(:display_name).and_return("Jill Z. User")
|
114
|
-
GenericFile.any_instance.stub(:characterize_if_changed).and_yield
|
115
114
|
@b1 = Batch.new
|
116
115
|
@b1.save
|
117
|
-
@file = GenericFile.new(:
|
116
|
+
@file = GenericFile.new(batch: @b1, label: 'f1')
|
118
117
|
@file.apply_depositor_metadata(@user)
|
119
118
|
@file.save
|
120
|
-
@file2 = GenericFile.new(:
|
119
|
+
@file2 = GenericFile.new(batch: @b1, label: 'f2')
|
121
120
|
@file2.apply_depositor_metadata(@user)
|
122
121
|
@file2.save
|
123
122
|
end
|
@@ -127,9 +126,9 @@ describe BatchController do
|
|
127
126
|
@file2.delete
|
128
127
|
end
|
129
128
|
it "should default creator" do
|
130
|
-
|
131
|
-
|
132
|
-
|
129
|
+
get :edit, id: @b1.id
|
130
|
+
assigns[:generic_file].creator[0].should == @user.display_name
|
131
|
+
assigns[:generic_file].title[0].should == 'f1'
|
133
132
|
end
|
134
133
|
end
|
135
134
|
end
|
@@ -14,9 +14,9 @@ describe BatchEditsController do
|
|
14
14
|
|
15
15
|
describe "edit" do
|
16
16
|
before do
|
17
|
-
@one = GenericFile.new(:
|
17
|
+
@one = GenericFile.new(creator: "Fred", language: 'en')#, resource_type: 'foo')
|
18
18
|
@one.apply_depositor_metadata('mjg36')
|
19
|
-
@two = GenericFile.new(:
|
19
|
+
@two = GenericFile.new(creator: "Wilma", publisher: 'Rand McNally', language: 'en', resource_type: 'bar')
|
20
20
|
@two.apply_depositor_metadata('mjg36')
|
21
21
|
@one.save!
|
22
22
|
@two.save!
|
@@ -37,9 +37,9 @@ describe BatchEditsController do
|
|
37
37
|
|
38
38
|
describe "update" do
|
39
39
|
before do
|
40
|
-
@one = GenericFile.new(:
|
40
|
+
@one = GenericFile.new(creator: "Fred", language: 'en')
|
41
41
|
@one.apply_depositor_metadata('mjg36')
|
42
|
-
@two = GenericFile.new(:
|
42
|
+
@two = GenericFile.new(creator: "Wilma", publisher: 'Rand McNally', language: 'en')
|
43
43
|
@two.apply_depositor_metadata('mjg36')
|
44
44
|
@one.save!
|
45
45
|
@two.save!
|
@@ -1,21 +1,30 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe CatalogController do
|
4
|
-
|
4
|
+
routes { Rails.application.class.routes }
|
5
|
+
|
6
|
+
let(:user) { @user }
|
7
|
+
|
5
8
|
before do
|
6
|
-
GenericFile.any_instance.stub(:characterize_if_changed).and_yield
|
7
9
|
sign_in user
|
8
10
|
end
|
9
11
|
|
10
12
|
describe "#index" do
|
11
13
|
before (:all) do
|
14
|
+
@user = FactoryGirl.find_or_create(:jill)
|
12
15
|
GenericFile.delete_all
|
13
16
|
@gf1 = GenericFile.new(title:'Test Document PDF', filename:'test.pdf', tag:'rocks', read_groups:['public'])
|
14
17
|
@gf1.apply_depositor_metadata('mjg36')
|
15
18
|
@gf1.save
|
19
|
+
|
16
20
|
@gf2 = GenericFile.new(title:'Test 2 Document', filename:'test2.doc', tag:'clouds', contributor:'Contrib1', read_groups:['public'])
|
17
21
|
@gf2.apply_depositor_metadata('mjg36')
|
18
22
|
@gf2.save
|
23
|
+
|
24
|
+
@editable_file = GenericFile.new.tap do |gf|
|
25
|
+
gf.apply_depositor_metadata(@user.user_key)
|
26
|
+
gf.save!
|
27
|
+
end
|
19
28
|
end
|
20
29
|
|
21
30
|
after (:all) do
|
@@ -24,24 +33,29 @@ describe CatalogController do
|
|
24
33
|
end
|
25
34
|
|
26
35
|
describe "term search" do
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
36
|
+
context "searching everything" do
|
37
|
+
it "should find records" do
|
38
|
+
get :index, q: "pdf", owner: 'all'
|
39
|
+
expect(response).to be_success
|
40
|
+
response.should render_template('catalog/index')
|
41
|
+
assigns(:document_list).map(&:id).should == [@gf1.id]
|
42
|
+
assigns(:document_list).count.should eql(1)
|
43
|
+
assigns(:document_list).first['desc_metadata__title_tesim'].should == ['Test Document PDF']
|
44
|
+
end
|
34
45
|
end
|
35
|
-
|
36
|
-
|
37
|
-
|
46
|
+
context "searching only documents editable to me" do
|
47
|
+
it "should only have records I can edit" do
|
48
|
+
get :index, q: "", owner: 'mine'
|
49
|
+
assigns(:document_list).map(&:id).should == [@editable_file.id]
|
50
|
+
expect(response).to be_success
|
51
|
+
end
|
38
52
|
end
|
39
53
|
end
|
40
54
|
|
41
55
|
describe "facet search" do
|
42
56
|
before do
|
43
57
|
# TODO: this is not how a facet query is done.
|
44
|
-
get :index, :
|
58
|
+
get :index, q: "{f=desc_metadata__contributor_tesim}Contrib1"
|
45
59
|
end
|
46
60
|
it "should find facet files" do
|
47
61
|
expect(response).to be_success
|
@@ -49,29 +63,5 @@ describe CatalogController do
|
|
49
63
|
assigns(:document_list).count.should eql(1)
|
50
64
|
end
|
51
65
|
end
|
52
|
-
|
53
|
-
describe "without search" do
|
54
|
-
it "should set featured researcher" do
|
55
|
-
get :index
|
56
|
-
expect(response).to be_success
|
57
|
-
assigns(:featured_researcher).tap do |researcher|
|
58
|
-
expect(researcher).to be_kind_of ContentBlock
|
59
|
-
expect(researcher.name).to eq 'featured_researcher'
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
context "with featured works" do
|
64
|
-
before do
|
65
|
-
FeaturedWork.create!(generic_file_id: @gf1.id)
|
66
|
-
end
|
67
|
-
|
68
|
-
it "should set featured works" do
|
69
|
-
get :index
|
70
|
-
expect(response).to be_success
|
71
|
-
expect(assigns(:featured_work_list)).to be_kind_of FeaturedWorkList
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
end
|
76
66
|
end
|
77
67
|
end
|
@@ -0,0 +1,179 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe CollectionsController do
|
4
|
+
before(:each) { @routes = Hydra::Collections::Engine.routes }
|
5
|
+
before do
|
6
|
+
controller.stub(:has_access?).and_return(true)
|
7
|
+
User.any_instance.stub(:groups).and_return([])
|
8
|
+
end
|
9
|
+
|
10
|
+
let(:user) { FactoryGirl.create(:user) }
|
11
|
+
|
12
|
+
after (:all) do
|
13
|
+
Collection.destroy_all
|
14
|
+
GenericFile.destroy_all
|
15
|
+
User.destroy_all
|
16
|
+
end
|
17
|
+
|
18
|
+
describe '#new' do
|
19
|
+
before do
|
20
|
+
sign_in user
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'should assign @collection' do
|
24
|
+
get :new
|
25
|
+
assigns(:collection).should be_kind_of(Collection)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe '#create' do
|
30
|
+
before do
|
31
|
+
sign_in user
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should create a Collection" do
|
35
|
+
controller.should_receive(:has_access?).and_return(true)
|
36
|
+
old_count = Collection.count
|
37
|
+
post :create, collection: {title: "My First Collection ", description: "The Description\r\n\r\nand more"}
|
38
|
+
Collection.count.should == old_count+1
|
39
|
+
end
|
40
|
+
it "should create a Collection with files I can access" do
|
41
|
+
@asset1 = GenericFile.new(title: "First of the Assets")
|
42
|
+
@asset1.apply_depositor_metadata(user.user_key)
|
43
|
+
@asset1.save
|
44
|
+
@asset2 = GenericFile.new(title: "Second of the Assets", depositor: user.user_key)
|
45
|
+
@asset2.apply_depositor_metadata(user.user_key)
|
46
|
+
@asset2.save
|
47
|
+
@asset3 = GenericFile.new(title: "Third of the Assets", depositor:'abc')
|
48
|
+
@asset3.apply_depositor_metadata('abc')
|
49
|
+
@asset3.save
|
50
|
+
controller.should_receive(:has_access?).and_return(true)
|
51
|
+
old_count = Collection.count
|
52
|
+
post :create, collection: {title: "My own Collection ", description: "The Description\r\n\r\nand more"}, batch_document_ids:[@asset1.id, @asset2.id, @asset3.id]
|
53
|
+
Collection.count.should == old_count+1
|
54
|
+
collection = assigns(:collection)
|
55
|
+
collection.members.should include (@asset1)
|
56
|
+
collection.members.should include (@asset2)
|
57
|
+
collection.members.should_not include (@asset3)
|
58
|
+
@asset1.destroy
|
59
|
+
@asset2.destroy
|
60
|
+
@asset3.destroy
|
61
|
+
end
|
62
|
+
|
63
|
+
it "should add docs to collection if batch ids provided and add the collection id to the documents int he colledction" do
|
64
|
+
@asset1 = GenericFile.new(title: "First of the Assets")
|
65
|
+
@asset1.apply_depositor_metadata(user.user_key)
|
66
|
+
@asset1.save
|
67
|
+
post :create, batch_document_ids: [@asset1.id], collection: {title: "My Secong Collection ", description: "The Description\r\n\r\nand more"}
|
68
|
+
assigns[:collection].members.should == [@asset1]
|
69
|
+
asset_results = ActiveFedora::SolrService.instance.conn.get "select", params:{fq:["id:\"#{@asset1.id}\""],fl:['id',Solrizer.solr_name(:collection)]}
|
70
|
+
asset_results["response"]["numFound"].should == 1
|
71
|
+
doc = asset_results["response"]["docs"].first
|
72
|
+
doc["id"].should == @asset1.id
|
73
|
+
afterupdate = GenericFile.find(@asset1.pid)
|
74
|
+
doc[Solrizer.solr_name(:collection)].should == afterupdate.to_solr[Solrizer.solr_name(:collection)]
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
78
|
+
|
79
|
+
describe "#update" do
|
80
|
+
before do
|
81
|
+
@collection = Collection.new(title: "Collection Title")
|
82
|
+
@collection.apply_depositor_metadata(user.user_key)
|
83
|
+
@collection.save
|
84
|
+
@asset1 = GenericFile.new(title: "First of the Assets")
|
85
|
+
@asset1.apply_depositor_metadata(user.user_key)
|
86
|
+
@asset1.save
|
87
|
+
@asset2 = GenericFile.new(title: "Second of the Assets", depositor: user.user_key)
|
88
|
+
@asset2.apply_depositor_metadata(user.user_key)
|
89
|
+
@asset2.save
|
90
|
+
@asset3 = GenericFile.new(title: "Third of the Assets", depositor:'abc')
|
91
|
+
@asset3.apply_depositor_metadata(user.user_key)
|
92
|
+
@asset3.save
|
93
|
+
sign_in user
|
94
|
+
end
|
95
|
+
after do
|
96
|
+
@collection.destroy
|
97
|
+
@asset1.destroy
|
98
|
+
@asset2.destroy
|
99
|
+
@asset3.destroy
|
100
|
+
end
|
101
|
+
|
102
|
+
it "should set collection on members" do
|
103
|
+
put :update, id: @collection.id, collection: {members:"add"}, batch_document_ids:[@asset3.pid,@asset1.pid, @asset2.pid]
|
104
|
+
response.should redirect_to Hydra::Collections::Engine.routes.url_helpers.collection_path(@collection.noid)
|
105
|
+
assigns[:collection].members.map{|m| m.pid}.sort.should == [@asset2, @asset3, @asset1].map {|m| m.pid}.sort
|
106
|
+
asset_results = ActiveFedora::SolrService.instance.conn.get "select", params:{fq:["id:\"#{@asset2.pid}\""],fl:['id',Solrizer.solr_name(:collection)]}
|
107
|
+
asset_results["response"]["numFound"].should == 1
|
108
|
+
doc = asset_results["response"]["docs"].first
|
109
|
+
doc["id"].should == @asset2.id
|
110
|
+
afterupdate = GenericFile.find(@asset2.pid)
|
111
|
+
doc[Solrizer.solr_name(:collection)].should == afterupdate.to_solr[Solrizer.solr_name(:collection)]
|
112
|
+
put :update, id: @collection.id, collection: {members:"remove"}, batch_document_ids:[@asset2]
|
113
|
+
asset_results = ActiveFedora::SolrService.instance.conn.get "select", params:{fq:["id:\"#{@asset2.pid}\""],fl:['id',Solrizer.solr_name(:collection)]}
|
114
|
+
asset_results["response"]["numFound"].should == 1
|
115
|
+
doc = asset_results["response"]["docs"].first
|
116
|
+
doc["id"].should == @asset2.pid
|
117
|
+
afterupdate = GenericFile.find(@asset2.pid)
|
118
|
+
doc[Solrizer.solr_name(:collection)].should be_nil
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
describe "#show" do
|
123
|
+
before do
|
124
|
+
@asset1 = GenericFile.new(title: "First of the Assets")
|
125
|
+
@asset1.apply_depositor_metadata(user.user_key)
|
126
|
+
@asset1.save!
|
127
|
+
@asset2 = GenericFile.new(title: "Second of the Assets", depositor:user.user_key)
|
128
|
+
@asset2.apply_depositor_metadata(user.user_key)
|
129
|
+
@asset2.save!
|
130
|
+
@asset3 = GenericFile.new(title: "Third of the Assets", depositor:user.user_key)
|
131
|
+
@asset3.apply_depositor_metadata(user.user_key)
|
132
|
+
@asset3.save!
|
133
|
+
@asset4 = GenericFile.new(title: "Third of the Assets", depositor:user.user_key)
|
134
|
+
@asset4.apply_depositor_metadata(user.user_key)
|
135
|
+
@asset4.save!
|
136
|
+
@collection = Collection.new
|
137
|
+
@collection.title = "My collection"
|
138
|
+
@collection.description = "My incredibly detailed description of the collection"
|
139
|
+
@collection.apply_depositor_metadata(user.user_key)
|
140
|
+
@collection.members = [@asset1,@asset2,@asset3]
|
141
|
+
@collection.save!
|
142
|
+
controller.stub(:authorize!).and_return(true)
|
143
|
+
controller.stub(:apply_gated_search)
|
144
|
+
end
|
145
|
+
context "when signed in" do
|
146
|
+
before do
|
147
|
+
sign_in user
|
148
|
+
end
|
149
|
+
|
150
|
+
it "should return the collection and its members" do
|
151
|
+
get :show, id: @collection.id
|
152
|
+
expect(response).to be_successful
|
153
|
+
assigns[:collection].title.should == @collection.title
|
154
|
+
ids = assigns[:member_docs].map(&:id)
|
155
|
+
expect(ids).to include @asset1.pid, @asset2.pid, @asset3.pid
|
156
|
+
expect(ids).to_not include @asset4.pid
|
157
|
+
end
|
158
|
+
end
|
159
|
+
context "not signed in" do
|
160
|
+
it "should not show me files in the collection" do
|
161
|
+
get :show, id: @collection.id
|
162
|
+
assigns[:member_docs].count.should == 0
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
describe "#edit" do
|
168
|
+
before do
|
169
|
+
@collection = Collection.new(title: "My collection", description: "My incredibly detailed description of the collection")
|
170
|
+
@collection.apply_depositor_metadata(user.user_key)
|
171
|
+
@collection.save
|
172
|
+
sign_in user
|
173
|
+
end
|
174
|
+
it "should not show flash" do
|
175
|
+
get :edit, id: @collection.id
|
176
|
+
flash[:notice].should be_nil
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end
|