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
data/solr/solr.xml
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
+
<!--
|
3
|
+
Licensed to the Apache Software Foundation (ASF) under one or more
|
4
|
+
contributor license agreements. See the NOTICE file distributed with
|
5
|
+
this work for additional information regarding copyright ownership.
|
6
|
+
The ASF licenses this file to You under the Apache License, Version 2.0
|
7
|
+
(the "License"); you may not use this file except in compliance with
|
8
|
+
the License. You may obtain a copy of the License at
|
9
|
+
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
|
12
|
+
Unless required by applicable law or agreed to in writing, software
|
13
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
See the License for the specific language governing permissions and
|
16
|
+
limitations under the License.
|
17
|
+
-->
|
18
|
+
|
19
|
+
<!--
|
20
|
+
All (relative) paths are relative to the installation path
|
21
|
+
|
22
|
+
persistent: Save changes made via the API to this file
|
23
|
+
sharedLib: path to a lib directory that will be shared across all cores
|
24
|
+
-->
|
25
|
+
<solr persistent="false">
|
26
|
+
|
27
|
+
<!--
|
28
|
+
adminPath: RequestHandler path to manage cores.
|
29
|
+
If 'null' (or absent), cores will not be manageable via REST
|
30
|
+
-->
|
31
|
+
<cores adminPath="/admin/cores">
|
32
|
+
<core name="core0" instanceDir="core0" />
|
33
|
+
<core name="core1" instanceDir="core1" />
|
34
|
+
</cores>
|
35
|
+
</solr>
|
@@ -0,0 +1,128 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
+
require 'mocha'
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
# This uses nokogiri to check formedness. It's slightly less strict than the markup_validit
|
9
|
+
# currently not being used.
|
10
|
+
def well_formed(html)
|
11
|
+
begin
|
12
|
+
Nokogiri::XML(html.gsub("&", "&" )) { |config| config.strict } #Literal & in text are not allowed, but we don't care.
|
13
|
+
return "ok"
|
14
|
+
rescue Nokogiri::XML::SyntaxError => e
|
15
|
+
# Write the offensive HTML to a file in tmp/html_validity_failures with a filename based on Time.now.iso8601
|
16
|
+
html_failures_dir = File.expand_path(File.dirname(__FILE__) + '/../../tmp/html_validity_failures')
|
17
|
+
FileUtils.mkdir_p(html_failures_dir)
|
18
|
+
filename = Time.now.iso8601(3).gsub(":","")+".html"
|
19
|
+
file_path = File.join(html_failures_dir, filename)
|
20
|
+
file = File.open(file_path, "w")
|
21
|
+
file.write(html)
|
22
|
+
return "#{e.inspect} -- Line: #{e.line} -- Level: #{e.level} -- Code: #{e.code}. HTML Saved to RAILS_ROOT/tmp/html_validity_failures/#{filename}"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
# This checks document for validity (if required) and well formedness
|
29
|
+
# Pass in a html string. IF you want to check for XHTML validity, do rake spec HTML_VALIDITY=true. Otherwise only document form is checked
|
30
|
+
# by nokogiri.
|
31
|
+
def document_check(html, html_validity=ENV["HTML_VALIDITY"])
|
32
|
+
if html_validity == "true" || html_validity == true
|
33
|
+
html.should be_xhtml_transitional
|
34
|
+
end
|
35
|
+
well_formed(html).should == "ok"
|
36
|
+
end
|
37
|
+
|
38
|
+
|
39
|
+
describe CatalogController do
|
40
|
+
|
41
|
+
integrate_views
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
describe "Home Page" do
|
46
|
+
|
47
|
+
it "Should have Valid HTML when not logged in" do
|
48
|
+
get("index", "controller"=>"catalog")
|
49
|
+
document_check(response.body)
|
50
|
+
end
|
51
|
+
|
52
|
+
it "Should have Valid HTML when I'm logged in" do
|
53
|
+
|
54
|
+
mock_user = mock("User")
|
55
|
+
mock_user.stubs(:login).returns("archivist1@example.com")
|
56
|
+
mock_user.stubs(:can_be_superuser?).returns(true)
|
57
|
+
mock_user.stubs(:is_being_superuser?).returns(true)
|
58
|
+
mock_user.stubs(:last_search_url).returns(nil)
|
59
|
+
|
60
|
+
controller.stubs(:current_user).returns(mock_user)
|
61
|
+
get("index", "controller"=>"catalog")
|
62
|
+
document_check(response.body)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
describe "Document Pages" do
|
67
|
+
|
68
|
+
before(:each) do
|
69
|
+
mock_user = mock("User")
|
70
|
+
mock_user.stubs(:login).returns("archivist1@example.com")
|
71
|
+
mock_user.stubs(:can_be_superuser?).returns(true)
|
72
|
+
mock_user.stubs(:is_being_superuser?).returns(true)
|
73
|
+
mock_user.stubs(:last_search_url).returns(nil)
|
74
|
+
controller.stubs(:current_user).returns(mock_user)
|
75
|
+
end
|
76
|
+
|
77
|
+
#Article Data Type
|
78
|
+
it "Should have valid html when in Article Edit Show" do
|
79
|
+
controller.session[:viewing_context] = "edit"
|
80
|
+
get(:show, {:id=>"hydrangea:fixture_mods_article1"}, :action=>"edit")
|
81
|
+
document_check(response.body)
|
82
|
+
end
|
83
|
+
|
84
|
+
it "Should have valid html when in Article Browse Show" do
|
85
|
+
|
86
|
+
controller.session[:viewing_context] = "browse"
|
87
|
+
get(:show, {:id=>"hydrangea:fixture_mods_article1"}, :action=>"browse")
|
88
|
+
document_check(response.body)
|
89
|
+
end
|
90
|
+
|
91
|
+
#Data Set Data Type
|
92
|
+
it "Should have valid html when in Dataset Edit Show" do
|
93
|
+
controller.session[:viewing_context] = "edit"
|
94
|
+
get(:show, {:id=>"hydrangea:fixture_mods_dataset1"}, :action=>"edit")
|
95
|
+
document_check(response.body)
|
96
|
+
end
|
97
|
+
|
98
|
+
it "Should have valid html when in Dataset Browse Show" do
|
99
|
+
controller.session[:viewing_context] = "browse"
|
100
|
+
get(:show, {:id=>"hydrangea:fixture_mods_dataset1"}, :action=>"browse")
|
101
|
+
document_check(response.body)
|
102
|
+
end
|
103
|
+
|
104
|
+
#APO datatype hydrus:admin_class1
|
105
|
+
it "Should have valid html when in Dataset Edit Show" do
|
106
|
+
controller.session[:viewing_context] = "edit"
|
107
|
+
get(:show, {:id=>"hydrus:admin_class1"}, :action=>"edit")
|
108
|
+
document_check(response.body)
|
109
|
+
end
|
110
|
+
|
111
|
+
it "Should have valid html when in Dataset Browse Show" do
|
112
|
+
controller.session[:viewing_context] = "browse"
|
113
|
+
get(:show, {:id=>"hydrus:admin_class1"}, :action=>"browse")
|
114
|
+
File.open('/tmp/out.xml', 'w') { |f| f << response.body }
|
115
|
+
document_check(response.body)
|
116
|
+
|
117
|
+
end
|
118
|
+
|
119
|
+
# The delete view should be the same for all data types
|
120
|
+
it "Should have valid html when in Dataset Delete" do
|
121
|
+
get(:show, {:id=>"hydrangea:fixture_mods_dataset1"}, :action=>"delete")
|
122
|
+
document_check(response.body)
|
123
|
+
end
|
124
|
+
|
125
|
+
|
126
|
+
end #Document pages
|
127
|
+
|
128
|
+
end
|
@@ -0,0 +1,219 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
+
|
3
|
+
describe HydraFedoraMetadataHelper do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
# @mock_ng_ds = mock("nokogiri datastream")
|
7
|
+
# @mock_ng_ds.stubs(:kind_of?).with(ActiveFedora::NokogiriDatastream).returns(true)
|
8
|
+
# @mock_ng_ds.stubs(:class).returns(ActiveFedora::NokogiriDatastream)
|
9
|
+
# @mock_md_ds = stub(:stream_values=>"value")
|
10
|
+
# datastreams = {"ng_ds"=>@mock_ng_ds,"simple_ds"=>@mock_md_ds}
|
11
|
+
@resource = mock("fedora object")
|
12
|
+
# @resource.stubs(:datastreams).returns(datastreams)
|
13
|
+
# @resource.stubs(:datastreams_in_memory).returns(datastreams)
|
14
|
+
|
15
|
+
@resource.stubs(:get_values_from_datastream).with("simple_ds", "subject", "").returns( ["topic1","topic2"] )
|
16
|
+
|
17
|
+
@resource.stubs(:get_values_from_datastream).with("ng_ds", [:title, :main_title], "").returns( ["My Title"] )
|
18
|
+
@resource.stubs(:get_values_from_datastream).with("ng_ds", [{:person=>1}, :given_name], "").returns( ["Bob"] )
|
19
|
+
|
20
|
+
@resource.stubs(:get_values_from_datastream).with("empty_ds", "something", "").returns( [""] )
|
21
|
+
end
|
22
|
+
|
23
|
+
describe "fedora_text_field" do
|
24
|
+
it "should generate a text field input with values from the given datastream" do
|
25
|
+
generated_html = helper.fedora_text_field(@resource,"ng_ds",[:title, :main_title])
|
26
|
+
generated_html.should have_tag "#title_main_title_0-container.editable-container"do
|
27
|
+
with_tag "span#title_main_title_0-text.editable-text.text", "My Title"
|
28
|
+
with_tag "input#title_main_title_0.editable-edit.edit" do
|
29
|
+
with_tag "[value=?]", "My Title"
|
30
|
+
with_tag "[name=?]","asset[ng_ds][title_main_title][0]"
|
31
|
+
with_tag "[data-datastream-name=?]", "ng_ds"
|
32
|
+
with_tag "[rel=?]", "title_main_title"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
it "should generate an ordered list of text field inputs" do
|
37
|
+
generated_html = helper.fedora_text_field(@resource,"simple_ds","subject")
|
38
|
+
generated_html.should have_tag "ol[rel=subject]" do
|
39
|
+
with_tag "li#subject_0-container.editable-container.field" do
|
40
|
+
with_tag "a.destructive.field"
|
41
|
+
with_tag "span#subject_0-text.editable-text.text", "topic1"
|
42
|
+
with_tag "input#subject_0.editable-edit.edit" do
|
43
|
+
with_tag "[value=?]", "topic1"
|
44
|
+
with_tag "[name=?]", "asset[simple_ds][subject][0]"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
with_tag "li#subject_1-container.editable-container.field" do
|
48
|
+
with_tag "a.destructive.field"
|
49
|
+
with_tag "span#subject_1-text.editable-text.text", "topic2"
|
50
|
+
with_tag "input#subject_1.editable-edit.edit" do
|
51
|
+
with_tag "[value=?]", "topic2"
|
52
|
+
with_tag "[name=?]", "asset[simple_ds][subject][1]"
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
generated_html.should have_tag "input", :class=>"editable-edit", :id=>"subject_1", :name=>"asset[simple_ds][subject_1]", :value=>"topic9"
|
57
|
+
end
|
58
|
+
it "should render an empty control if the field has no values" do
|
59
|
+
helper.fedora_text_field(@resource,"empty_ds","something").should have_tag "li#something_0-container.editable-container" do
|
60
|
+
with_tag "#something_0-text.editable-text.text", ""
|
61
|
+
end
|
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_not have_tag "ol"
|
66
|
+
generated_html.should_not have_tag "li"
|
67
|
+
|
68
|
+
generated_html.should have_tag "span#subject-container.editable-container.field" do
|
69
|
+
with_tag "span#subject-text.editable-text.text", "topic1"
|
70
|
+
with_tag "input#subject.editable-edit.edit[value=topic1]" do
|
71
|
+
with_tag "[name=?]", "asset[simple_ds][subject][0]"
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
describe "fedora_text_area" do
|
78
|
+
it "should generate an ordered list of textile-enabled text area with values from the given datastream" do
|
79
|
+
helper.fedora_text_area(@resource,"simple_ds","subject").should have_tag "ol[rel=subject]" do
|
80
|
+
with_tag "li#subject_0-container.field" do
|
81
|
+
without_tag "a.destructive.field"
|
82
|
+
with_tag "span#subject_0-text.editable-text.text[style=display:none;]", "topic1"
|
83
|
+
with_tag "textarea#subject_0.editable-edit.edit", "topic1"
|
84
|
+
end
|
85
|
+
with_tag "li#subject_1-container.field" do
|
86
|
+
with_tag "span#subject_1-text.editable-text.text[style=display:none;]","topic2"
|
87
|
+
with_tag "textarea#subject_1.editable-edit.edit", "topic2"
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
it "should render an empty control if the field has no values" do
|
92
|
+
helper.fedora_text_area(@resource,"empty_ds","something").should have_tag "li#something_0-container.field" do
|
93
|
+
with_tag "span#something_0-text.editable-text.text[style=display:none;]", ""
|
94
|
+
with_tag "textarea#something_0.editable-edit.edit", ""
|
95
|
+
end
|
96
|
+
end
|
97
|
+
it "should limit to single-value output if :multiple=>false" do
|
98
|
+
generated_html = helper.fedora_text_area(@resource,"simple_ds","subject", :multiple=>false)
|
99
|
+
generated_html.should_not have_tag "ol"
|
100
|
+
generated_html.should_not have_tag "li"
|
101
|
+
generated_html.should have_tag "span#subject-container.field" do
|
102
|
+
with_tag "span#subject-text.editable-text.text[style=display:none;]", "topic1"
|
103
|
+
with_tag "textarea#subject.editable-edit.edit", "topic1"
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
describe "fedora_select" do
|
109
|
+
it "should generate a select with values from the given datastream" do
|
110
|
+
generated_html = helper.fedora_select(@resource,"simple_ds","subject", :choices=>["topic1","topic2", "topic3"])
|
111
|
+
generated_html.should have_tag "select.metadata-dd[name=?]", "asset[simple_ds][subject][0]" do
|
112
|
+
with_tag "[rel=?]", "subject"
|
113
|
+
with_tag "option[value=topic1][selected=selected]"
|
114
|
+
with_tag "option[value=topic2][selected=selected]"
|
115
|
+
with_tag "option[value=topic3]"
|
116
|
+
end
|
117
|
+
end
|
118
|
+
it "should return the product of fedora_text_field if :choices is not set" do
|
119
|
+
helper.expects(:fedora_text_field).returns("fake response")
|
120
|
+
generated_html = helper.fedora_select(@resource,"simple_ds","subject")
|
121
|
+
generated_html.should == "fake response"
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
describe "fedora_date_select" do
|
126
|
+
it "should generate a date picker with values from the given datastream" do
|
127
|
+
generated_html = helper.fedora_date_select(@resource,"simple_ds","subject")
|
128
|
+
generated_html.should have_tag ".date-select[name=?]", "asset[simple_ds][subject]" do
|
129
|
+
with_tag "[rel=?]", "subject"
|
130
|
+
with_tag "input#subject-sel-y.controlled-date-part.w4em"
|
131
|
+
with_tag "select#subject-sel-mm.controlled-date-part" do
|
132
|
+
with_tag "option[value=01]", "January"
|
133
|
+
with_tag "option[value=12]", "December"
|
134
|
+
end
|
135
|
+
with_tag "select#subject-sel-dd.controlled-date-part" do
|
136
|
+
with_tag "option[value=01]", "01"
|
137
|
+
with_tag "option[value=31]", "31"
|
138
|
+
end
|
139
|
+
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
describe "fedora_checkbox" do
|
145
|
+
it "should generate a set of checkboxes with values from the given datastream"
|
146
|
+
end
|
147
|
+
|
148
|
+
describe "all field generators" do
|
149
|
+
it "should include any necessary field_selector info" do
|
150
|
+
field_selectors_regexp = helper.field_selectors_for("ng_ds",[:title, :main_title]).gsub('/','\/').gsub(']','\]').gsub('[','\[')
|
151
|
+
["fedora_text_field", "fedora_text_area", "fedora_select", "fedora_date_select"].each do |method|
|
152
|
+
generated_html = eval("helper.#{method}(@resource,\"ng_ds\",[:title, :main_title])")
|
153
|
+
generated_html.should match( field_selectors_regexp )
|
154
|
+
end
|
155
|
+
generated_html = helper.fedora_select(@resource,"ng_ds",[:title, :main_title], :choices=>["choice1"])
|
156
|
+
generated_html.should match( field_selectors_regexp )
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
describe "fedora_text_field_insert_link" do
|
161
|
+
it "should generate a link for inserting a fedora_text_field into the page" do
|
162
|
+
helper.fedora_text_field_insert_link("ng_ds",[:title, :main_title]).should have_tag "a.addval.textfield[href=\#]"
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
describe "fedora_text_area_insert_link" do
|
167
|
+
it "should generate a link for inserting a fedora_text_area into the page" do
|
168
|
+
helper.fedora_text_area_insert_link("ng_ds",[:title, :main_title]).should have_tag "a.addval.textarea[href=\#]"
|
169
|
+
end
|
170
|
+
|
171
|
+
end
|
172
|
+
|
173
|
+
describe "fedora_field_label" do
|
174
|
+
it "should generate a label with appropriate @for attribute" do
|
175
|
+
params[:action] = "edit"
|
176
|
+
helper.fedora_field_label("ng_ds",[:title, :main_title], "Title:").should have_tag "label[for=title_main_title]", "Title:"
|
177
|
+
end
|
178
|
+
it "should display the field name if no label is provided" do
|
179
|
+
params[:action] = "edit"
|
180
|
+
helper.fedora_field_label("ng_ds",[:title, :main_title]).should have_tag "label[for=title_main_title]", "title_main_title"
|
181
|
+
end
|
182
|
+
it "should return a span and not a label when we are not editing the object" do
|
183
|
+
params[:action] = "show"
|
184
|
+
helper.fedora_field_label("ng_ds",[:title, :main_title]).should have_tag "span","title_main_title"
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
describe "field_selectors_for" do
|
189
|
+
it "should generate any necessary field_selector values for the given field" do
|
190
|
+
generated_html = helper.field_selectors_for("myDsName", [{:name => 3}, :name_part])
|
191
|
+
generated_html.should have_tag "input.fieldselector[type=hidden][name=?]", "field_selectors[myDsName][name_3_name_part][][name]" do
|
192
|
+
with_tag "[rel=name_3_name_part]"
|
193
|
+
with_tag "[value=3]"
|
194
|
+
end
|
195
|
+
generated_html.should have_tag "input.fieldselector[type=hidden][name=?]", "field_selectors[myDsName][name_3_name_part][]" do
|
196
|
+
with_tag "[rel=name_3_name_part]"
|
197
|
+
with_tag "[value=name_part]"
|
198
|
+
end
|
199
|
+
# ordering is important. this next line makes sure that the inputs are in the correct order
|
200
|
+
# (tried using CSS3 nth-of-type selectors in have_tag but it didn't work)
|
201
|
+
generated_html.should match(/<input.*name="field_selectors\[myDsName\]\[name_3_name_part\]\[\]\[name\]".*\/><input.*name="field_selectors\[myDsName\]\[name_3_name_part\]\[\].*value="name_part" .*\/>/)
|
202
|
+
end
|
203
|
+
it "should not generate any field selectors if the field key is not an array" do
|
204
|
+
helper.field_selectors_for("myDsName", :description).should == ""
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
describe "hydra_form_for" do
|
209
|
+
it "should generate an entire form" do
|
210
|
+
pending
|
211
|
+
eval_erb(%(
|
212
|
+
<% hydra_form_for @resource do |h| %>
|
213
|
+
<h2>Hello</h2>
|
214
|
+
<%= h.fedora_text_field %>
|
215
|
+
<% end %>
|
216
|
+
)).should match_html("<h2>Hello</h2> blah blah blah ")
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
# This file is copied to ~/spec when you run 'ruby script/generate rspec'
|
2
|
+
# from the project root directory.
|
3
|
+
ENV["RAILS_ENV"] ||= 'test'
|
4
|
+
|
5
|
+
# Overrides require_plugin_dependency, pointing to plugins within dummy app
|
6
|
+
# Original require_plugin_dependency method defined in init.rb
|
7
|
+
def require_plugin_dependency(dependency_path)
|
8
|
+
modified_path = File.join(File.dirname(__FILE__), "..","hydra-plugin_test_host", dependency_path)
|
9
|
+
p "(spec_helper) Re-routing require path to: #{modified_path}"
|
10
|
+
require_dependency modified_path
|
11
|
+
end
|
12
|
+
|
13
|
+
require File.dirname(__FILE__) + "/../hydra-plugin_test_host/config/environment" unless defined?(RAILS_ROOT)
|
14
|
+
|
15
|
+
# This ensures that the current plugin's models, helpers and controllers are loaded last
|
16
|
+
# Dir["app/helpers/*.rb"].each {|f| require f }
|
17
|
+
# Dir["app/models/*.rb"].each {|f| require f}
|
18
|
+
# Dir["app/controllers/*.rb"].each {|f| require f} # Loading the controllers a second time messes up the method aliasing for CatalogController.show
|
19
|
+
|
20
|
+
require 'spec/autorun'
|
21
|
+
require 'spec/rails'
|
22
|
+
|
23
|
+
# Requires supporting files with custom matchers and macros, etc,
|
24
|
+
# in ./support/ and its subdirectories.
|
25
|
+
# Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
26
|
+
Dir[File.join(File.dirname(__FILE__), "support", "**", "*.rb")].each {|f| require f}
|
27
|
+
|
28
|
+
Spec::Runner.configure do |config|
|
29
|
+
# If you're not using ActiveRecord you should remove these
|
30
|
+
# lines, delete config/database.yml and disable :active_record
|
31
|
+
# in your config/boot.rb
|
32
|
+
# config.use_transactional_fixtures = true
|
33
|
+
# config.use_instantiated_fixtures = false
|
34
|
+
# config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
|
35
|
+
|
36
|
+
# == Fixtures
|
37
|
+
#
|
38
|
+
# You can declare fixtures for each example_group like this:
|
39
|
+
# describe "...." do
|
40
|
+
# fixtures :table_a, :table_b
|
41
|
+
#
|
42
|
+
# Alternatively, if you prefer to declare them only once, you can
|
43
|
+
# do so right here. Just uncomment the next line and replace the fixture
|
44
|
+
# names with your fixtures.
|
45
|
+
#
|
46
|
+
# config.global_fixtures = :table_a, :table_b
|
47
|
+
#
|
48
|
+
# If you declare global fixtures, be aware that they will be declared
|
49
|
+
# for all of your examples, even those that don't use them.
|
50
|
+
#
|
51
|
+
# You can also declare which fixtures to use (for example fixtures for test/fixtures):
|
52
|
+
#
|
53
|
+
# config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
|
54
|
+
#
|
55
|
+
# == Mock Framework
|
56
|
+
#
|
57
|
+
# RSpec uses it's own mocking framework by default. If you prefer to
|
58
|
+
# use mocha, flexmock or RR, uncomment the appropriate line:
|
59
|
+
#
|
60
|
+
config.mock_with :mocha
|
61
|
+
# config.mock_with :flexmock
|
62
|
+
# config.mock_with :rr
|
63
|
+
#
|
64
|
+
# == Notes
|
65
|
+
#
|
66
|
+
# For more information take a look at Spec::Runner::Configuration and Spec::Runner
|
67
|
+
|
68
|
+
def fixture(file)
|
69
|
+
File.new(File.join(File.dirname(__FILE__), 'fixtures', file))
|
70
|
+
end
|
71
|
+
|
72
|
+
def match_html(html)
|
73
|
+
# Match two strings, but don't care about whitespace
|
74
|
+
simple_matcher("should match #{html}"){|given| given.strip.gsub(/\s+/,' ').gsub('> <','><') == html.strip.gsub(/\s+/,' ').gsub('> <','><') }
|
75
|
+
end
|
76
|
+
|
77
|
+
def connect_bl_solr
|
78
|
+
# @connection = Solr::Connection.new( SHELVER_SOLR_URL, :autocommit => :on )
|
79
|
+
if defined?(@index_full_text) && @index_full_text
|
80
|
+
url = Blacklight.solr_config['fulltext']['url']
|
81
|
+
else
|
82
|
+
url = Blacklight.solr_config[:url]
|
83
|
+
end
|
84
|
+
|
85
|
+
@bl_solr = Solr::Connection.new(url, :autocommit => :on )
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
data/tasks/hydra-head.rake
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
#require 'rake/testtask'
|
2
1
|
require 'rspec/core'
|
3
2
|
require 'rspec/core/rake_task'
|
4
3
|
require 'thor/core_ext/file_binary_read'
|
@@ -160,9 +159,8 @@ namespace :hyhead do
|
|
160
159
|
system("source ./test_app/.rvmrc")
|
161
160
|
|
162
161
|
puts "Installing rails, bundler and devise"
|
163
|
-
%x[gem install --no-rdoc --no-ri 'rails']
|
162
|
+
%x[gem install --no-rdoc --no-ri 'rails' -v "<3.1"]
|
164
163
|
%x[gem install --no-rdoc --no-ri 'bundler']
|
165
|
-
%x[gem install --no-rdoc --no-ri 'devise']
|
166
164
|
|
167
165
|
puts "Generating new rails app"
|
168
166
|
%x[rails new test_app]
|
@@ -225,7 +223,7 @@ namespace :hyhead do
|
|
225
223
|
task :test => [:use_test_app] do
|
226
224
|
|
227
225
|
puts "Running rspec tests"
|
228
|
-
puts
|
226
|
+
puts %x[rake hyhead:spec:rcov]
|
229
227
|
rspec_success = $?.success?
|
230
228
|
|
231
229
|
puts "Running cucumber tests"
|
data/test_support/etc/Gemfile
CHANGED
@@ -3,9 +3,12 @@
|
|
3
3
|
|
4
4
|
source 'http://rubygems.org'
|
5
5
|
|
6
|
-
gem
|
6
|
+
gem "rails", '< 3.1'
|
7
|
+
|
8
|
+
gem 'sqlite3-ruby', '~>1.2.5', :require => 'sqlite3'
|
9
|
+
#gem 'sqlite3-ruby', :require => 'sqlite3'
|
10
|
+
#gem 'sqlite3'
|
7
11
|
|
8
|
-
gem 'sqlite3-ruby', :require => 'sqlite3'
|
9
12
|
gem 'blacklight', '3.0.0'
|
10
13
|
gem 'hydra-head', :path => '../../'
|
11
14
|
gem 'devise'
|
@@ -17,13 +20,11 @@ group :development, :test do
|
|
17
20
|
gem 'rspec'
|
18
21
|
gem 'rspec-rails', '>=2.5.0'
|
19
22
|
gem 'mocha'
|
20
|
-
#gem 'generator_spec'
|
21
23
|
gem 'cucumber-rails'
|
22
24
|
gem 'database_cleaner'
|
23
25
|
gem 'capybara'
|
24
|
-
#gem 'webrat'
|
25
|
-
#gem 'aruba'
|
26
26
|
gem 'factory_girl'
|
27
27
|
gem 'bcrypt-ruby'
|
28
|
+
gem 'rest-client'
|
28
29
|
end
|
29
30
|
|
@@ -0,0 +1,27 @@
|
|
1
|
+
Feature: Objects Without Models - Edit View
|
2
|
+
I want to see appropriate information in the edit view for objects without an (active)fedora model
|
3
|
+
|
4
|
+
Scenario: In Edit View for Object Without a Model
|
5
|
+
# FIXME: you can't get to edit view for object with no model ... not even with edit permissions
|
6
|
+
# Given I am logged in as "archivist1@example.com"
|
7
|
+
# And I am on the edit document page for hydra:test_no_model
|
8
|
+
# Then I should see "hydra test object without a model"
|
9
|
+
|
10
|
+
Scenario: html5 valid - unauthenticated
|
11
|
+
Given I am on the edit document page for hydra:test_no_model
|
12
|
+
Then I should see "do not have sufficient access privileges"
|
13
|
+
Then the page should be HTML5 valid
|
14
|
+
|
15
|
+
Scenario: html5 valid - authenticated (read)
|
16
|
+
Given I am logged in as "public@nopermissions.com"
|
17
|
+
And I am on the edit document page for hydra:test_no_model
|
18
|
+
Then I should see "do not have sufficient access privileges"
|
19
|
+
Then the page should be HTML5 valid
|
20
|
+
|
21
|
+
Scenario: html5 valid - authenticated (edit)
|
22
|
+
# FIXME: you can't get to edit view for object with no model ... not even with edit permissions
|
23
|
+
# Given I am logged in as "archivist1@example.com"
|
24
|
+
# And I am on the edit document page for hydra:test_no_model
|
25
|
+
# Then I should see "hydra test object without a model"
|
26
|
+
# Then the page should be HTML5 valid
|
27
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
Feature: Objects Without Models - Search Results
|
2
|
+
I want to see appropriate information in search results for objects without an (active)fedora model
|
3
|
+
|
4
|
+
Scenario: Have a Search Result that is an Object Without a Model
|
5
|
+
Given I am logged in as "archivist1@example.com"
|
6
|
+
And I am on the home page
|
7
|
+
And I fill in "q" with "test"
|
8
|
+
When I press "submit"
|
9
|
+
Then I should see a link to "the show document page for hydra:test_no_model"
|
10
|
+
|
11
|
+
# you can't see this object unless you are an editor
|
12
|
+
Scenario: html5 valid - unauthenticated
|
13
|
+
When I am on the home page
|
14
|
+
And I fill in "q" with "test"
|
15
|
+
And I press "submit"
|
16
|
+
Then I should not see a link to "the show document page for hydra:test_no_model"
|
17
|
+
|
18
|
+
Scenario: html5 valid - authenticated
|
19
|
+
Given I am logged in as "archivist1@example.com"
|
20
|
+
And I am on the home page
|
21
|
+
And I fill in "q" with "test"
|
22
|
+
When I press "submit"
|
23
|
+
Then the page should be HTML5 valid
|
24
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
Feature: Objects Without Models - Show View
|
2
|
+
I want to see appropriate information in the show view for objects without an (active)fedora model
|
3
|
+
|
4
|
+
Scenario: In Show View for Object Without a Model
|
5
|
+
# FIXME: you can't get to show view for object with no model ... not even with edit permissions
|
6
|
+
# Given I am logged in as "archivist1@example.com"
|
7
|
+
# And I am on the show document page for hydra:test_no_model
|
8
|
+
# Then I should see "test object for default partials"
|
9
|
+
|
10
|
+
Scenario: html5 valid - unauthenticated
|
11
|
+
Given I am on the show document page for hydra:test_no_model
|
12
|
+
Then I should see "do not have sufficient access privileges"
|
13
|
+
And the page should be HTML5 valid
|
14
|
+
|
15
|
+
Scenario: html5 valid - authenticated (read)
|
16
|
+
# FIXME: you can't get to show view for object with no model ... not even with edit permissions
|
17
|
+
# Given I am logged in as "public@nopermissions.com"
|
18
|
+
# And I am on the show document page for hydra:test_no_model
|
19
|
+
# Then I should see "test object for default partials"
|
20
|
+
# And the page should be HTML5 valid
|
21
|
+
|
22
|
+
Scenario: html5 valid - authenticated (edit)
|
23
|
+
# FIXME: you can't get to show view for object with no model ... not even with edit permissions
|
24
|
+
# Given I am logged in as "archivist1@example.com"
|
25
|
+
# And I am on the show document page for hydra:test_no_model
|
26
|
+
# Then I should see "test object for default partials"
|
27
|
+
# And the page should be HTML5 valid
|
@@ -17,6 +17,6 @@ Feature: Create Asset or Dataset Split Button
|
|
17
17
|
# Need to build this out more
|
18
18
|
Scenario: Non-editor views the search results page and sees the buttons to add assets which link to login then create an asset
|
19
19
|
Given I am on the base search page
|
20
|
-
Then I should see "Add a Basic MODS Asset"
|
21
|
-
Then I should see "Add an Image"
|
20
|
+
Then I should see "Add a Basic MODS Asset"
|
21
|
+
Then I should see "Add an Image"
|
22
22
|
Then I should see "Add Generic Content"
|