hydra-head 4.1.3 → 5.0.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- metadata +28 -617
- data/.gitignore +0 -73
- data/.gitmodules +0 -4
- data/Gemfile +0 -14
- data/HISTORY.textile +0 -99
- data/INSTALL_PREREQ.textile +0 -3
- data/LICENSE +0 -14
- data/README.textile +0 -129
- data/Rakefile +0 -5
- data/app/assets/images/hydra/powered_by_hydra.png +0 -0
- data/app/assets/images/hydra/search-button.png +0 -0
- data/app/assets/javascripts/date-picker/booking/index.html +0 -368
- data/app/assets/javascripts/date-picker/calendarHTML.txt +0 -84
- data/app/assets/javascripts/date-picker/css/datepicker.css +0 -511
- data/app/assets/javascripts/date-picker/css/demo.css +0 -229
- data/app/assets/javascripts/date-picker/index.html +0 -798
- data/app/assets/javascripts/date-picker/js/datepicker.js +0 -2898
- data/app/assets/javascripts/date-picker/js/datepicker.packed.js +0 -1
- data/app/assets/javascripts/date-picker/js/lang/ar.js +0 -9
- data/app/assets/javascripts/date-picker/js/lang/cs.js +0 -9
- data/app/assets/javascripts/date-picker/js/lang/da.js +0 -10
- data/app/assets/javascripts/date-picker/js/lang/de.js +0 -10
- data/app/assets/javascripts/date-picker/js/lang/en.js +0 -9
- data/app/assets/javascripts/date-picker/js/lang/eo.js +0 -13
- data/app/assets/javascripts/date-picker/js/lang/es.js +0 -9
- data/app/assets/javascripts/date-picker/js/lang/et.js +0 -23
- data/app/assets/javascripts/date-picker/js/lang/fi.js +0 -7
- data/app/assets/javascripts/date-picker/js/lang/fr.js +0 -69
- data/app/assets/javascripts/date-picker/js/lang/he.js +0 -9
- data/app/assets/javascripts/date-picker/js/lang/hu.js +0 -9
- data/app/assets/javascripts/date-picker/js/lang/id.js +0 -9
- data/app/assets/javascripts/date-picker/js/lang/it.js +0 -11
- data/app/assets/javascripts/date-picker/js/lang/kr.js +0 -9
- data/app/assets/javascripts/date-picker/js/lang/lt.js +0 -8
- data/app/assets/javascripts/date-picker/js/lang/lv.js +0 -9
- data/app/assets/javascripts/date-picker/js/lang/nl.js +0 -9
- data/app/assets/javascripts/date-picker/js/lang/no.js +0 -9
- data/app/assets/javascripts/date-picker/js/lang/pl.js +0 -10
- data/app/assets/javascripts/date-picker/js/lang/pt-br.js +0 -11
- data/app/assets/javascripts/date-picker/js/lang/pt.js +0 -9
- data/app/assets/javascripts/date-picker/js/lang/ru.js +0 -11
- data/app/assets/javascripts/date-picker/js/lang/se.js +0 -9
- data/app/assets/javascripts/date-picker/js/lang/si.js +0 -9
- data/app/assets/javascripts/date-picker/js/lang/tr.js +0 -9
- data/app/assets/javascripts/date-picker/language/index.html +0 -240
- data/app/assets/javascripts/date-picker/media/Thumbs.db +0 -0
- data/app/assets/javascripts/date-picker/media/backstripes.gif +0 -0
- data/app/assets/javascripts/date-picker/media/bg_header.jpg +0 -0
- data/app/assets/javascripts/date-picker/media/bullet1.gif +0 -0
- data/app/assets/javascripts/date-picker/media/bullet2.gif +0 -0
- data/app/assets/javascripts/date-picker/media/cal-grey.gif +0 -0
- data/app/assets/javascripts/date-picker/media/cal.gif +0 -0
- data/app/assets/javascripts/date-picker/media/gradient-e5e5e5-ffffff.gif +0 -0
- data/app/assets/javascripts/hydra/hydra-head.js +0 -195
- data/app/assets/javascripts/hydra/mediashelf.datepicker.js +0 -39
- data/app/assets/javascripts/hydra/mediashelf.placeholder.js +0 -67
- data/app/assets/javascripts/jquery.form.js +0 -1076
- data/app/assets/javascripts/jquery.ui.datepicker.js +0 -1793
- data/app/assets/javascripts/spin.min.js +0 -2
- data/app/assets/stylesheets/hydra/html_refactor.css +0 -79
- data/app/assets/stylesheets/hydra/hydrangea-split-button.css +0 -18
- data/app/assets/stylesheets/hydra/hydrangea.css +0 -288
- data/app/assets/stylesheets/hydra/ie-styles.css +0 -149
- data/app/assets/stylesheets/hydra/styles.css +0 -946
- data/app/assets/stylesheets/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/app/assets/stylesheets/redmond/images/ui-bg_flat_55_fbec88_40x100.png +0 -0
- data/app/assets/stylesheets/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
- data/app/assets/stylesheets/redmond/images/ui-bg_glass_85_dfeffc_1x400.png +0 -0
- data/app/assets/stylesheets/redmond/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/app/assets/stylesheets/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
- data/app/assets/stylesheets/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
- data/app/assets/stylesheets/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
- data/app/assets/stylesheets/redmond/images/ui-icons_217bc0_256x240.png +0 -0
- data/app/assets/stylesheets/redmond/images/ui-icons_2e83ff_256x240.png +0 -0
- data/app/assets/stylesheets/redmond/images/ui-icons_469bdd_256x240.png +0 -0
- data/app/assets/stylesheets/redmond/images/ui-icons_6da8d5_256x240.png +0 -0
- data/app/assets/stylesheets/redmond/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/app/assets/stylesheets/redmond/images/ui-icons_d8e7f3_256x240.png +0 -0
- data/app/assets/stylesheets/redmond/images/ui-icons_f9bd01_256x240.png +0 -0
- data/app/assets/stylesheets/redmond/jquery-ui-1.8.5.custom.css +0 -572
- data/app/controllers/downloads_controller.rb +0 -20
- data/app/controllers/hydra/application_controller.rb +0 -5
- data/app/controllers/hydra/assets_controller.rb +0 -12
- data/app/controllers/hydra/contributors_controller.rb +0 -115
- data/app/controllers/hydra/file_assets_controller.rb +0 -3
- data/app/controllers/hydra/permissions_controller.rb +0 -117
- data/app/controllers/user_sessions_controller.rb +0 -13
- data/app/helpers/application_helper.rb +0 -3
- data/app/helpers/article_metadata_helper.rb +0 -4
- data/app/helpers/blacklight_helper.rb +0 -4
- data/app/helpers/downloads_helper.rb +0 -4
- data/app/helpers/facets_helper.rb +0 -4
- data/app/helpers/generic_content_objects_helper.rb +0 -4
- data/app/helpers/hydra/application_helper_behavior.rb +0 -8
- data/app/helpers/hydra/article_metadata_helper_behavior.rb +0 -95
- data/app/helpers/hydra/blacklight_helper_behavior.rb +0 -128
- data/app/helpers/hydra/downloads_helper_behavior.rb +0 -24
- data/app/helpers/hydra/facets_helper_behavior.rb +0 -34
- data/app/helpers/hydra/generic_content_objects_helper_behavior.rb +0 -17
- data/app/helpers/hydra/hydra_assets_helper_behavior.rb +0 -76
- data/app/helpers/hydra/hydra_fedora_metadata_helper_behavior.rb +0 -379
- data/app/helpers/hydra/hydra_helper_behavior.rb +0 -195
- data/app/helpers/hydra/hydra_uploader_helper_behavior.rb +0 -23
- data/app/helpers/hydra/inline_editable_metadata_helper_behavior.rb +0 -21
- data/app/helpers/hydra/javascript_includes_helper_behavior.rb +0 -94
- data/app/helpers/hydra/personalization_helper_behavior.rb +0 -49
- data/app/helpers/hydra/release_process_helper_behavior.rb +0 -37
- data/app/helpers/hydra_assets_helper.rb +0 -4
- data/app/helpers/hydra_fedora_metadata_helper.rb +0 -4
- data/app/helpers/hydra_helper.rb +0 -4
- data/app/helpers/hydra_uploader_helper.rb +0 -4
- data/app/helpers/inline_editable_metadata_helper.rb +0 -4
- data/app/helpers/javascript_includes_helper.rb +0 -4
- data/app/helpers/personalization_helper.rb +0 -4
- data/app/helpers/release_process_helper.rb +0 -4
- data/app/models/file_asset.rb +0 -5
- data/app/models/generic_content.rb +0 -26
- data/app/models/generic_image.rb +0 -67
- data/app/models/hydra/datastream/properties.rb +0 -24
- data/app/models/mods_asset.rb +0 -24
- data/app/models/superuser.rb +0 -14
- data/app/models/user_attribute.rb +0 -37
- data/app/models/uses_default_partials.rb +0 -23
- data/app/views/_add_assets_links.html.erb +0 -14
- data/app/views/_flash_msg.html.erb +0 -5
- data/app/views/_user_util_links.html.erb +0 -31
- data/app/views/catalog/_citation.html.erb +0 -11
- data/app/views/catalog/_constraints_element.html.erb +0 -34
- data/app/views/catalog/_delete_partials/_default.html.erb +0 -22
- data/app/views/catalog/_document_list.html.erb +0 -11
- data/app/views/catalog/_edit_partials/_default.html.erb +0 -57
- data/app/views/catalog/_edit_partials/_default_details.html.erb +0 -13
- data/app/views/catalog/_facets.html.erb +0 -37
- data/app/views/catalog/_home.html.erb +0 -6
- data/app/views/catalog/_home_text.html.erb +0 -4
- data/app/views/catalog/_index_partials/_default.html.erb +0 -20
- data/app/views/catalog/_index_partials/_default_details.html.erb +0 -14
- data/app/views/catalog/_index_partials/_default_group.html.erb +0 -15
- data/app/views/catalog/_opensearch_response_metadata.html.erb +0 -2
- data/app/views/catalog/_show_partials/_default.html.erb +0 -21
- data/app/views/catalog/_show_partials/_default_details.html.erb +0 -15
- data/app/views/catalog/_show_partials/_facets.html.erb +0 -52
- data/app/views/catalog/_sms_form.html.erb +0 -21
- data/app/views/catalog/_sort_and_per_page.html.erb +0 -23
- data/app/views/catalog/_uva_tabs.html.erb +0 -10
- data/app/views/catalog/about.html.erb +0 -0
- data/app/views/catalog/show.html.erb +0 -40
- data/app/views/contributors/_add_contributor_split_button.html.erb +0 -10
- data/app/views/contributors/_edit_conference.html.erb +0 -29
- data/app/views/contributors/_edit_organization.html.erb +0 -29
- data/app/views/contributors/_edit_person.html.erb +0 -39
- data/app/views/contributors/_index.html.erb +0 -11
- data/app/views/contributors/_new.html.erb +0 -10
- data/app/views/contributors/_show_conference.html.erb +0 -12
- data/app/views/contributors/_show_organization.html.erb +0 -21
- data/app/views/contributors/_show_person.html.erb +0 -17
- data/app/views/contributors/new.html.erb +0 -14
- data/app/views/downloads/index.html.erb +0 -1
- data/app/views/generic_content_objects/_contributor_form.html.erb +0 -11
- data/app/views/generic_content_objects/_description_form.html.erb +0 -7
- data/app/views/generic_content_objects/_edit_description.html.erb +0 -23
- data/app/views/generic_content_objects/_new.html.erb +0 -0
- data/app/views/generic_content_objects/_show_description.html.erb +0 -41
- data/app/views/generic_contents/_edit.html.erb +0 -10
- data/app/views/generic_contents/_index.html.erb +0 -21
- data/app/views/generic_contents/_show.html.erb +0 -6
- data/app/views/generic_contents/_show_content.html.erb +0 -7
- data/app/views/generic_images/_edit.html.erb +0 -36
- data/app/views/generic_images/_index.html.erb +0 -24
- data/app/views/generic_images/_show.html.erb +0 -13
- data/app/views/generic_images/_show_all.html.erb +0 -14
- data/app/views/generic_images/_show_content.html.erb +0 -7
- data/app/views/hydra/file_assets/_asset_saved_flash.html.erb +0 -2
- data/app/views/hydra/file_assets/_deletable_result.html.erb +0 -5
- data/app/views/hydra/file_assets/_file_assets_form.html.erb +0 -11
- data/app/views/hydra/file_assets/_index.html.erb +0 -29
- data/app/views/hydra/file_assets/_new.html.erb +0 -6
- data/app/views/hydra/file_assets/_result.html.erb +0 -11
- data/app/views/hydra/file_assets/index.html.erb +0 -5
- data/app/views/hydra/permissions/_edit_person_permissions.html.erb +0 -30
- data/app/views/hydra/permissions/_index.html.erb +0 -46
- data/app/views/hydra/permissions/_new.html.erb +0 -14
- data/app/views/hydra/permissions/_permissions_form.html.erb +0 -23
- data/app/views/hydra/permissions/index.html.erb +0 -1
- data/app/views/hydra/permissions/new.html.erb +0 -1
- data/app/views/layouts/hydra-head.html.erb +0 -47
- data/app/views/mods_assets/_additional_info_form.html.erb +0 -44
- data/app/views/mods_assets/_contributor_form.html.erb +0 -14
- data/app/views/mods_assets/_edit.html.erb +0 -10
- data/app/views/mods_assets/_edit_description.html.erb +0 -73
- data/app/views/mods_assets/_edit_journal.html.erb +0 -57
- data/app/views/mods_assets/_index.html.erb +0 -1
- data/app/views/mods_assets/_index_list.html.erb +0 -37
- data/app/views/mods_assets/_index_table.html.erb +0 -7
- data/app/views/mods_assets/_progress_box.html.erb +0 -82
- data/app/views/mods_assets/_publication_form.html.erb +0 -13
- data/app/views/mods_assets/_show.html.erb +0 -39
- data/app/views/mods_assets/_show_additional_info.html.erb +0 -17
- data/app/views/mods_assets/_show_contributors.html.erb +0 -7
- data/app/views/mods_assets/_show_description.html.erb +0 -35
- data/app/views/mods_assets/_show_file_assets.html.erb +0 -22
- data/app/views/mods_assets/_show_journal.html.erb +0 -42
- data/app/views/mods_assets/_show_permissions.html.erb +0 -15
- data/app/views/mods_assets/_show_publication.html.erb +0 -8
- data/app/views/shared/_delete_asset_confirmation.html.erb +0 -17
- data/app/views/user_sessions/_login_form.html.erb +0 -10
- data/app/views/user_sessions/logged_out.html.erb +0 -1
- data/config/fedora.yml +0 -15
- data/config/jetty.yml +0 -6
- data/config/locales/hydra.en.yml +0 -7
- data/config/role_map_cucumber.yml +0 -10
- data/config/role_map_development.yml +0 -12
- data/config/role_map_production.yml +0 -2
- data/config/role_map_test.yml +0 -14
- data/config/routes.rb +0 -12
- data/config/solr.yml +0 -9
- data/config/solr_mappings.yml +0 -22
- data/db/migrate/20101105214243_add_user_attributes_table.rb +0 -15
- data/db/migrate/20101108192527_create_superusers.rb +0 -12
- data/fedora_conf/conf/development/fedora.fcfg +0 -1021
- data/fedora_conf/conf/test/fedora.fcfg +0 -1021
- data/hydra-head.gemspec +0 -41
- data/init.rb +0 -4
- data/install.rb +0 -1
- data/lib/application_helper.rb +0 -3
- data/lib/generators/hydra/assets_generator.rb +0 -50
- data/lib/generators/hydra/cucumber_support_generator.rb +0 -29
- data/lib/generators/hydra/head_generator.rb +0 -165
- data/lib/generators/hydra/hyhead_fixtures_generator.rb +0 -27
- data/lib/generators/hydra/templates/catalog_controller.rb +0 -162
- data/lib/generators/hydra/templates/config/fedora.yml +0 -14
- data/lib/generators/hydra/templates/config/initializers/action_dispatch_http_upload_monkey_patch.rb +0 -12
- data/lib/generators/hydra/templates/config/initializers/hydra_config.rb +0 -44
- data/lib/generators/hydra/templates/config/role_map_cucumber.yml +0 -10
- data/lib/generators/hydra/templates/config/role_map_development.yml +0 -12
- data/lib/generators/hydra/templates/config/role_map_production.yml +0 -2
- data/lib/generators/hydra/templates/config/role_map_test.yml +0 -15
- data/lib/generators/hydra/templates/config/solr.yml +0 -10
- data/lib/generators/hydra/templates/config/solr_mappings.yml +0 -22
- data/lib/generators/hydra/templates/fedora_conf/conf/development/fedora.fcfg +0 -1021
- data/lib/generators/hydra/templates/fedora_conf/conf/test/fedora.fcfg +0 -1021
- data/lib/generators/hydra/templates/migrations/create_superusers.rb +0 -12
- data/lib/generators/hydra/templates/solr_conf/conf/schema.xml +0 -124
- data/lib/generators/hydra/templates/solr_conf/conf/solrconfig.xml +0 -394
- data/lib/generators/hydra/templates/solr_conf/solr.xml +0 -35
- data/lib/hydra-head.rb +0 -29
- data/lib/hydra-head/controller.rb +0 -29
- data/lib/hydra-head/engine.rb +0 -29
- data/lib/hydra-head/routes.rb +0 -90
- data/lib/hydra-head/version.rb +0 -4
- data/lib/hydra.rb +0 -52
- data/lib/hydra/assets.rb +0 -7
- data/lib/hydra/assets_controller_helper.rb +0 -122
- data/lib/hydra/catalog.rb +0 -11
- data/lib/hydra/controller.rb +0 -26
- data/lib/hydra/controller/assets_controller_behavior.rb +0 -143
- data/lib/hydra/controller/catalog_controller_behavior.rb +0 -56
- data/lib/hydra/controller/controller_behavior.rb +0 -59
- data/lib/hydra/controller/file_assets_behavior.rb +0 -144
- data/lib/hydra/controller/repository_controller_behavior.rb +0 -119
- data/lib/hydra/controller/upload_behavior.rb +0 -139
- data/lib/hydra/file_assets.rb +0 -11
- data/lib/hydra/file_assets_helper.rb +0 -12
- data/lib/hydra/generic_content.rb +0 -130
- data/lib/hydra/generic_image.rb +0 -112
- data/lib/hydra/generic_user_attributes.rb +0 -41
- data/lib/hydra/global_configurable.rb +0 -46
- data/lib/hydra/model_methods.rb +0 -104
- data/lib/hydra/model_mixins.rb +0 -8
- data/lib/hydra/model_mixins/common_metadata.rb +0 -25
- data/lib/hydra/model_mixins/solr_document_extension.rb +0 -24
- data/lib/hydra/models/file_asset.rb +0 -78
- data/lib/hydra/repository_controller.rb +0 -28
- data/lib/hydra/rights_metadata.rb +0 -194
- data/lib/hydra/solr.rb +0 -9
- data/lib/hydra/submission_workflow.rb +0 -138
- data/lib/hydra/superuser_attributes.rb +0 -19
- data/lib/hydra/ui.rb +0 -6
- data/lib/hydra/ui/controller.rb +0 -46
- data/lib/hydra/workflow.rb +0 -5
- data/lib/hydra/workflow/controller.rb +0 -3
- data/lib/mediashelf/active_fedora_helper.rb +0 -73
- data/lib/prev_next_links.rb +0 -33
- data/lib/railties/active-fedora.rake +0 -1
- data/lib/railties/hydra-fixtures.rake +0 -50
- data/lib/railties/hydra_jetty.rake +0 -53
- data/lib/user_attributes_loader.rb +0 -26
- data/solr/conf/schema.xml +0 -116
- data/solr/conf/solrconfig.xml +0 -311
- data/solr/solr.xml +0 -35
- data/solr_conf/conf/schema.xml +0 -124
- data/solr_conf/conf/solrconfig.xml +0 -394
- data/solr_conf/solr.xml +0 -35
- data/tasks/active-fedora.rake +0 -1
- data/tasks/hydra-head-fixtures.rake +0 -58
- data/tasks/hydra-head.rake +0 -209
- data/tasks/hydra_jetty.rake +0 -53
- data/tasks/hyhead_rspec.rake +0 -57
- data/tasks/replicator.rake +0 -27
- data/tasks/solrizer-fedora.rake +0 -53
- data/tasks/solrizer.rake +0 -13
- data/test_support/etc/Gemfile +0 -46
- data/test_support/etc/common_metadata_asset.rb +0 -18
- data/test_support/features/absent_model_edit.feature +0 -27
- data/test_support/features/absent_model_search_result.feature +0 -18
- data/test_support/features/absent_model_show.feature +0 -27
- data/test_support/features/button_add_assets.feature +0 -22
- data/test_support/features/button_add_generic_content.feature +0 -11
- data/test_support/features/button_add_image.feature +0 -11
- data/test_support/features/button_add_mods_asset.feature +0 -11
- data/test_support/features/button_delete_asset.feature +0 -13
- data/test_support/features/contributor_add.feature +0 -44
- data/test_support/features/default_partials_edit.feature +0 -27
- data/test_support/features/default_partials_search_result.feature +0 -22
- data/test_support/features/default_partials_show.feature +0 -24
- data/test_support/features/file_upload.feature +0 -80
- data/test_support/features/generic_content_create.feature +0 -7
- data/test_support/features/generic_content_edit.feature +0 -21
- data/test_support/features/generic_content_search_result.feature +0 -22
- data/test_support/features/generic_content_show.feature +0 -20
- data/test_support/features/generic_image_create.feature +0 -7
- data/test_support/features/generic_image_edit.feature +0 -21
- data/test_support/features/generic_image_search_result.feature +0 -22
- data/test_support/features/generic_image_show.feature +0 -20
- data/test_support/features/home_page.feature +0 -9
- data/test_support/features/html_validity.feature +0 -43
- data/test_support/features/mods_asset_contributors_edit.feature +0 -88
- data/test_support/features/mods_asset_create.feature +0 -17
- data/test_support/features/mods_asset_edit.feature +0 -65
- data/test_support/features/mods_asset_edit_without_permission.feature +0 -15
- data/test_support/features/mods_asset_search_result.feature +0 -24
- data/test_support/features/mods_asset_show.feature +0 -90
- data/test_support/features/nonexistent_object_show.feature +0 -9
- data/test_support/features/permissions_add.feature +0 -16
- data/test_support/features/permissions_edit.feature +0 -65
- data/test_support/features/step_definitions/catalog_index_steps.rb +0 -14
- data/test_support/features/step_definitions/create_asset_steps.rb +0 -3
- data/test_support/features/step_definitions/edit_metadata_steps.rb +0 -72
- data/test_support/features/step_definitions/file_list_steps.rb +0 -36
- data/test_support/features/step_definitions/html_validity_steps.rb +0 -64
- data/test_support/features/step_definitions/hydra_metadata_steps.rb +0 -3
- data/test_support/features/step_definitions/hydra_steps.rb +0 -8
- data/test_support/features/step_definitions/inline_editable_edit_steps.rb +0 -77
- data/test_support/features/step_definitions/search_steps.rb +0 -88
- data/test_support/features/step_definitions/searching_steps.rb +0 -22
- data/test_support/features/step_definitions/show_document_steps.rb +0 -89
- data/test_support/features/step_definitions/user_steps.rb +0 -42
- data/test_support/features/step_definitions/web_steps.rb +0 -223
- data/test_support/features/support/env.rb +0 -57
- data/test_support/features/support/paths.rb +0 -85
- data/test_support/features/switch_users.feature +0 -14
- data/test_support/features/view_catalog_index.feature +0 -18
- data/test_support/fixtures/empty_file.txt +0 -0
- data/test_support/fixtures/hydra_test_default_partials.foxml.xml +0 -80
- data/test_support/fixtures/hydra_test_generic_content.foxml.xml +0 -138
- data/test_support/fixtures/hydra_test_generic_image.foxml.xml +0 -395
- data/test_support/fixtures/hydra_test_no_model.foxml.xml +0 -79
- data/test_support/fixtures/hydrangea_fixture_archivist_only_mods_article.foxml.xml +0 -1212
- data/test_support/fixtures/hydrangea_fixture_file_asset1.foxml.xml +0 -4946
- data/test_support/fixtures/hydrangea_fixture_mods_article1.foxml.xml +0 -234
- data/test_support/fixtures/hydrangea_fixture_mods_article2.foxml.xml +0 -177
- data/test_support/fixtures/hydrangea_fixture_mods_article3.foxml.xml +0 -170
- data/test_support/fixtures/hydrangea_fixture_mods_dataset1.foxml.xml +0 -187
- data/test_support/fixtures/hydrangea_fixture_uploaded_svg1.foxml.xml +0 -676
- data/test_support/fixtures/hydrus_admin_class1.foxml.xml +0 -176
- data/test_support/fixtures/image.jp2 +0 -0
- data/test_support/fixtures/libra-oa_1.foxml.xml +0 -2324
- data/test_support/fixtures/libra-oa_2.foxml.xml +0 -2422
- data/test_support/fixtures/libra-oa_7.foxml.xml +0 -1735
- data/test_support/fixtures/small_file.txt +0 -1
- data/test_support/spec/controllers/catalog_controller_spec.rb +0 -138
- data/test_support/spec/controllers/catalog_controller_viewing_context_spec.rb +0 -67
- data/test_support/spec/controllers/catalog_valid_html_spec.rb +0 -123
- data/test_support/spec/controllers/contributors_controller_spec.rb +0 -67
- data/test_support/spec/controllers/file_assets_controller_spec.rb +0 -194
- data/test_support/spec/controllers/hydra-assets_controller_spec.rb +0 -151
- data/test_support/spec/controllers/hydra_controller_spec.rb +0 -43
- data/test_support/spec/controllers/hydra_ui_controller_spec.rb +0 -21
- data/test_support/spec/controllers/permissions_controller_spec.rb +0 -39
- data/test_support/spec/controllers/user_sessions_controller_spec.rb +0 -35
- data/test_support/spec/factories.rb +0 -11
- data/test_support/spec/helpers/access_controls_enforcement_spec.rb +0 -119
- data/test_support/spec/helpers/access_controls_evaluation_spec.rb +0 -26
- data/test_support/spec/helpers/assets_controller_helper_spec.rb +0 -63
- data/test_support/spec/helpers/blacklight_helper_spec.rb +0 -60
- data/test_support/spec/helpers/file_assets_helper_spec.rb +0 -116
- data/test_support/spec/helpers/generic_content_objects_helper_spec.rb +0 -17
- data/test_support/spec/helpers/hydra-repository_controller_spec.rb +0 -54
- data/test_support/spec/helpers/hydra_assets_helper_spec.rb +0 -143
- data/test_support/spec/helpers/hydra_fedora_metadata_helper_spec.rb +0 -255
- data/test_support/spec/helpers/hydra_helper_spec.rb +0 -105
- data/test_support/spec/helpers/hydra_model_methods_spec.rb +0 -88
- data/test_support/spec/helpers/hydra_uploader_helper_spec.rb +0 -26
- data/test_support/spec/helpers/javascript_includes_helper_spec.rb +0 -51
- data/test_support/spec/integration/file_asset_spec.rb +0 -68
- data/test_support/spec/lib/catalog_spec.rb +0 -23
- data/test_support/spec/lib/global_configurable_spec.rb +0 -98
- data/test_support/spec/lib/hydra_submission_workflow_spec.rb +0 -141
- data/test_support/spec/lib/model_methods_spec.rb +0 -29
- data/test_support/spec/models/file_asset_spec.rb +0 -25
- data/test_support/spec/models/generic_content_spec.rb +0 -39
- data/test_support/spec/models/generic_image_spec.rb +0 -75
- data/test_support/spec/models/mods_asset_spec.rb +0 -20
- data/test_support/spec/models/solr_document_spec.rb +0 -17
- data/test_support/spec/models/user_spec.rb +0 -94
- data/test_support/spec/rcov.opts +0 -3
- data/test_support/spec/spec.opts +0 -4
- data/test_support/spec/spec_helper.rb +0 -63
- data/test_support/spec/support/matchers/helper_matcher.rb +0 -14
- data/test_support/spec/support/matchers/solr_matchers.rb +0 -60
- data/test_support/spec/unit/hydra-head-engine_spec.rb +0 -8
- data/test_support/spec/unit/hydra-head_spec.rb +0 -8
@@ -1,63 +0,0 @@
|
|
1
|
-
require File.expand_path( File.join( File.dirname(__FILE__),'..','spec_helper') )
|
2
|
-
|
3
|
-
describe Hydra::AssetsControllerHelper do
|
4
|
-
describe "sanitize_update_params" do
|
5
|
-
it "should create a hash appropriate for passing into ActiveFedora::Base.update_datastream_attributes" do
|
6
|
-
sample_params = {
|
7
|
-
"content_type"=>"mods_asset",
|
8
|
-
"action"=>"update",
|
9
|
-
"_method"=>"put",
|
10
|
-
"field_selectors"=>{
|
11
|
-
"descMetadata"=>{"person_0_computing_id"=>[{"person"=>"0"}, "computing_id"], "journal_0_issue_start_page"=>[{"journal"=>"0"}, "issue", "start_page"], "person_1_description"=>[{"person"=>"1"}, "description"], "person_1_institution"=>[{"person"=>"1"}, "institution"], "journal_0_origin_info_publisher"=>[{"journal"=>"0"}, "origin_info", "publisher"], "abstract"=>["abstract"], "person_0_last_name"=>[{"person"=>"0"}, "last_name"], "person_0_description"=>[{"person"=>"0"}, "description"], "journal_0_issue_volume"=>[{"journal"=>"0"}, "issue", "volume"], "title_info_main_title"=>["title_info", "main_title"], "location_url"=>["location", "url"], "note"=>["note"], "person_1_last_name"=>[{"person"=>"1"}, "last_name"], "subject_topic"=>["subject", "topic"], "person_0_institution"=>[{"person"=>"0"}, "institution"], "person_1_first_name"=>[{"person"=>"1"}, "first_name"], "person_1"=>[{"person"=>"1"}], "journal_0_title_info_main_title"=>[{"journal"=>"0"}, "title_info", "main_title"], "journal_0_issue_level"=>[{"journal"=>"0"}, "issue", "level"], "journal_0_issue_end_page"=>[{"journal"=>"0"}, "issue", "end_page"], "peer_reviewed"=>["peer_reviewed"], "person_0_first_name"=>[{"person"=>"0"}, "first_name"], "person_1_computing_id"=>[{"person"=>"1"}, "computing_id"], "journal_0_issn"=>[{"journal"=>"0"}, "issn"], "journal_0_issue_publication_date"=>[{"journal"=>"0"}, "issue", "publication_date"], "subject_topic" => ["subject", "topic", "subject", "topic"]},
|
12
|
-
"rightsMetadata"=>{"embargo_embargo_release_date"=>["embargo", "embargo_release_date"]},
|
13
|
-
"properties"=>{"release_to"=>["release_to"]}
|
14
|
-
},
|
15
|
-
"id"=>"hydrangea:fixture_mods_article3",
|
16
|
-
"controller"=>"assets",
|
17
|
-
"asset"=>{"descMetadata"=>{"person_0_computing_id"=>{"0"=>""}, "journal_0_issue_start_page"=>{"0"=>"195"}, "person_1_description"=>{"0"=>""}, "person_1_institution"=>{"0"=>"Baltimore"}, "journal_0_origin_info_publisher"=>{"0"=>"PUBLISHER"}, "abstract"=>{"0"=>"ABSTRACT"}, "person_0_last_name"=>{"0"=>"Smith"}, "person_0_description"=>{"0"=>""}, "journal_0_issue_volume"=>{"0"=>"2 "}, "title_info_main_title"=>{"0"=>"Test Article"}, "location_url"=>{"0"=>"http://example.com/foo"}, "note"=>{"0"=>""}, "person_1_last_name"=>{"0"=>"Lacks"}, "subject_topic"=>{"0"=>"TOPIC 1", "1"=>"TOPIC 2", "2"=>"CONTROLLED TERM"}, "person_0_institution"=>{"0"=>"FACULTY, UNIVERSITY"}, "person_1_first_name"=>{"0"=>"Henrietta"}, "journal_0_title_info_main_title"=>{"0"=>"The Journal of Mock Object"}, "journal_0_issue_level"=>{"0"=>""}, "journal_0_issue_end_page"=>{"0"=>"230"}, "person_0_first_name"=>{"0"=>"John"}, "person_1_computing_id"=>{"0"=>""}, "journal_0_issn"=>{"0"=>"1234-5678"}, "journal_0_issue_publication_date"=>{"0"=>"FEB. 2007"}, "subject_topic" => {"0"=>"Topic1", "1"=>"Topic2"}}, "rightsMetadata"=>{"embargo_embargo_release_date"=>{"0"=>""}}, "properties"=>{"released"=>{"0"=>"true"}, "release_to"=>{"0"=>"public"}}}
|
18
|
-
}
|
19
|
-
|
20
|
-
expected_sane_params = {
|
21
|
-
"descMetadata"=>{[{:person=>0}, :institution]=>{"0"=>"FACULTY, UNIVERSITY"}, [{:journal=>0}, :title_info, :main_title]=>{"0"=>"The Journal of Mock Object"}, [{:journal=>0}, :issue, :volume]=>{"0"=>"2 "}, [{:journal=>0}, :issn]=>{"0"=>"1234-5678"}, [{:person=>1}, :first_name]=>{"0"=>"Henrietta"}, [{:person=>0}, :last_name]=>{"0"=>"Smith"}, [:location, :url]=>{"0"=>"http://example.com/foo"}, [:subject, :topic]=>{"0"=>"TOPIC 1", "1"=>"TOPIC 2", "2"=>"CONTROLLED TERM"}, [{:person=>0}, :first_name]=>{"0"=>"John"}, [{:person=>1}, :computing_id]=>{"0"=>""}, [{:journal=>0}, :issue, :end_page]=>{"0"=>"230"}, [:note]=>{"0"=>""}, [:title_info, :main_title]=>{"0"=>"Test Article"}, [{:journal=>0}, :issue, :publication_date]=>{"0"=>"FEB. 2007"}, [{:person=>1}, :description]=>{"0"=>""}, [:abstract]=>{"0"=>"ABSTRACT"}, [{:journal=>0}, :issue, :level]=>{"0"=>""}, [{:person=>1}, :institution]=>{"0"=>"Baltimore"}, [{:person=>0}, :computing_id]=>{"0"=>""}, [{:person=>1}, :last_name]=>{"0"=>"Lacks"}, [{:journal=>0}, :issue, :start_page]=>{"0"=>"195"}, [{:person=>0}, :description]=>{"0"=>""}, [{:journal=>0}, :origin_info, :publisher]=>{"0"=>"PUBLISHER"}, [:subject, :topic]=>{"0"=>"Topic1", "1"=>"Topic2"} }, "rightsMetadata"=>{[:embargo, :embargo_release_date]=>{"0"=>""}},
|
22
|
-
"properties"=>{[:release_to]=>{"0"=>"public"}, :released=>{"0"=>"true"}}
|
23
|
-
}
|
24
|
-
helper.stubs(:params).returns(sample_params)
|
25
|
-
sanitized_params = helper.sanitize_update_params
|
26
|
-
sanitized_params.should == expected_sane_params
|
27
|
-
sanitized_params["descMetadata"].should == expected_sane_params["descMetadata"]
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
describe "tidy_response_from_update" do
|
32
|
-
it "should put response values into an array with fieldname / index / value Hash for each field updated" do
|
33
|
-
sample_input = {"descMetadata"=>{"journal_0_issue_start_page"=>{"0"=>"195"}, "person_0_computing_id"=>{"-1"=>""}, "journal_0_origin_info_publisher"=>{"0"=>"PUBLISHER"}, "person_1_institution"=>{"0"=>"Baltimore"}, "person_1_description"=>{"-1"=>""}, "abstract"=>{"0"=>"ABSTRACT"}, "person_0_description"=>{"-1"=>""}, "person_0_last_name"=>{"0"=>"Smith"}, "journal_0_issue_volume"=>{"0"=>"2 "}, "title_info_main_title"=>{"0"=>"Matt's Test Article! Again!?"}, "note"=>{"-1"=>""}, "location_url"=>{"0"=>"http://example.com/foo"}, "person_1_last_name"=>{"0"=>"Lacks"}, "subject_topic"=>{"0"=>"TOPIC 1", "1"=>"TOPIC 2", "2"=>"CONTROLLED TERM"}, "journal_0_issue_level"=>{"0"=>"55 "}, "journal_0_issue_end_page"=>{"0"=>"230"}, "person_1_first_name"=>{"0"=>"Henrietta"}, "person_0_institution"=>{"0"=>"FACULTY, UNIVERSITY"}, "journal_0_title_info_main_title"=>{"0"=>"The Journal of Mock Object"}, "journal_0_issue_publication_date"=>{"0"=>"FEB. 2007"}, "person_1_computing_id"=>{"-1"=>""}, "person_0_first_name"=>{"0"=>"John"}, "journal_0_issn"=>{"0"=>"1234-5678"}}, "rightsMetadata"=>{"embargo_embargo_release_date"=>{"-1"=>""}}, "properties"=>{:released=>{"0"=>"true"}, :release_to=>{"0"=>"public"}, [:release_to]=>{}}}
|
34
|
-
expected_output = {"updated"=>[{"value"=>{"0"=>"195"}, "index"=>"journal_0_issue_start_page", "field_name"=>"descMetadata"}, {"value"=>{"-1"=>""}, "index"=>"person_0_computing_id", "field_name"=>"descMetadata"}, {"value"=>{"0"=>"PUBLISHER"}, "index"=>"journal_0_origin_info_publisher", "field_name"=>"descMetadata"}, {"value"=>{"0"=>"Baltimore"}, "index"=>"person_1_institution", "field_name"=>"descMetadata"}, {"value"=>{"-1"=>""}, "index"=>"person_1_description", "field_name"=>"descMetadata"}, {"value"=>{"0"=>"ABSTRACT"}, "index"=>"abstract", "field_name"=>"descMetadata"}, {"value"=>{"-1"=>""}, "index"=>"person_0_description", "field_name"=>"descMetadata"}, {"value"=>{"0"=>"Smith"}, "index"=>"person_0_last_name", "field_name"=>"descMetadata"}, {"value"=>{"0"=>"2 "}, "index"=>"journal_0_issue_volume", "field_name"=>"descMetadata"}, {"value"=>{"0"=>"Matt's Test Article! Again!?"}, "index"=>"title_info_main_title", "field_name"=>"descMetadata"}, {"value"=>{"-1"=>""}, "index"=>"note", "field_name"=>"descMetadata"}, {"value"=>{"0"=>"http://example.com/foo"}, "index"=>"location_url", "field_name"=>"descMetadata"}, {"value"=>{"0"=>"Lacks"}, "index"=>"person_1_last_name", "field_name"=>"descMetadata"}, {"value"=>{"0"=>"TOPIC 1", "1"=>"TOPIC 2", "2"=>"CONTROLLED TERM"}, "index"=>"subject_topic", "field_name"=>"descMetadata"}, {"value"=>{"0"=>"55 "}, "index"=>"journal_0_issue_level", "field_name"=>"descMetadata"}, {"value"=>{"0"=>"230"}, "index"=>"journal_0_issue_end_page", "field_name"=>"descMetadata"}, {"value"=>{"0"=>"Henrietta"}, "index"=>"person_1_first_name", "field_name"=>"descMetadata"}, {"value"=>{"0"=>"FACULTY, UNIVERSITY"}, "index"=>"person_0_institution", "field_name"=>"descMetadata"}, {"value"=>{"0"=>"The Journal of Mock Object"}, "index"=>"journal_0_title_info_main_title", "field_name"=>"descMetadata"}, {"value"=>{"0"=>"FEB. 2007"}, "index"=>"journal_0_issue_publication_date", "field_name"=>"descMetadata"}, {"value"=>{"-1"=>""}, "index"=>"person_1_computing_id", "field_name"=>"descMetadata"}, {"value"=>{"0"=>"John"}, "index"=>"person_0_first_name", "field_name"=>"descMetadata"}, {"value"=>{"0"=>"1234-5678"}, "index"=>"journal_0_issn", "field_name"=>"descMetadata"}, {"value"=>{"-1"=>""}, "index"=>"embargo_embargo_release_date", "field_name"=>"rightsMetadata"}, {"value"=>{"0"=>"true"}, "index"=>:released, "field_name"=>"properties"}, {"value"=>{"0"=>"public"}, "index"=>:release_to, "field_name"=>"properties"}, {"value"=>{}, "index"=>[:release_to], "field_name"=>"properties"}]}
|
35
|
-
result = helper.tidy_response_from_update(sample_input)
|
36
|
-
(expected_output["updated"] - result["updated"]).should == []
|
37
|
-
end
|
38
|
-
it "if handling submission from jeditable (which will only submit one value at a time), return the value it submitted" do
|
39
|
-
sample_input = {"descMetadata"=>{"journal_0_issue_start_page"=>{"0"=>"195"}} }
|
40
|
-
expected_output = {"0"=>"195"}
|
41
|
-
helper.stubs(:params).returns({:field_id => "my field id"})
|
42
|
-
helper.tidy_response_from_update(sample_input).should == expected_output
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
describe "update_document" do
|
47
|
-
it "should update the document with the provided params" do
|
48
|
-
sample_params = "sample params"
|
49
|
-
mock_document = mock("document")
|
50
|
-
mock_document.expects(:update_datastream_attributes).with(sample_params)
|
51
|
-
helper.update_document(mock_document, sample_params)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
describe "send_datastream" do
|
56
|
-
it "should return the requested datastream with content disposition & mime type set from datastream attributes" do
|
57
|
-
test_ds = ModsAsset.find("hydrangea:fixture_file_asset1").datastreams["DS1"]
|
58
|
-
helper.expects(:send_data).with(test_ds.content, :filename=>"bali.jpg", :type=>"image/jpeg")
|
59
|
-
helper.send(:send_datastream, test_ds)
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
end
|
@@ -1,60 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
-
|
3
|
-
describe BlacklightHelper do
|
4
|
-
|
5
|
-
describe "Overridden blacklight methods" do
|
6
|
-
describe "document_partial_name" do
|
7
|
-
|
8
|
-
it "Should lop off everything before the first colin after the slash" do
|
9
|
-
@config = Blacklight::Configuration.new.configure do |config|
|
10
|
-
config.show.display_type = 'has_model_s'
|
11
|
-
end
|
12
|
-
helper.stubs(:blacklight_config).returns(@config)
|
13
|
-
helper.document_partial_name('has_model_s' => ["info:fedora/afmodel:Presentation"]).should == "presentations"
|
14
|
-
helper.document_partial_name('has_model_s' => ["info:fedora/hull-cModel:genericContent"]).should == "generic_contents"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
describe "render_selected_facet_value" do
|
18
|
-
it "should be html_safe and not have the remove link" do
|
19
|
-
item = stub("item", :value=>'two', :hits=>9)
|
20
|
-
|
21
|
-
ret_val = helper.render_selected_facet_value("one", item)
|
22
|
-
ret_val.should == "<span class=\"selected\">two <span class=\"count\">(9)</span></span>"
|
23
|
-
ret_val.should be_html_safe
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
describe "link back to catalog" do
|
28
|
-
it "should return the view parameter in the link back to catalog method if there is one in the users previous search session" do
|
29
|
-
session[:search] = {:view=>"list"}
|
30
|
-
helper.link_back_to_catalog.should match(/\?view=list/)
|
31
|
-
end
|
32
|
-
it "should not return the view parameter if it wasn't provided" do
|
33
|
-
session[:search] = {}
|
34
|
-
helper.link_back_to_catalog.should_not match(/\?view=/)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
describe "SALT methods" do
|
40
|
-
describe "get_data_with_linked_label" do
|
41
|
-
before(:all) do
|
42
|
-
@orig_deprecation_behavior = Hydra::BlacklightHelperBehavior.deprecation_behavior
|
43
|
-
Hydra::BlacklightHelperBehavior.deprecation_behavior = :silence
|
44
|
-
end
|
45
|
-
after(:all) do
|
46
|
-
Hydra::BlacklightHelperBehavior.deprecation_behavior = @orig_deprecation_behavior
|
47
|
-
end
|
48
|
-
before(:each) do
|
49
|
-
@doc = {"field"=>["Item1","Item2","Item3"]}
|
50
|
-
end
|
51
|
-
it "should return a string representing the collection of items with the suplied delimiter" do
|
52
|
-
helper.get_data_with_linked_label(@doc,"Items","field",{:delimiter=>", "}).should match(/, /)
|
53
|
-
end
|
54
|
-
it "should return a string representing the collection of items with the default <br/> delimiter" do
|
55
|
-
helper.get_data_with_linked_label(@doc,"Items","field").should match(/<br\/>/)
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
end
|
@@ -1,116 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
-
|
3
|
-
describe Hydra::Controller::UploadBehavior do
|
4
|
-
|
5
|
-
it "should respond to datastream_id" do
|
6
|
-
helper.should respond_to :datastream_id ### API method, test that it's there to be overridden
|
7
|
-
end
|
8
|
-
|
9
|
-
describe "create_and_save_file_asset_from_params" do
|
10
|
-
it "should create the file asset, add posted blob to it and save the file asset" do
|
11
|
-
mock_fa = mock("file asset")
|
12
|
-
helper.stubs(:params).returns( { :Filedata => [mock_fa] } )
|
13
|
-
mock_fa.expects(:save)
|
14
|
-
helper.expects(:create_asset_from_file).returns(mock_fa)
|
15
|
-
helper.expects(:add_posted_blob_to_asset)
|
16
|
-
helper.create_and_save_file_assets_from_params
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
describe "add_posted_blob_to_asset" do
|
21
|
-
it "should set object title and label, relying on datastream_id to set dsId" do
|
22
|
-
mock_file = mock("File")
|
23
|
-
file_name = "Posted Filename.foo"
|
24
|
-
helper.stubs(:params).returns( :Filedata=>[mock_file], :Filename=>file_name, "container_id"=>"hydrangea:2973" )
|
25
|
-
mock_fa = mock("file asset")
|
26
|
-
mock_file.expects(:original_filename).returns(file_name)
|
27
|
-
helper.stubs(:datastream_id).returns('bar')
|
28
|
-
mock_fa.expects(:add_file_datastream).with(mock_file, :label=>file_name, :mimeType=>"mymimetype", :dsid=>'bar')
|
29
|
-
mock_fa.expects(:set_title_and_label).with( file_name, :only_if_blank=>true )
|
30
|
-
helper.expects(:mime_type).with(file_name).returns("mymimetype")
|
31
|
-
helper.add_posted_blob_to_asset(mock_fa,mock_file)
|
32
|
-
end
|
33
|
-
|
34
|
-
it "should support submissions from swfupload" do
|
35
|
-
mock_file = mock("File")
|
36
|
-
file_name = "Posted Filename.foo"
|
37
|
-
helper.stubs(:params).returns( :Filedata=>[mock_file], :Filename=>file_name, "container_id"=>"hydrangea:2973" )
|
38
|
-
mock_fa = mock("file asset")
|
39
|
-
mock_file.expects(:original_filename).returns(file_name)
|
40
|
-
mock_fa.expects(:add_file_datastream).with(mock_file, :label=>file_name, :mimeType=>"mymimetype", :dsid => 'content')
|
41
|
-
mock_fa.stubs(:set_title_and_label)
|
42
|
-
helper.expects(:mime_type).with(file_name).returns("mymimetype")
|
43
|
-
helper.add_posted_blob_to_asset(mock_fa,mock_file)
|
44
|
-
end
|
45
|
-
it "should support submissions from single-file uploader, defaulting to dsId of content" do
|
46
|
-
mock_file = mock("File")
|
47
|
-
file_name = "Posted Filename.foo"
|
48
|
-
# helper.expects(:filename_from_params).returns(file_name)
|
49
|
-
helper.stubs(:params).returns( :Filedata=>[mock_file], :container_id=>"hydrangea:2973" )
|
50
|
-
mock_file.expects(:original_filename).returns(file_name)
|
51
|
-
mock_fa = mock("file asset")
|
52
|
-
helper.expects(:mime_type).with(file_name).returns("mymimetype")
|
53
|
-
mock_fa.expects(:add_file_datastream).with(mock_file, :label=>file_name, :mimeType=>"mymimetype", :dsid => 'content')
|
54
|
-
mock_fa.stubs(:set_title_and_label)
|
55
|
-
helper.add_posted_blob_to_asset(mock_fa,mock_file)
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
describe "create_asset_from_params" do
|
60
|
-
it "should create a new file asset and set the label from params[:Filename]" do
|
61
|
-
helper.stubs(:params).returns( { :Filename => "Test Filename" } )
|
62
|
-
result = helper.create_asset_from_params
|
63
|
-
result.should be_kind_of FileAsset
|
64
|
-
result.label.should == "Test Filename"
|
65
|
-
end
|
66
|
-
it "should choose model by filename" do
|
67
|
-
pending "this is currently disabled"
|
68
|
-
helper.expects(:choose_model_by_filename)
|
69
|
-
helper.create_asset_from_params
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
describe "posted_file" do
|
74
|
-
it "should return the posted file" do
|
75
|
-
helper.expects(:params).returns(:Filedata=>"test posted file")
|
76
|
-
helper.posted_file.should == "test posted file"
|
77
|
-
end
|
78
|
-
it "should return nil if no file was posted" do
|
79
|
-
helper.posted_file.should == nil
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
describe "filename_from_params" do
|
84
|
-
it "should return the value of params[:Filename] if it was submitted" do
|
85
|
-
helper.stubs(:params).returns(:Filename => "Test Filename")
|
86
|
-
helper.filename_from_params.should == "Test Filename"
|
87
|
-
end
|
88
|
-
it "should default to using the original filename of the posted file" do
|
89
|
-
helper.stubs(:params).returns({})
|
90
|
-
helper.expects(:posted_file).returns(mock("File", :original_filename=>"Test Original Filename"))
|
91
|
-
helper.filename_from_params.should == "Test Original Filename"
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
describe "choose_model_by_filename" do
|
96
|
-
it "should return model classes based on filename extensions" do
|
97
|
-
pending "This can only be enabled if/when we adopt replacements for ImageAsset, AudioAsset, etc. as default primitives."
|
98
|
-
|
99
|
-
["filename.wav","filename.mp3","filename.aiff"].each do |fn|
|
100
|
-
helper.choose_model_by_filename(fn).should == AudioAsset
|
101
|
-
end
|
102
|
-
|
103
|
-
["filename.mov","filename.flv","filename.mp4", "filename.m4v"].each do |fn|
|
104
|
-
helper.choose_model_by_filename(fn).should == VideoAsset
|
105
|
-
end
|
106
|
-
|
107
|
-
["filename.jpeg","filename.jpg","filename.gif", "filename.png"].each do |fn|
|
108
|
-
helper.choose_model_by_filename(fn).should == ImageAsset
|
109
|
-
end
|
110
|
-
|
111
|
-
["filename.doc","filename.pdf","filename.jp2", "filename.zip"].each do |fn|
|
112
|
-
helper.choose_model_by_filename(fn).should == FileAsset
|
113
|
-
end
|
114
|
-
end
|
115
|
-
end
|
116
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
-
|
3
|
-
describe GenericContentObjectsHelper do
|
4
|
-
before :all do
|
5
|
-
@behavior = Hydra::GenericContentObjectsHelperBehavior.deprecation_behavior
|
6
|
-
Hydra::GenericContentObjectsHelperBehavior.deprecation_behavior = :silence
|
7
|
-
end
|
8
|
-
|
9
|
-
after :all do
|
10
|
-
Hydra::GenericContentObjectsHelperBehavior.deprecation_behavior = @behavior
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should have a url for a pid" do
|
14
|
-
helper.datastream_disseminator_url('hydra:123', 'sampleDs').should match /http:\/\/127.0.0.1:\d+\/fedora-test\/get\/hydra:123\/sampleDs/
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
@@ -1,54 +0,0 @@
|
|
1
|
-
require File.expand_path( File.join( File.dirname(__FILE__),'..','spec_helper') )
|
2
|
-
|
3
|
-
|
4
|
-
# See cucumber tests (ie. /features/edit_document.feature) for more tests, including ones that test the edit method & view
|
5
|
-
# You can run the cucumber tests with
|
6
|
-
#
|
7
|
-
# cucumber --tags @edit
|
8
|
-
# or
|
9
|
-
# rake cucumber
|
10
|
-
|
11
|
-
describe Hydra::Controller::RepositoryControllerBehavior do
|
12
|
-
|
13
|
-
describe "load_document_from_params" do
|
14
|
-
it "should choose which model to use based on submitted params" do
|
15
|
-
mock_model_class = mock("model class")
|
16
|
-
mock_model_class.expects(:find).with("object id")
|
17
|
-
helper.stubs(:params).returns( {:content_type => "preferred model", :id => "object id"} )
|
18
|
-
helper.expects(:retrieve_af_model).with("preferred model").returns(mock_model_class)
|
19
|
-
helper.load_document_from_params
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
describe "format_pid" do
|
24
|
-
it "convert pids into XHTML safe strings" do
|
25
|
-
pid = helper.format_pid("hydra:123")
|
26
|
-
pid.should match(/hydra_123/)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
describe "retrieve_af_model" do
|
31
|
-
it "should return a Model class if the named model has been defined" do
|
32
|
-
result = helper.retrieve_af_model("file_asset")
|
33
|
-
result.should == FileAsset
|
34
|
-
result.superclass.should == ActiveFedora::Base
|
35
|
-
result.included_modules.should include(ActiveFedora::Model)
|
36
|
-
end
|
37
|
-
|
38
|
-
it "should accept camel cased OR underscored model name" do
|
39
|
-
result = helper.retrieve_af_model("generic_content")
|
40
|
-
result.should == GenericContent
|
41
|
-
|
42
|
-
result = helper.retrieve_af_model("GenericContent")
|
43
|
-
result.should == GenericContent
|
44
|
-
|
45
|
-
end
|
46
|
-
|
47
|
-
it "should return false if the name is not a real class" do
|
48
|
-
result = helper.retrieve_af_model("foo_foo_class_class")
|
49
|
-
result.should be_false
|
50
|
-
end
|
51
|
-
|
52
|
-
end
|
53
|
-
|
54
|
-
end
|
@@ -1,143 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
-
|
3
|
-
describe HydraAssetsHelper do
|
4
|
-
before :all do
|
5
|
-
@behavior = Hydra::HydraAssetsHelperBehavior.deprecation_behavior
|
6
|
-
Hydra::HydraAssetsHelperBehavior.deprecation_behavior = :silence
|
7
|
-
end
|
8
|
-
|
9
|
-
after :all do
|
10
|
-
Hydra::HydraAssetsHelperBehavior.deprecation_behavior = @behavior
|
11
|
-
end
|
12
|
-
include HydraAssetsHelper
|
13
|
-
|
14
|
-
describe "link_to_create_asset" do
|
15
|
-
it "should generate login links with redirect params if user is not logged in" do
|
16
|
-
helper.expects(:current_user).returns User.new
|
17
|
-
helper.link_to_create_asset("Create a foo", "foo_model").should == "<a href=\"/hydra/assets/new?content_type=foo_model\" class=\"create_asset\">Create a foo</a>"
|
18
|
-
end
|
19
|
-
it "should generate login links with redirect params if user is not logged in" do
|
20
|
-
helper.expects(:current_user).returns false
|
21
|
-
# rails 3.1.x
|
22
|
-
# helper.link_to_create_asset("Create a foo", "foo_model").should == "<a href=\"/users/sign_in?redirect_params%5Baction%5D=new&redirect_params%5Bcontent_type%5D=foo_model&redirect_params%5Bcontroller%5D=assets\" class=\"create_asset\">Create a foo</a>"
|
23
|
-
# rails 3.0.x
|
24
|
-
helper.link_to_create_asset("Create a foo", "foo_model").should == "<a href=\"/users/sign_in?redirect_params%5Baction%5D=new&redirect_params%5Bcontent_type%5D=foo_model&redirect_params%5Bcontroller%5D=assets\" class=\"create_asset\">Create a foo</a>"
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
describe "delete_asset_link" do
|
29
|
-
it "should generate a delete link and confirmation dialog" do
|
30
|
-
generated_html = helper.delete_asset_link("__PID__", "whizbang")
|
31
|
-
# "a.delete_asset[href='/catalog/__PID__/delete']", :content=> "Delete this whizbang"
|
32
|
-
generated_html.should have_selector "a.delete_asset_link[href='/catalog/__PID__/delete']", :content=> "Delete this whizbang"
|
33
|
-
generated_html.should be_html_safe
|
34
|
-
# generated_html.should have_tag 'a.inline[href=#delete_dialog]', "Delete this whizbang"
|
35
|
-
# generated_html.should have_tag 'div#delete_dialog' do
|
36
|
-
# with_tag "p", "Do you want to permanently delete this article from the repository?"
|
37
|
-
# with_tag "form[action=?]", url_for(:action => "destroy", :controller => "assets", :id => "__PID__", :method => "delete") do
|
38
|
-
# with_tag "input[type=hidden][name=_method][value=delete]"
|
39
|
-
# with_tag "input[type=submit]"
|
40
|
-
# end
|
41
|
-
# end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
describe "get_person_from_role" do
|
46
|
-
before(:all) do
|
47
|
-
@single_person_doc = {"person_0_role_t" => ["creator"], "person_0_first_name_t" => "GIVEN NAME", "person_0_last_name_t" => "FAMILY NAME"}
|
48
|
-
@multiple_persons_doc = {"person_0_role_t" => ["contributor","owner"], "person_0_first_name_t" => "CONTRIBUTOR GIVEN NAME", "person_0_last_name_t" => "CONTRIBUTOR FAMILY NAME",
|
49
|
-
"person_1_role_t" => ["creator"], "person_1_first_name_t" => "CREATOR GIVEN NAME", "person_1_last_name_t" => "CREATOR FAMILY NAME"}
|
50
|
-
end
|
51
|
-
it "should return the appropriate when 1 is available" do
|
52
|
-
person = get_person_from_role(@single_person_doc,"creator")
|
53
|
-
person[:first].should == "GIVEN NAME" and
|
54
|
-
person[:last].should == "FAMILY NAME"
|
55
|
-
end
|
56
|
-
it "should return the appririate person when there is multiple users" do
|
57
|
-
person = get_person_from_role(@multiple_persons_doc,"creator")
|
58
|
-
person[:first].should == "CREATOR GIVEN NAME" and
|
59
|
-
person[:last].should == "CREATOR FAMILY NAME"
|
60
|
-
end
|
61
|
-
it "should return the appropriate person when they have multiple roles" do
|
62
|
-
person = get_person_from_role(@multiple_persons_doc,"owner")
|
63
|
-
person[:first].should == "CONTRIBUTOR GIVEN NAME" and
|
64
|
-
person[:last].should == "CONTRIBUTOR FAMILY NAME"
|
65
|
-
end
|
66
|
-
it "should return nil when there is no user for the given role" do
|
67
|
-
get_person_from_role(@multiple_persons_doc,"bad_role").should be_nil
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
describe "get_file_asset_count" do
|
72
|
-
describe "with outbound has_part" do
|
73
|
-
before do
|
74
|
-
@asset_object4 =ModsAsset.new
|
75
|
-
@file_object1 = ModsAsset.create
|
76
|
-
@asset_object4.add_relationship(:has_part,@file_object1)
|
77
|
-
@asset_object4.save
|
78
|
-
end
|
79
|
-
after do
|
80
|
-
@asset_object4.delete
|
81
|
-
@file_object1.delete
|
82
|
-
end
|
83
|
-
it "should find one" do
|
84
|
-
#outbound has_part
|
85
|
-
doc = ModsAsset.find_by_solr(@asset_object4.pid).first
|
86
|
-
get_file_asset_count(doc).should == 1
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
describe "with has_part and inbound is_part_of" do
|
91
|
-
before do
|
92
|
-
@asset_object5 =ModsAsset.create
|
93
|
-
@file_object1 = FileAsset.create
|
94
|
-
@file_object2 = FileAsset.create
|
95
|
-
@file_object2.container = @asset_object5
|
96
|
-
@asset_object5.add_relationship(:has_part,@file_object1)
|
97
|
-
@asset_object5.save
|
98
|
-
@file_object2.save
|
99
|
-
end
|
100
|
-
after do
|
101
|
-
@asset_object5.delete
|
102
|
-
@file_object1.delete
|
103
|
-
@file_object2.delete
|
104
|
-
end
|
105
|
-
it "should find two" do
|
106
|
-
doc = ActiveFedora::Base.find_by_solr(@asset_object5.pid).first
|
107
|
-
get_file_asset_count(doc).should == 2
|
108
|
-
end
|
109
|
-
end
|
110
|
-
|
111
|
-
describe "with inbound is_part_of" do
|
112
|
-
before do
|
113
|
-
@asset_object6 =ModsAsset.create
|
114
|
-
@file_object1 = FileAsset.create
|
115
|
-
@file_object1.container = @asset_object6
|
116
|
-
@asset_object6.save
|
117
|
-
@file_object1.save
|
118
|
-
end
|
119
|
-
after do
|
120
|
-
@asset_object6.delete
|
121
|
-
@file_object1.delete
|
122
|
-
end
|
123
|
-
it "should find one" do
|
124
|
-
doc = ActiveFedora::Base.find_by_solr(@asset_object6.pid).first
|
125
|
-
get_file_asset_count(doc).should == 1
|
126
|
-
end
|
127
|
-
end
|
128
|
-
|
129
|
-
describe "with inbound is_part_of" do
|
130
|
-
before do
|
131
|
-
@asset_object7 =ModsAsset.create
|
132
|
-
end
|
133
|
-
after do
|
134
|
-
@asset_object7.delete
|
135
|
-
end
|
136
|
-
it "should find zero" do
|
137
|
-
doc = ActiveFedora::Base.find_by_solr(@asset_object7.pid).first
|
138
|
-
get_file_asset_count(doc).should == 0
|
139
|
-
end
|
140
|
-
end
|
141
|
-
end
|
142
|
-
|
143
|
-
end
|