hydra-head 3.0.0pre3 → 3.0.0pre4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitmodules +0 -3
- data/.rvmrc +6 -0
- data/BLACKLIGHT_CONFIG.textile +76 -0
- data/CREATE_RAILS_APP.textile +323 -0
- data/DEVELOP_PLUGIN.textile +90 -0
- data/GIT_WORKFLOW.textile +84 -0
- data/Gemfile.lock +82 -66
- data/HISTORY.textile +7 -0
- data/HOW_DO_I.textile +107 -0
- data/HOW_TO_DEFINE_A_HYDRA_CONTROLLER.textile +21 -0
- data/HOW_TO_DEFINE_A_HYDRA_MODEL.textile +64 -0
- data/HOW_TO_GET_STARTED.textile +100 -76
- data/INITIAL_APP_MODS.textile +60 -76
- data/INSTALL_PREREQ.textile +19 -0
- data/LICENSE +14 -0
- data/README.textile +89 -17
- data/README_RAKE_TASKS.textile +107 -0
- data/README_SUBTREE.textile +87 -0
- data/README_TERSE.textile +92 -0
- data/TESTING_PLUGIN.textile +134 -0
- data/app/controllers/assets_controller.rb +34 -4
- data/app/controllers/contributors_controller.rb +49 -1
- data/app/controllers/downloads_controller.rb +36 -0
- data/app/controllers/file_assets_controller.rb +43 -21
- data/app/controllers/generic_content_objects_controller.rb +38 -0
- data/app/controllers/get_controller.rb +39 -0
- data/app/controllers/permissions_controller.rb +33 -4
- data/app/controllers/user_sessions_controller.rb +0 -1
- data/app/helpers/application_helper.rb +183 -0
- data/app/helpers/blacklight_helper.rb +13 -8
- data/app/helpers/hydra_assets_helper.rb +6 -15
- data/app/helpers/hydra_fedora_metadata_helper.rb +51 -67
- data/app/helpers/hydra_helper.rb +35 -11
- data/app/helpers/javascript_includes_helper.rb +2 -4
- data/app/helpers/personalization_helper.rb +44 -0
- data/app/models/generic_content.rb +6 -3
- data/app/models/generic_image.rb +3 -1
- data/app/models/mods_asset.rb +12 -1
- data/app/models/user_attribute.rb +25 -0
- data/app/models/uses_default_partials.rb +14 -0
- data/app/views/_add_assets_links.html.erb +1 -0
- data/app/views/catalog/_edit_partials/_default.html.erb +5 -5
- data/app/views/catalog/_home_text.html.erb +2 -2
- data/app/views/catalog/_index_partials/_default_details.html.erb +10 -7
- data/app/views/catalog/_opensearch_response_metadata.html.erb +2 -0
- data/app/views/catalog/_search_form.html.erb +1 -1
- data/app/views/catalog/_show_partials/_default.html.erb +4 -2
- data/app/views/catalog/_show_partials/_default_details.html.erb +10 -7
- data/app/views/catalog/show.html.erb +20 -28
- data/app/views/contributors/_edit_person.html.erb +26 -29
- data/app/views/contributors/_index.html.erb +6 -7
- data/app/views/contributors/_show_conference.html.erb +5 -15
- data/app/views/contributors/_show_organization.html.erb +8 -16
- data/app/views/file_assets/_file_assets_form.html.erb +11 -0
- data/app/views/file_assets/_index.html.erb +21 -6
- data/app/views/file_assets/_new.html.erb +6 -2
- data/app/views/file_assets/_result.html.erb +2 -2
- data/app/views/fluid_infusion/_uploader.html.erb +4 -5
- data/app/views/generic_content_objects/_contributor_form.html.erb +11 -0
- data/app/views/generic_content_objects/_description_form.html.erb +7 -0
- data/app/views/generic_content_objects/_edit_description.html.erb +14 -41
- data/app/views/generic_content_objects/_show_description.html.erb +38 -63
- data/app/views/generic_contents/_edit.html.erb +1 -45
- data/app/views/generic_contents/_edit.html.erb_ +39 -0
- data/app/views/generic_contents/_index.html.erb +1 -3
- data/app/views/generic_contents/_show.html.erb +4 -14
- data/app/views/generic_contents/_show_content.html.erb +7 -4
- data/app/views/generic_images/_edit.html.erb +26 -32
- data/app/views/generic_images/_show.html.erb +7 -10
- data/app/views/generic_images/_show_all.html.erb +1 -1
- data/app/views/generic_images/_show_content.html.erb +7 -7
- data/app/views/layouts/application.html.erb +33 -41
- data/app/views/layouts/hydra-head.html.erb +52 -7
- data/app/views/mods_assets/_additional_info_form.html.erb +44 -0
- data/app/views/mods_assets/_contributor_form.html.erb +14 -0
- data/app/views/mods_assets/_edit.html.erb +8 -32
- data/app/views/mods_assets/_edit.html.erb_ +63 -0
- data/app/views/mods_assets/_edit_description.html.erb +52 -61
- data/app/views/mods_assets/_edit_journal.html.erb +49 -64
- data/app/views/mods_assets/_publication_form.html.erb +13 -0
- data/app/views/mods_assets/_show.html.erb +18 -23
- data/app/views/mods_assets/_show_additional_info.html.erb +17 -0
- data/app/views/mods_assets/_show_contributors.html.erb +7 -0
- data/app/views/mods_assets/_show_description.html.erb +3 -13
- data/app/views/mods_assets/_show_file_assets.html.erb +22 -0
- data/app/views/mods_assets/_show_journal.html.erb +3 -3
- data/app/views/mods_assets/_show_permissions.html.erb +1 -0
- data/app/views/mods_assets/_show_publication.html.erb +8 -0
- data/app/views/permissions/_edit_person_permissions.html.erb +4 -9
- data/app/views/permissions/_index.html.erb +9 -18
- data/app/views/permissions/_new.html.erb +13 -17
- data/app/views/permissions/_permissions_form.html.erb +24 -0
- data/app/views/user_sessions/_login_form.html.erb +1 -1
- data/assets/images/hydra/powered_by_hydra.png +0 -0
- data/assets/images/hydra/search-button.png +0 -0
- data/assets/javascripts/date-picker/booking/index.html +368 -0
- data/assets/javascripts/date-picker/calendarHTML.txt +84 -0
- data/assets/javascripts/date-picker/css/datepicker.css +511 -0
- data/assets/javascripts/date-picker/css/demo.css +229 -0
- data/assets/javascripts/date-picker/index.html +798 -0
- data/assets/javascripts/date-picker/js/datepicker.js +2898 -0
- data/assets/javascripts/date-picker/js/datepicker.packed.js +1 -0
- data/assets/javascripts/date-picker/js/lang/ar.js +9 -0
- data/assets/javascripts/date-picker/js/lang/cs.js +9 -0
- data/assets/javascripts/date-picker/js/lang/da.js +10 -0
- data/assets/javascripts/date-picker/js/lang/de.js +10 -0
- data/assets/javascripts/date-picker/js/lang/en.js +9 -0
- data/assets/javascripts/date-picker/js/lang/eo.js +13 -0
- data/assets/javascripts/date-picker/js/lang/es.js +9 -0
- data/assets/javascripts/date-picker/js/lang/et.js +23 -0
- data/assets/javascripts/date-picker/js/lang/fi.js +7 -0
- data/assets/javascripts/date-picker/js/lang/fr.js +69 -0
- data/assets/javascripts/date-picker/js/lang/he.js +9 -0
- data/assets/javascripts/date-picker/js/lang/hu.js +9 -0
- data/assets/javascripts/date-picker/js/lang/id.js +9 -0
- data/assets/javascripts/date-picker/js/lang/it.js +11 -0
- data/assets/javascripts/date-picker/js/lang/kr.js +9 -0
- data/assets/javascripts/date-picker/js/lang/lt.js +8 -0
- data/assets/javascripts/date-picker/js/lang/lv.js +9 -0
- data/assets/javascripts/date-picker/js/lang/nl.js +9 -0
- data/assets/javascripts/date-picker/js/lang/no.js +9 -0
- data/assets/javascripts/date-picker/js/lang/pl.js +10 -0
- data/assets/javascripts/date-picker/js/lang/pt-br.js +11 -0
- data/assets/javascripts/date-picker/js/lang/pt.js +9 -0
- data/assets/javascripts/date-picker/js/lang/ru.js +11 -0
- data/assets/javascripts/date-picker/js/lang/se.js +9 -0
- data/assets/javascripts/date-picker/js/lang/si.js +9 -0
- data/assets/javascripts/date-picker/js/lang/tr.js +9 -0
- data/assets/javascripts/date-picker/language/index.html +240 -0
- data/assets/javascripts/date-picker/media/Thumbs.db +0 -0
- data/assets/javascripts/date-picker/media/backstripes.gif +0 -0
- data/assets/javascripts/date-picker/media/bg_header.jpg +0 -0
- data/assets/javascripts/date-picker/media/bullet1.gif +0 -0
- data/assets/javascripts/date-picker/media/bullet2.gif +0 -0
- data/assets/javascripts/date-picker/media/cal-grey.gif +0 -0
- data/assets/javascripts/date-picker/media/cal.gif +0 -0
- data/assets/javascripts/date-picker/media/gradient-e5e5e5-ffffff.gif +0 -0
- data/assets/javascripts/hydra/hydra-head.js +195 -0
- data/assets/javascripts/hydra/mediashelf.datepicker.js +39 -0
- data/assets/javascripts/hydra/mediashelf.placeholder.js +67 -0
- data/assets/javascripts/jquery.form.js +675 -0
- data/assets/javascripts/jquery.ui.datepicker.js +1793 -0
- data/assets/javascripts/spin.min.js +2 -0
- data/assets/stylesheets/hydra/html_refactor.css +115 -0
- data/assets/stylesheets/hydra/hydrangea-split-button.css +18 -0
- data/assets/stylesheets/hydra/hydrangea.css +292 -0
- data/assets/stylesheets/hydra/ie-styles.css +240 -0
- data/assets/stylesheets/hydra/styles.css +2224 -0
- data/assets/stylesheets/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/assets/stylesheets/redmond/images/ui-bg_flat_55_fbec88_40x100.png +0 -0
- data/assets/stylesheets/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
- data/assets/stylesheets/redmond/images/ui-bg_glass_85_dfeffc_1x400.png +0 -0
- data/assets/stylesheets/redmond/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/assets/stylesheets/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
- data/assets/stylesheets/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
- data/assets/stylesheets/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
- data/assets/stylesheets/redmond/images/ui-icons_217bc0_256x240.png +0 -0
- data/assets/stylesheets/redmond/images/ui-icons_2e83ff_256x240.png +0 -0
- data/assets/stylesheets/redmond/images/ui-icons_469bdd_256x240.png +0 -0
- data/assets/stylesheets/redmond/images/ui-icons_6da8d5_256x240.png +0 -0
- data/assets/stylesheets/redmond/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/assets/stylesheets/redmond/images/ui-icons_d8e7f3_256x240.png +0 -0
- data/assets/stylesheets/redmond/images/ui-icons_f9bd01_256x240.png +0 -0
- data/assets/stylesheets/redmond/jquery-ui-1.8.5.custom.css +572 -0
- data/config/fedora.yml +17 -0
- data/config/role_map_cucumber.yml +10 -0
- data/config/role_map_development.yml +12 -0
- data/config/role_map_production.yml +2 -0
- data/config/role_map_test.yml +14 -0
- data/config/solr.yml +10 -0
- data/config/solr_mappings.yml +22 -0
- data/db/migrate/20101105214243_add_user_attributes_table.rb +15 -0
- data/db/migrate/20101108192527_create_superusers.rb +12 -0
- data/fedora/conf/fedora.fcfg +1021 -0
- data/hydra-head.gemspec +7 -4
- data/init.rb +4 -0
- data/install.rb +1 -0
- data/lib/blacklight/catalog_helper.rb +44 -0
- data/lib/blacklight.rb +40 -0
- data/lib/block_mapper.rb +52 -0
- data/lib/djatoka.rb +59 -0
- data/lib/ead_mapper.rb +7 -0
- data/lib/field_maps.rb +507 -0
- data/lib/generators/hydra/assets_generator.rb +51 -0
- data/lib/generators/hydra/head_generator.rb +23 -4
- data/lib/generators/hydra/templates/config/initializers/blacklight_config.rb +2 -2
- data/lib/generators/hydra/templates/config/initializers/hydra_config.rb +26 -0
- data/lib/hydra/access_controls_enforcement.rb +3 -2
- data/lib/hydra/assets_controller_helper.rb +6 -0
- data/lib/hydra/catalog.rb +7 -3
- data/lib/hydra/controller.rb +27 -0
- data/lib/hydra/file_assets_helper.rb +25 -8
- data/lib/hydra/generic_user_attributes.rb +34 -0
- data/lib/hydra/model_methods.rb +4 -2
- data/lib/hydra/mods_article.rb +5 -2
- data/lib/hydra/submission_workflow.rb +137 -0
- data/lib/hydra-head/controller.rb +30 -0
- data/lib/hydra-head/engine.rb +22 -1
- data/lib/hydra-head/routes.rb +14 -3
- data/lib/hydra-head/version.rb +1 -1
- data/lib/hydra-head.rb +3 -3
- data/lib/hydra.rb +1 -1
- data/lib/jetty_cleaner.rb +27 -0
- data/lib/marc_mapper.rb +131 -0
- data/lib/marc_record_ext.rb +97 -0
- data/lib/mediashelf/active_fedora_helper.rb +7 -1
- data/lib/prev_next_links.rb +22 -0
- data/lib/railties/hydra-fixtures.rake +6 -1
- data/lib/railties/hyhead_cucumber.rake +1 -2
- data/lib/railties/hyhead_rspec.rake +7 -7
- data/lib/stanford_blacklight_extensions.rb +6 -0
- data/lib/user_attributes_loader.rb +17 -0
- data/solr/conf/schema.xml +116 -0
- data/solr/conf/solrconfig.xml +311 -0
- data/solr/solr.xml +35 -0
- data/spec/controllers/catalog_valid_html_spec.rb +128 -0
- data/spec-rails2/helpers/hydra_fedora_metadata_helper_spec.rb +219 -0
- data/spec-rails2/spec_helper.rb +88 -0
- data/tasks/hydra-head.rake +2 -4
- data/test_support/etc/Gemfile +6 -5
- data/test_support/features/absent_model_edit.feature +27 -0
- data/test_support/features/absent_model_search_result.feature +24 -0
- data/test_support/features/absent_model_show.feature +27 -0
- data/test_support/features/button_add_assets.feature +2 -2
- data/test_support/features/contributor_add.feature +21 -16
- data/test_support/features/default_partials_edit.feature +27 -0
- data/test_support/features/default_partials_search_result.feature +22 -0
- data/test_support/features/default_partials_show.feature +24 -0
- data/test_support/features/file_upload.feature +55 -22
- data/test_support/features/generic_content_create.feature +7 -0
- data/test_support/features/generic_content_edit.feature +21 -0
- data/test_support/features/generic_content_search_result.feature +22 -0
- data/test_support/features/generic_content_show.feature +20 -0
- data/test_support/features/generic_image_create.feature +7 -0
- data/test_support/features/generic_image_edit.feature +21 -0
- data/test_support/features/generic_image_search_result.feature +22 -0
- data/test_support/features/generic_image_show.feature +20 -0
- data/test_support/features/html_validity.feature +43 -0
- data/test_support/features/mods_asset_contributors_edit.feature +27 -19
- data/test_support/features/mods_asset_create.feature +13 -8
- data/test_support/features/mods_asset_edit.feature +48 -16
- data/test_support/features/mods_asset_edit_without_permission.feature +6 -1
- data/test_support/features/mods_asset_search_result.feature +15 -15
- data/test_support/features/mods_asset_show.feature +56 -5
- data/test_support/features/permissions_add.feature +5 -4
- data/test_support/features/permissions_edit.feature +9 -7
- data/test_support/features/step_definitions/html_validity_steps.rb +57 -0
- data/test_support/features/step_definitions/show_document_steps.rb +1 -1
- data/test_support/features/step_definitions/user_steps.rb +4 -4
- data/test_support/features/support/paths.rb +4 -1
- data/test_support/fixtures/hydra_test_default_partials.foxml.xml +80 -0
- data/test_support/fixtures/hydra_test_generic_content.foxml.xml +138 -0
- data/test_support/fixtures/hydra_test_generic_image.foxml.xml +395 -0
- data/test_support/fixtures/hydra_test_no_model.foxml.xml +79 -0
- data/test_support/fixtures/hydrus_admin_class1.foxml.xml +176 -0
- data/test_support/fixtures/libra-oa_7.foxml.xml +1735 -0
- data/test_support/spec/controllers/assets_controller_spec.rb +5 -4
- data/test_support/spec/controllers/catalog_controller_spec.rb +2 -2
- data/test_support/spec/controllers/file_assets_controller_spec.rb +16 -10
- data/test_support/spec/controllers/hydra_controller_spec.rb +2 -0
- data/test_support/spec/controllers/permissions_controller_spec.rb +1 -1
- data/test_support/spec/helpers/access_controls_enforcement_spec.rb +20 -219
- data/test_support/spec/helpers/blacklight_helper_spec.rb +3 -1
- data/test_support/spec/helpers/file_assets_helper_spec.rb +13 -10
- data/test_support/spec/helpers/hydra_assets_helper_spec.rb +5 -1
- data/test_support/spec/helpers/hydra_djatoka_helper_spec.rb +3 -1
- data/test_support/spec/helpers/hydra_fedora_metadata_helper_spec.rb +102 -69
- data/test_support/spec/helpers/hydra_helper_spec.rb +15 -0
- data/test_support/spec/lib/hydra_submission_workflow_spec.rb +141 -0
- data/test_support/spec/models/generic_image_spec.rb +6 -1
- data/uninstall.rb +1 -0
- data/vendor/cache/actionmailer-3.0.10.gem +0 -0
- data/vendor/cache/actionpack-3.0.10.gem +0 -0
- data/vendor/cache/activemodel-3.0.10.gem +0 -0
- data/vendor/cache/activerecord-3.0.10.gem +0 -0
- data/vendor/cache/activeresource-3.0.10.gem +0 -0
- data/vendor/cache/activesupport-3.0.10.gem +0 -0
- data/vendor/cache/capybara-1.1.1.gem +0 -0
- data/vendor/cache/childprocess-0.2.2.gem +0 -0
- data/vendor/cache/crack-0.3.1.gem +0 -0
- data/vendor/cache/cucumber-1.1.0.gem +0 -0
- data/vendor/cache/cucumber-rails-1.1.1.gem +0 -0
- data/vendor/cache/diff-lcs-1.1.3.gem +0 -0
- data/vendor/cache/equivalent-xml-0.2.8.gem +0 -0
- data/vendor/cache/factory_girl-2.1.2.gem +0 -0
- data/vendor/cache/gherkin-2.5.2.gem +0 -0
- data/vendor/cache/haml-3.1.3.gem +0 -0
- data/vendor/cache/httparty-0.8.1.gem +0 -0
- data/vendor/cache/json-1.6.1.gem +0 -0
- data/vendor/cache/json_pure-1.6.1.gem +0 -0
- data/vendor/cache/launchy-2.0.5.gem +0 -0
- data/vendor/cache/mediashelf-loggable-0.4.7.gem +0 -0
- data/vendor/cache/metaclass-0.0.1.gem +0 -0
- data/vendor/cache/mocha-0.10.0.gem +0 -0
- data/vendor/cache/multi_json-1.0.3.gem +0 -0
- data/vendor/cache/multi_xml-0.4.1.gem +0 -0
- data/vendor/cache/om-1.4.2.gem +0 -0
- data/vendor/cache/polyglot-0.3.2.gem +0 -0
- data/vendor/cache/rack-1.2.4.gem +0 -0
- data/vendor/cache/{rails-3.0.9.gem → rails-3.0.10.gem} +0 -0
- data/vendor/cache/railties-3.0.10.gem +0 -0
- data/vendor/cache/rcov-0.9.11.gem +0 -0
- data/vendor/cache/rdoc-3.10.gem +0 -0
- data/vendor/cache/rest-client-1.6.7.gem +0 -0
- data/vendor/cache/selenium-webdriver-2.8.0.gem +0 -0
- data/vendor/cache/solrizer-1.1.2.gem +0 -0
- data/vendor/cache/solrizer-fedora-1.1.2.gem +0 -0
- data/vendor/cache/sqlite3-1.3.4.gem +0 -0
- data/vendor/cache/term-ansicolor-1.0.7.gem +0 -0
- data/vendor/cache/treetop-1.4.10.gem +0 -0
- data/vendor/cache/tzinfo-0.3.30.gem +0 -0
- data/vendor/cache/will_paginate-3.0.2.gem +0 -0
- data/vendor/cache/xml-simple-1.1.1.gem +0 -0
- metadata +351 -121
- data/lib/engine.rb +0 -30
- data/test_support/features/file_assets_list.feature +0 -32
- data/vendor/cache/actionmailer-3.0.9.gem +0 -0
- data/vendor/cache/actionpack-3.0.9.gem +0 -0
- data/vendor/cache/activemodel-3.0.9.gem +0 -0
- data/vendor/cache/activerecord-3.0.9.gem +0 -0
- data/vendor/cache/activeresource-3.0.9.gem +0 -0
- data/vendor/cache/activesupport-3.0.9.gem +0 -0
- data/vendor/cache/capybara-1.0.0.gem +0 -0
- data/vendor/cache/childprocess-0.2.0.gem +0 -0
- data/vendor/cache/crack-0.1.8.gem +0 -0
- data/vendor/cache/cucumber-1.0.2.gem +0 -0
- data/vendor/cache/cucumber-rails-1.0.2.gem +0 -0
- data/vendor/cache/diff-lcs-1.1.2.gem +0 -0
- data/vendor/cache/equivalent-xml-0.2.7.gem +0 -0
- data/vendor/cache/factory_girl-1.3.3.gem +0 -0
- data/vendor/cache/gherkin-2.4.5.gem +0 -0
- data/vendor/cache/haml-3.1.2.gem +0 -0
- data/vendor/cache/httparty-0.7.8.gem +0 -0
- data/vendor/cache/json-1.5.3.gem +0 -0
- data/vendor/cache/json_pure-1.5.3.gem +0 -0
- data/vendor/cache/launchy-2.0.4.gem +0 -0
- data/vendor/cache/mediashelf-loggable-0.4.3.gem +0 -0
- data/vendor/cache/mocha-0.9.12.gem +0 -0
- data/vendor/cache/om-1.2.5.gem +0 -0
- data/vendor/cache/polyglot-0.3.1.gem +0 -0
- data/vendor/cache/rack-1.2.3.gem +0 -0
- data/vendor/cache/railties-3.0.9.gem +0 -0
- data/vendor/cache/rcov-0.9.9.gem +0 -0
- data/vendor/cache/rdoc-3.8.gem +0 -0
- data/vendor/cache/selenium-webdriver-0.2.2.gem +0 -0
- data/vendor/cache/solrizer-1.1.0.gem +0 -0
- data/vendor/cache/solrizer-fedora-1.1.0.gem +0 -0
- data/vendor/cache/term-ansicolor-1.0.5.gem +0 -0
- data/vendor/cache/treetop-1.4.9.gem +0 -0
- data/vendor/cache/tzinfo-0.3.29.gem +0 -0
- data/vendor/cache/will_paginate-2.3.15.gem +0 -0
- data/vendor/cache/xml-simple-1.1.0.gem +0 -0
@@ -23,95 +23,116 @@ describe HydraFedoraMetadataHelper do
|
|
23
23
|
describe "fedora_text_field" do
|
24
24
|
it "should generate a text field input with values from the given datastream" do
|
25
25
|
generated_html = helper.fedora_text_field(@resource,"ng_ds",[:title, :main_title])
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
26
|
+
# For Rails3:
|
27
|
+
# generated_html.should have_selector "input.fieldselector" do |tag|
|
28
|
+
# tag.should have_selector "[value=?]", "title"
|
29
|
+
# tag.should have_selector "[value=?]", "main_title"
|
30
|
+
# end
|
31
|
+
# generated_html.should have_selector "input#title_main_title_0.editable-edit.edit" do |tag|
|
32
|
+
# tag.should have_selector "[value=?]", "My Title"
|
33
|
+
# tag.should have_selector "[name=?]","asset[ng_ds][title_main_title][0]"
|
34
|
+
# tag.should have_selector "[data-datastream-name=?]", "ng_ds"
|
35
|
+
generated_html.should have_selector "input.fieldselector" do |input|
|
36
|
+
with_tag "[value=?]", "title"
|
37
|
+
with_tag "[value=?]", "main_title"
|
38
|
+
end
|
39
|
+
generated_html.should have_selector "input#title_main_title_0.editable-edit.edit" do
|
40
|
+
input.should have_selector "[value=?]", "My Title"
|
41
|
+
input.should have_selector "[name=?]","asset[ng_ds][title_main_title][0]"
|
42
|
+
input.should have_selector "[data-datastream-name=?]", "ng_ds"
|
34
43
|
end
|
35
44
|
end
|
36
45
|
it "should generate an ordered list of text field inputs" do
|
37
46
|
generated_html = helper.fedora_text_field(@resource,"simple_ds","subject")
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
47
|
+
# For Rails3
|
48
|
+
# generated_html.should have_selector "input#subject_0.editable-edit.edit" do |tag|
|
49
|
+
# tag.should have_selector "[value=?]", "topic1"
|
50
|
+
# tag.should have_selector "[name=?]", "asset[simple_ds][subject][0]"
|
51
|
+
# end
|
52
|
+
# generated_html.should have_selector "input#subject_1.editable-edit.edit" do |tag|
|
53
|
+
# tag.should have_selector "[value=?]", "topic2"
|
54
|
+
# tag.should have_selector "[name=?]", "asset[simple_ds][subject][1]"
|
55
|
+
# end
|
56
|
+
# generated_html.should have_selector "a.destructive.field"
|
57
|
+
# generated_html.should have_selector "input", :class=>"editable-edit", :id=>"subject_1", :name=>"asset[simple_ds][subject_1]", :value=>"topic9"
|
58
|
+
# generated_html.should be_html_safe
|
59
|
+
# end
|
60
|
+
# it "should render an empty control if the field has no values" do
|
61
|
+
# helper.fedora_text_field(@resource,"empty_ds","something").should have_selector "#something_0.editable-edit.edit", :value=>''
|
62
|
+
# end
|
63
|
+
# it "should limit to single-value output with no ordered list if :multiple=>false" do
|
64
|
+
# generated_html = helper.fedora_text_field(@resource,"simple_ds","subject", :multiple=>false)
|
65
|
+
# generated_html.should have_selector "input#subject.editable-edit.edit[value=topic1]" do |tag|
|
66
|
+
# tag.should have_selector "[name=?]", "asset[simple_ds][subject][0]"
|
67
|
+
# end
|
68
|
+
generated_html.should have_selector "input#subject_0.editable-edit.edit" do |input|
|
69
|
+
input.should have_selector "[value=?]", "topic1"
|
70
|
+
input.should have_selector "[name=?]", "asset[simple_ds][subject][0]"
|
71
|
+
end
|
72
|
+
generated_html.should have_selector "input#subject_1.editable-edit.edit" do |input|
|
73
|
+
input.should have_selector "[value=?]", "topic2"
|
74
|
+
input.should have_selector "[name=?]", "asset[simple_ds][subject][1]"
|
55
75
|
end
|
76
|
+
generated_html.should have_selector "a.destructive.field"
|
56
77
|
generated_html.should have_selector "input", :class=>"editable-edit", :id=>"subject_1", :name=>"asset[simple_ds][subject_1]", :value=>"topic9"
|
57
|
-
generated_html.should be_html_safe
|
58
78
|
end
|
59
79
|
it "should render an empty control if the field has no values" do
|
60
|
-
helper.fedora_text_field(@resource,"empty_ds","something").should have_selector "
|
61
|
-
tag.should have_selector "#something_0-text.editable-text.text", ""
|
62
|
-
end
|
80
|
+
helper.fedora_text_field(@resource,"empty_ds","something").should have_selector "#something_0.editable-edit.edit", :value => ""
|
63
81
|
end
|
64
82
|
it "should limit to single-value output with no ordered list if :multiple=>false" do
|
65
|
-
generated_html = helper.fedora_text_field(@resource,"simple_ds","subject", :multiple=>false)
|
66
|
-
generated_html.
|
67
|
-
|
68
|
-
|
69
|
-
generated_html.should have_selector "span#subject-container.editable-container.field" do |tag|
|
70
|
-
tag.should have_selector "span#subject-text.editable-text.text", "topic1"
|
71
|
-
tag.should have_selector "input#subject.editable-edit.edit[value=topic1]" do |tag|
|
72
|
-
tag.should have_selector "[name=?]", "asset[simple_ds][subject][0]"
|
73
|
-
end
|
74
|
-
end
|
83
|
+
generated_html = helper.fedora_text_field(@resource,"simple_ds","subject", :multiple=>false)
|
84
|
+
generated_html.should have_selector "input#subject.editable-edit.edit[value=topic1]" do |input|
|
85
|
+
input.should have_selector "[name=?]", "asset[simple_ds][subject][0]"
|
86
|
+
end
|
75
87
|
end
|
76
88
|
end
|
77
89
|
|
78
90
|
describe "fedora_text_area" do
|
79
91
|
it "should generate an ordered list of textile-enabled text area with values from the given datastream" do
|
80
|
-
helper.fedora_text_area(@resource,"simple_ds","subject")
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
92
|
+
generated_html = helper.fedora_text_area(@resource,"simple_ds","subject")
|
93
|
+
# Rails3:
|
94
|
+
# generated_html.should have_selector "textarea#subject_0.editable-edit.edit", :value=>"topic1"
|
95
|
+
# generated_html.should have_selector "textarea#subject_1.editable-edit.edit", :value=>"topic2"
|
96
|
+
# generated_html.should have_selector "a.destructive.field"
|
97
|
+
# end
|
98
|
+
# it "should render an empty control if the field has no values" do
|
99
|
+
# helper.fedora_text_area(@resource,"empty_ds","something").should have_selector "li#something_0-container.field" do |tag|
|
100
|
+
# tag.should have_selector "span#something_0-text.editable-text.text[style=display:none;]", ""
|
101
|
+
# tag.should have_selector "textarea#something_0.editable-edit.edit", ""
|
102
|
+
# end
|
103
|
+
# end
|
104
|
+
# it "should limit to single-value output if :multiple=>false" do
|
105
|
+
# generated_html = helper.fedora_text_area(@resource,"simple_ds","subject", :multiple=>false)
|
106
|
+
# generated_html.should_not have_selector "ol"
|
107
|
+
# generated_html.should_not have_selector "li"
|
108
|
+
# generated_html.should have_selector "span#subject-container.field" do |tag|
|
109
|
+
# tag.should have_selector "span#subject-text.editable-text.text[style=display:none;]", "topic1"
|
110
|
+
# tag.should have_selector "textarea#subject.editable-edit.edit", "topic1"
|
111
|
+
# end
|
112
|
+
# generated_html.should be_html_safe
|
113
|
+
generated_html.should have_selector "textarea#subject_0.editable-edit.edit", :value => "topic1"
|
114
|
+
generated_html.should have_selector "textarea#subject_1.editable-edit.edit", :value => "topic2"
|
115
|
+
generated_html.should have_selector "a.destructive.field"
|
91
116
|
end
|
92
117
|
it "should render an empty control if the field has no values" do
|
93
|
-
helper.fedora_text_area(@resource,"empty_ds","something").should have_selector "
|
94
|
-
tag.should have_selector "span#something_0-text.editable-text.text[style=display:none;]", ""
|
95
|
-
tag.should have_selector "textarea#something_0.editable-edit.edit", ""
|
96
|
-
end
|
118
|
+
helper.fedora_text_area(@resource,"empty_ds","something").should have_selector "textarea#something_0.editable-edit.edit", :value => ""
|
97
119
|
end
|
98
120
|
it "should limit to single-value output if :multiple=>false" do
|
99
121
|
generated_html = helper.fedora_text_area(@resource,"simple_ds","subject", :multiple=>false)
|
100
|
-
generated_html.
|
101
|
-
generated_html.should_not have_selector "li"
|
102
|
-
generated_html.should have_selector "span#subject-container.field" do |tag|
|
103
|
-
tag.should have_selector "span#subject-text.editable-text.text[style=display:none;]", "topic1"
|
104
|
-
tag.should have_selector "textarea#subject.editable-edit.edit", "topic1"
|
105
|
-
end
|
106
|
-
generated_html.should be_html_safe
|
122
|
+
generated_html.should have_selector "textarea#subject.editable-edit.edit", :value => "topic1"
|
107
123
|
end
|
108
124
|
end
|
109
125
|
|
110
126
|
describe "fedora_select" do
|
111
127
|
it "should generate a select with values from the given datastream" do
|
112
128
|
generated_html = helper.fedora_select(@resource,"simple_ds","subject", :choices=>["topic1","topic2", "topic3"])
|
129
|
+
# Rails3:
|
130
|
+
# generated_html.should have_selector "select.metadata-dd[name='asset[simple_ds][subject][0]']" do |tag|
|
131
|
+
# tag.should have_selector "[rel=?]", "subject"
|
132
|
+
# tag.should have_selector "option[value=topic1][selected=selected]"
|
133
|
+
# tag.should have_selector "option[value=topic2][selected=selected]"
|
134
|
+
# tag.should have_selector "option[value=topic3]"
|
113
135
|
generated_html.should have_selector "select.metadata-dd[name='asset[simple_ds][subject][0]']" do |tag|
|
114
|
-
tag.should have_selector "[rel=?]", "subject"
|
115
136
|
tag.should have_selector "option[value=topic1][selected=selected]"
|
116
137
|
tag.should have_selector "option[value=topic2][selected=selected]"
|
117
138
|
tag.should have_selector "option[value=topic3]"
|
@@ -127,8 +148,14 @@ describe HydraFedoraMetadataHelper do
|
|
127
148
|
describe "fedora_date_select" do
|
128
149
|
it "should generate a date picker with values from the given datastream" do
|
129
150
|
generated_html = helper.fedora_date_select(@resource,"simple_ds","subject")
|
151
|
+
# Rails3
|
152
|
+
# generated_html.should have_selector ".date-select[name='asset[simple_ds][subject]']" do |tag|
|
153
|
+
# tag.should have_selector "[rel=?]", "subject"
|
154
|
+
# tag.should have_selector "input#subject-sel-y.controlled-date-part.w4em"
|
155
|
+
# tag.should have_selector "select#subject-sel-mm.controlled-date-part" do |tag|
|
156
|
+
# tag.should have_selector "option[value=01]", "January"
|
157
|
+
# tag.should have_selector "option[value=12]", "December"
|
130
158
|
generated_html.should have_selector ".date-select[name='asset[simple_ds][subject]']" do |tag|
|
131
|
-
tag.should have_selector "[rel=?]", "subject"
|
132
159
|
tag.should have_selector "input#subject-sel-y.controlled-date-part.w4em"
|
133
160
|
tag.should have_selector "select#subject-sel-mm.controlled-date-part" do |tag|
|
134
161
|
tag.should have_selector "option[value=01]", "January"
|
@@ -184,13 +211,19 @@ describe HydraFedoraMetadataHelper do
|
|
184
211
|
describe "field_selectors_for" do
|
185
212
|
it "should generate any necessary field_selector values for the given field" do
|
186
213
|
generated_html = helper.field_selectors_for("myDsName", [{:name => 3}, :name_part])
|
187
|
-
|
188
|
-
|
189
|
-
|
214
|
+
# Rails3
|
215
|
+
# generated_html.should have_selector "input.fieldselector[type=hidden][name='field_selectors[myDsName][name_3_name_part][][name]']" do |tag|
|
216
|
+
# tag.should have_selector "[rel=name_3_name_part]"
|
217
|
+
# tag.should have_selector "[value=3]"
|
218
|
+
# end
|
219
|
+
# generated_html.should have_selector "input.fieldselector[type=hidden][name='field_selectors[myDsName][name_3_name_part][]']" do |tag|
|
220
|
+
# tag.should have_selector "[rel=name_3_name_part]"
|
221
|
+
# tag.should have_selector "[value=name_part]"
|
222
|
+
generated_html.should have_selector "input.fieldselector[type=hidden][name='field_selectors[myDsName][name_3_name_part][][name]']" do |input|
|
223
|
+
input.should have_selector "[value=3]"
|
190
224
|
end
|
191
|
-
generated_html.should have_selector "input.fieldselector[type=hidden][name='field_selectors[myDsName][name_3_name_part][]']" do |
|
192
|
-
|
193
|
-
tag.should have_selector "[value=name_part]"
|
225
|
+
generated_html.should have_selector "input.fieldselector[type=hidden][name='field_selectors[myDsName][name_3_name_part][]']" do |input|
|
226
|
+
input.should have_selector "[value=name_part]"
|
194
227
|
end
|
195
228
|
# ordering is important. this next line makes sure that the inputs are in the correct order
|
196
229
|
# (tried using CSS3 nth-of-type selectors in have_selector but it didn't work)
|
@@ -70,4 +70,19 @@ describe HydraHelper do
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
+
describe "submit_name" do
|
74
|
+
it "should return 'Save' when the scripts session variable is set" do
|
75
|
+
stubs(:session).returns({:scripts=>true})
|
76
|
+
submit_name.should == "Save"
|
77
|
+
end
|
78
|
+
it "should return 'Continue' when the new_asset param is set" do
|
79
|
+
stubs(:params).returns({:new_asset=>true})
|
80
|
+
submit_name.should == "Continue"
|
81
|
+
end
|
82
|
+
it "should return 'Save and Continue' if all else fails" do
|
83
|
+
stubs(:params).returns({})
|
84
|
+
submit_name.should == "Save and Continue"
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
73
88
|
end
|
@@ -0,0 +1,141 @@
|
|
1
|
+
require File.expand_path( File.join( File.dirname(__FILE__),'..','spec_helper') )
|
2
|
+
|
3
|
+
mods_asset_model = "info:fedora/afmodel:ModsAsset"
|
4
|
+
|
5
|
+
describe Hydra::SubmissionWorkflow do
|
6
|
+
before(:each) do
|
7
|
+
@document = SolrDocument.new({:has_model_s => [mods_asset_model]})
|
8
|
+
end
|
9
|
+
include Hydra::SubmissionWorkflow
|
10
|
+
|
11
|
+
describe "first step in workflow" do
|
12
|
+
it "should return the first step of a given workflow" do
|
13
|
+
first_step_in_workflow.should == "contributor"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe "next in workflow" do
|
18
|
+
it "should provide the next step based on the provided step" do
|
19
|
+
next_step_in_workflow(:contributor).should == "publication"
|
20
|
+
end
|
21
|
+
it "should return nil if there is no step (denoting the last step)" do
|
22
|
+
next_step_in_workflow(:permissions).should be_nil
|
23
|
+
end
|
24
|
+
it "should return the step after the first if a blank current step is provided (e.g. started from the first step so no wf_step param)" do
|
25
|
+
next_step_in_workflow(nil).should == "publication"
|
26
|
+
next_step_in_workflow("").should == "publication"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe "partial for step" do
|
31
|
+
it "should return the partial for the given step" do
|
32
|
+
workflow_partial_for_step(:contributor).should match(/contributor_form/)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe "previous show partials" do
|
37
|
+
it "should return all of the previous show partials for display in the HTML-only workflow" do
|
38
|
+
prev_partials = previous_show_partials(:permissions)
|
39
|
+
prev_partials.is_a?(Array).should be_true
|
40
|
+
prev_partials.length.should == 4
|
41
|
+
prev_partials.first.should match(/mods.*contributors/)
|
42
|
+
prev_partials.last.should match(/mods.*file_assets/)
|
43
|
+
end
|
44
|
+
it "should return an empty array for the first step in the workflow" do
|
45
|
+
previous_show_partials(:contributor).should == []
|
46
|
+
previous_show_partials("").should == []
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
describe "model specific configurations" do
|
51
|
+
it "should return the appropriate configuration when an @document object is available" do
|
52
|
+
config = model_config
|
53
|
+
config.is_a?(Array).should be_true
|
54
|
+
config.length.should == 5
|
55
|
+
partial_is_mods = []
|
56
|
+
config.each do |c|
|
57
|
+
c.is_a?(Hash).should be_true
|
58
|
+
c.has_key?(:name).should be_true
|
59
|
+
c.has_key?(:edit_partial).should be_true
|
60
|
+
partial_is_mods << c[:edit_partial].include?("mods_assets")
|
61
|
+
end
|
62
|
+
partial_is_mods.include?(true).should be_true
|
63
|
+
end
|
64
|
+
it "should return the appropriate config when a model is available in the params hash" do
|
65
|
+
@document = nil
|
66
|
+
to = SubmissionWorkflowObject.new
|
67
|
+
to.stubs(:params).returns({:content_type => "generic_content"})
|
68
|
+
config = to.model_config
|
69
|
+
config.is_a?(Array).should be_true
|
70
|
+
config.length.should == 4
|
71
|
+
partial_is_generic = []
|
72
|
+
config.each do |c|
|
73
|
+
c.is_a?(Hash).should be_true
|
74
|
+
c.has_key?(:name).should be_true
|
75
|
+
c.has_key?(:edit_partial).should be_true
|
76
|
+
partial_is_generic << c[:edit_partial].include?("generic_content")
|
77
|
+
end
|
78
|
+
partial_is_generic.include?(true).should be_true
|
79
|
+
end
|
80
|
+
it "should return the appropriate config when the ID of an object is available in the params hash" do
|
81
|
+
@document = nil
|
82
|
+
to = SubmissionWorkflowObject.new
|
83
|
+
to.stubs(:params).returns({:id=>"hydrangea:fixture_mods_article1"})
|
84
|
+
config = to.model_config
|
85
|
+
config.is_a?(Array).should be_true
|
86
|
+
config.length.should == 5
|
87
|
+
config.each do |c|
|
88
|
+
c.is_a?(Hash).should be_true
|
89
|
+
c.has_key?(:name).should be_true
|
90
|
+
c.has_key?(:edit_partial).should be_true
|
91
|
+
end
|
92
|
+
end
|
93
|
+
it "should return the configuration for non mods assets (generic_content)" do
|
94
|
+
@document = nil
|
95
|
+
to = SubmissionWorkflowObject.new
|
96
|
+
to.stubs(:params).returns(:id=>"hydra:test_generic_content")
|
97
|
+
config = to.model_config
|
98
|
+
config.is_a?(Array).should be_true
|
99
|
+
config.length.should == 4
|
100
|
+
partial_is_generic = []
|
101
|
+
config.each do |c|
|
102
|
+
c.is_a?(Hash).should be_true
|
103
|
+
c.has_key?(:name).should be_true
|
104
|
+
c.has_key?(:edit_partial).should be_true
|
105
|
+
partial_is_generic << c[:edit_partial].include?("generic_content")
|
106
|
+
end
|
107
|
+
partial_is_generic.include?(true).should be_true
|
108
|
+
end
|
109
|
+
it "should return nil if an ID is the only context available and it is not a valid object" do
|
110
|
+
@document = nil
|
111
|
+
to = SubmissionWorkflowObject.new
|
112
|
+
to.stubs(:params).returns(:id=>"hydra:not_an_actual_record")
|
113
|
+
to.model_config.should be_nil
|
114
|
+
end
|
115
|
+
end
|
116
|
+
describe "before_filter validation" do
|
117
|
+
it "should redirect back when the validation method returns false." do
|
118
|
+
@document = nil
|
119
|
+
to = SubmissionWorkflowObject.new
|
120
|
+
to.stubs(:params).returns({:id=>"hydrangea:fixture_mods_article1",:action=>"create"})
|
121
|
+
to.expects(:redirect_to).with(:back)
|
122
|
+
to.validate_workflow_step
|
123
|
+
end
|
124
|
+
it "should not redirect when the validation method returns true." do
|
125
|
+
@document = nil
|
126
|
+
to = SubmissionWorkflowObject.new
|
127
|
+
to.stubs(:params).returns({:id=>"hydrangea:fixture_mods_article1",:action=>"update"})
|
128
|
+
to.expects(:redirect_to).never
|
129
|
+
to.validate_workflow_step
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
class SubmissionWorkflowObject
|
134
|
+
include Hydra::SubmissionWorkflow
|
135
|
+
def mods_assets_create_validation
|
136
|
+
return false
|
137
|
+
end
|
138
|
+
def mods_assets_update_validation
|
139
|
+
return true
|
140
|
+
end
|
141
|
+
end
|
@@ -18,6 +18,11 @@ describe GenericImage do
|
|
18
18
|
@hydra_image.should respond_to(:apply_depositor_metadata)
|
19
19
|
end
|
20
20
|
|
21
|
+
it "should include Hydra Generic Image Methods" do
|
22
|
+
@hydra_image.class.included_modules.should include(Hydra::GenericImage)
|
23
|
+
@hydra_image.should respond_to(:derivation_options)
|
24
|
+
end
|
25
|
+
|
21
26
|
it "should have accessors for its default datastreams of content and original" do
|
22
27
|
@hydra_image.should respond_to(:has_content?)
|
23
28
|
@hydra_image.should respond_to(:content)
|
@@ -45,7 +50,7 @@ describe GenericImage do
|
|
45
50
|
end
|
46
51
|
|
47
52
|
describe '#content=' do
|
48
|
-
it "
|
53
|
+
it "should create a content datastream when given an image file" do
|
49
54
|
end
|
50
55
|
end
|
51
56
|
|
data/uninstall.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# Uninstall hook code here
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|