hydra-head 3.0.0pre1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +71 -0
- data/.gitmodules +6 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +257 -0
- data/README.textile +150 -0
- data/README_RAILS3_CHANGES.textile +42 -0
- data/Rakefile +5 -0
- data/TESTING.textile +85 -0
- data/app/controllers/assets_controller.rb +117 -0
- data/app/controllers/contributors_controller.rb +54 -0
- data/app/controllers/file_assets_controller.rb +152 -0
- data/app/controllers/permissions_controller.rb +137 -0
- data/app/controllers/user_sessions_controller.rb +14 -0
- data/app/helpers/article_metadata_helper.rb +80 -0
- data/app/helpers/blacklight_helper.rb +192 -0
- data/app/helpers/downloads_helper.rb +19 -0
- data/app/helpers/generic_content_objects_helper.rb +16 -0
- data/app/helpers/hydra_assets_helper.rb +75 -0
- data/app/helpers/hydra_djatoka_helper.rb +23 -0
- data/app/helpers/hydra_fedora_metadata_helper.rb +365 -0
- data/app/helpers/hydra_helper.rb +155 -0
- data/app/helpers/hydra_uploader_helper.rb +18 -0
- data/app/helpers/inline_editable_metadata_helper.rb +15 -0
- data/app/helpers/javascript_includes_helper.rb +93 -0
- data/app/helpers/release_process_helper.rb +32 -0
- data/app/models/audio_asset.rb +8 -0
- data/app/models/file_asset.rb +111 -0
- data/app/models/generic_content.rb +21 -0
- data/app/models/generic_image.rb +62 -0
- data/app/models/image_asset.rb +8 -0
- data/app/models/mods_asset.rb +6 -0
- data/app/models/role_mapper.rb +22 -0
- data/app/models/superuser.rb +6 -0
- data/app/models/video_asset.rb +8 -0
- data/app/views/_add_assets_links.html.erb +13 -0
- data/app/views/_brown_sidebar.html +15 -0
- data/app/views/_user_util_links.html.erb +31 -0
- data/app/views/catalog/_citation.html.erb +11 -0
- data/app/views/catalog/_constraints_element.html.erb +34 -0
- data/app/views/catalog/_delete_partials/_default.html.erb +29 -0
- data/app/views/catalog/_document_list.html.erb +11 -0
- data/app/views/catalog/_edit_partials/_default.html.erb +64 -0
- data/app/views/catalog/_edit_partials/_default_details.html.erb +15 -0
- data/app/views/catalog/_email_form.html.erb +9 -0
- data/app/views/catalog/_facets.html.erb +37 -0
- data/app/views/catalog/_flash_msg.html.erb +17 -0
- data/app/views/catalog/_home.html.erb +6 -0
- data/app/views/catalog/_home_text.html.erb +10 -0
- data/app/views/catalog/_index_partials/_default.html.erb +20 -0
- data/app/views/catalog/_index_partials/_default_details.html.erb +11 -0
- data/app/views/catalog/_index_partials/_default_group.html.erb +15 -0
- data/app/views/catalog/_search_form.html.erb +12 -0
- data/app/views/catalog/_show_partials/_default.html.erb +23 -0
- data/app/views/catalog/_show_partials/_default_details.html.erb +12 -0
- data/app/views/catalog/_show_partials/_facets.html.erb +52 -0
- data/app/views/catalog/_sms_form.html.erb +21 -0
- data/app/views/catalog/_sort_and_per_page.html.erb +22 -0
- data/app/views/catalog/_uva_tabs.html.erb +10 -0
- data/app/views/catalog/about.html.erb +0 -0
- data/app/views/catalog/show.html.erb +48 -0
- data/app/views/contributors/_add_contributor_split_button.html.erb +10 -0
- data/app/views/contributors/_edit_conference.html.erb +29 -0
- data/app/views/contributors/_edit_organization.html.erb +29 -0
- data/app/views/contributors/_edit_person.html.erb +42 -0
- data/app/views/contributors/_index.html.erb +12 -0
- data/app/views/contributors/_new.html.erb +10 -0
- data/app/views/contributors/_show_conference.html.erb +22 -0
- data/app/views/contributors/_show_organization.html.erb +29 -0
- data/app/views/contributors/_show_person.html.erb +17 -0
- data/app/views/contributors/new.html.erb +13 -0
- data/app/views/downloads/index.html.erb +1 -0
- data/app/views/file_assets/_deletable_result.html.erb +5 -0
- data/app/views/file_assets/_index.html.erb +15 -0
- data/app/views/file_assets/_new.html.erb +2 -0
- data/app/views/file_assets/_result.html.erb +16 -0
- data/app/views/file_assets/index.html.erb +5 -0
- data/app/views/fluid_infusion/_uploader.html.erb +81 -0
- data/app/views/fluid_infusion/_uploader_generic_content_objects.js.erb +38 -0
- data/app/views/fluid_infusion/_uploader_js.erb +45 -0
- data/app/views/generic_content_objects/_edit_description.html.erb +50 -0
- data/app/views/generic_content_objects/_new.html.erb +0 -0
- data/app/views/generic_content_objects/_show_description.html.erb +68 -0
- data/app/views/generic_content_objects/contributors/_edit_conference.html.erb +29 -0
- data/app/views/generic_content_objects/contributors/_edit_organization.html.erb +29 -0
- data/app/views/generic_content_objects/contributors/_edit_person.html.erb +37 -0
- data/app/views/generic_content_objects/contributors/_new.html.erb +10 -0
- data/app/views/generic_content_objects/contributors/_show_conference.html.erb +22 -0
- data/app/views/generic_content_objects/contributors/_show_organization.html.erb +22 -0
- data/app/views/generic_content_objects/contributors/_show_person.html.erb +38 -0
- data/app/views/generic_contents/_edit.html.erb +59 -0
- data/app/views/generic_contents/_index.html.erb +23 -0
- data/app/views/generic_contents/_show.html.erb +18 -0
- data/app/views/generic_contents/_show_content.html.erb +4 -0
- data/app/views/generic_images/_edit.html.erb +59 -0
- data/app/views/generic_images/_index.html.erb +24 -0
- data/app/views/generic_images/_show.html.erb +18 -0
- data/app/views/generic_images/_show_all.html.erb +14 -0
- data/app/views/generic_images/_show_content.html.erb +7 -0
- data/app/views/layouts/application.html.erb +57 -0
- data/app/views/layouts/hydra-head.html.erb +12 -0
- data/app/views/mods_assets/_edit.html.erb +49 -0
- data/app/views/mods_assets/_edit_description.html.erb +82 -0
- data/app/views/mods_assets/_edit_journal.html.erb +72 -0
- data/app/views/mods_assets/_index.html.erb +1 -0
- data/app/views/mods_assets/_index_list.html.erb +37 -0
- data/app/views/mods_assets/_index_table.html.erb +7 -0
- data/app/views/mods_assets/_progress_box.html.erb +82 -0
- data/app/views/mods_assets/_show.html.erb +44 -0
- data/app/views/mods_assets/_show_description.html.erb +44 -0
- data/app/views/mods_assets/_show_journal.html.erb +42 -0
- data/app/views/mods_assets/_show_permissions.html.erb +14 -0
- data/app/views/permissions/_edit_person_permissions.html.erb +35 -0
- data/app/views/permissions/_index.html.erb +55 -0
- data/app/views/permissions/_new.html.erb +18 -0
- data/app/views/permissions/index.html.erb +1 -0
- data/app/views/permissions/new.html.erb +1 -0
- data/app/views/shared/_delete_asset_confirmation.html.erb +17 -0
- data/app/views/user_sessions/_login_form.html.erb +10 -0
- data/app/views/user_sessions/logged_out.html.erb +1 -0
- data/config/routes.rb +12 -0
- data/fedora_conf/conf/fedora.fcfg +1021 -0
- data/hydra-head.gemspec +70 -0
- data/lib/application_controller.rb +25 -0
- data/lib/application_helper.rb +2 -0
- data/lib/engine.rb +30 -0
- data/lib/generators/hydra/head_generator.rb +152 -0
- data/lib/generators/hydra/templates/config/fedora.yml +17 -0
- data/lib/generators/hydra/templates/config/initializers/blacklight_config.rb +246 -0
- data/lib/generators/hydra/templates/config/initializers/fedora_config.rb +23 -0
- data/lib/generators/hydra/templates/config/initializers/hydra_config.rb +29 -0
- data/lib/generators/hydra/templates/config/role_map_cucumber.yml +10 -0
- data/lib/generators/hydra/templates/config/role_map_development.yml +12 -0
- data/lib/generators/hydra/templates/config/role_map_production.yml +2 -0
- data/lib/generators/hydra/templates/config/role_map_test.yml +15 -0
- data/lib/generators/hydra/templates/config/solr.yml +10 -0
- data/lib/generators/hydra/templates/config/solr_mappings.yml +22 -0
- data/lib/generators/hydra/templates/fedora_conf/conf/fedora.fcfg +1021 -0
- data/lib/generators/hydra/templates/migrations/add_user_attributes_table.rb +15 -0
- data/lib/generators/hydra/templates/migrations/create_superusers.rb +12 -0
- data/lib/generators/hydra/templates/solr_conf/conf/schema.xml +118 -0
- data/lib/generators/hydra/templates/solr_conf/conf/solrconfig.xml +332 -0
- data/lib/generators/hydra/templates/solr_conf/solr.xml +35 -0
- data/lib/hydra-head.rb +29 -0
- data/lib/hydra-head/engine.rb +9 -0
- data/lib/hydra-head/routes.rb +87 -0
- data/lib/hydra-head/version.rb +4 -0
- data/lib/hydra.rb +22 -0
- data/lib/hydra/access_controls_enforcement.rb +236 -0
- data/lib/hydra/access_controls_evaluation.rb +97 -0
- data/lib/hydra/assets_controller_helper.rb +144 -0
- data/lib/hydra/catalog.rb +64 -0
- data/lib/hydra/common_mods_index_methods.rb +42 -0
- data/lib/hydra/controller.rb +7 -0
- data/lib/hydra/file_assets_helper.rb +144 -0
- data/lib/hydra/fixtures.rb +43 -0
- data/lib/hydra/generic_content.rb +113 -0
- data/lib/hydra/generic_image.rb +100 -0
- data/lib/hydra/image.rb +177 -0
- data/lib/hydra/model_methods.rb +95 -0
- data/lib/hydra/model_mixins.rb +2 -0
- data/lib/hydra/model_mixins/common_metadata.rb +24 -0
- data/lib/hydra/model_mixins/mods_object.rb +16 -0
- data/lib/hydra/mods_article.rb +505 -0
- data/lib/hydra/mods_dataset.rb +165 -0
- data/lib/hydra/mods_generic_content.rb +494 -0
- data/lib/hydra/mods_image.rb +494 -0
- data/lib/hydra/repository_controller.rb +102 -0
- data/lib/hydra/rights_metadata.rb +189 -0
- data/lib/hydra/superuser_attributes.rb +12 -0
- data/lib/hydra/testing_server.rb +183 -0
- data/lib/hydra/user.rb +22 -0
- data/lib/mediashelf/active_fedora_helper.rb +72 -0
- data/lib/railties/all_tests.rake +23 -0
- data/lib/railties/hydra-fixtures.rake +184 -0
- data/lib/railties/hydra_jetty.rake +79 -0
- data/lib/railties/hyhead_cucumber.rake +127 -0
- data/lib/railties/hyhead_rspec.rake +137 -0
- data/lib/stanford/searchworks_helper.rb +1338 -0
- data/lib/stanford/solr_helper.rb +108 -0
- data/lib/uva/mods_index_methods.rb +24 -0
- data/solr_conf/conf/schema.xml +122 -0
- data/solr_conf/conf/solrconfig.xml +332 -0
- data/solr_conf/solr.xml +35 -0
- data/tasks/hydra-head-fixtures.rake +54 -0
- data/tasks/hydra-head.rake +247 -0
- data/tasks/hydra_jetty.rake +79 -0
- data/tasks/replicator.rake +27 -0
- data/tasks/solrizer-fedora.rake +53 -0
- data/tasks/solrizer.rake +13 -0
- data/test_support/etc/Gemfile +29 -0
- data/test_support/etc/rvmrc +32 -0
- data/test_support/features/button_add_assets.feature +22 -0
- data/test_support/features/button_add_generic_content.feature +11 -0
- data/test_support/features/button_add_image.feature +11 -0
- data/test_support/features/button_add_mods_asset.feature +11 -0
- data/test_support/features/contributor_add.feature +39 -0
- data/test_support/features/file_assets_list.feature +32 -0
- data/test_support/features/file_upload.feature +40 -0
- data/test_support/features/home_page.feature +9 -0
- data/test_support/features/html_validity.feature +47 -0
- data/test_support/features/mods_asset_contributors_edit.feature +80 -0
- data/test_support/features/mods_asset_create.feature +12 -0
- data/test_support/features/mods_asset_edit.feature +33 -0
- data/test_support/features/mods_asset_edit_without_permission.feature +10 -0
- data/test_support/features/mods_asset_search_result.feature +13 -0
- data/test_support/features/mods_asset_show.feature +39 -0
- data/test_support/features/permissions_add.feature +15 -0
- data/test_support/features/permissions_edit.feature +63 -0
- data/test_support/features/step_definitions/catalog_index_steps.rb +14 -0
- data/test_support/features/step_definitions/create_asset_steps.rb +7 -0
- data/test_support/features/step_definitions/edit_metadata_steps.rb +73 -0
- data/test_support/features/step_definitions/file_list_steps.rb +28 -0
- data/test_support/features/step_definitions/hydra_metadata_steps.rb +3 -0
- data/test_support/features/step_definitions/hydra_steps.rb +8 -0
- data/test_support/features/step_definitions/inline_editable_edit_steps.rb +77 -0
- data/test_support/features/step_definitions/search_steps.rb +88 -0
- data/test_support/features/step_definitions/searching_steps.rb +22 -0
- data/test_support/features/step_definitions/show_document_steps.rb +85 -0
- data/test_support/features/step_definitions/user_steps.rb +36 -0
- data/test_support/features/step_definitions/web_steps.rb +219 -0
- data/test_support/features/support/env.rb +55 -0
- data/test_support/features/support/paths.rb +80 -0
- data/test_support/features/switch_users.feature +14 -0
- data/test_support/features/view_catalog_index.feature +18 -0
- data/test_support/fixtures/empty_file.txt +0 -0
- data/test_support/fixtures/hydrangea_fixture_archivist_only_mods_article.foxml.xml +1212 -0
- data/test_support/fixtures/hydrangea_fixture_file_asset1.foxml.xml +4946 -0
- data/test_support/fixtures/hydrangea_fixture_mods_article1.foxml.xml +234 -0
- data/test_support/fixtures/hydrangea_fixture_mods_article2.foxml.xml +177 -0
- data/test_support/fixtures/hydrangea_fixture_mods_article3.foxml.xml +170 -0
- data/test_support/fixtures/hydrangea_fixture_mods_dataset1.foxml.xml +187 -0
- data/test_support/fixtures/hydrangea_fixture_uploaded_svg1.foxml.xml +676 -0
- data/test_support/fixtures/image.jp2 +0 -0
- data/test_support/fixtures/libra-oa_1.foxml.xml +2324 -0
- data/test_support/fixtures/libra-oa_2.foxml.xml +2422 -0
- data/test_support/spec/controllers/assets_controller_spec.rb +113 -0
- data/test_support/spec/controllers/catalog_controller_spec.rb +148 -0
- data/test_support/spec/controllers/catalog_controller_viewing_context_spec.rb +62 -0
- data/test_support/spec/controllers/contributors_controller_spec.rb +47 -0
- data/test_support/spec/controllers/file_assets_controller_spec.rb +189 -0
- data/test_support/spec/controllers/hydra_controller_spec.rb +15 -0
- data/test_support/spec/controllers/permissions_controller_spec.rb +80 -0
- data/test_support/spec/controllers/user_sessions_controller_spec.rb +35 -0
- data/test_support/spec/generators/hydra-head_generator_spec.rb +14 -0
- data/test_support/spec/helpers/access_controls_enforcement_spec.rb +212 -0
- data/test_support/spec/helpers/access_controls_evaluation_spec.rb +35 -0
- data/test_support/spec/helpers/assets_controller_helper_spec.rb +71 -0
- data/test_support/spec/helpers/blacklight_helper_spec.rb +64 -0
- data/test_support/spec/helpers/file_assets_helper_spec.rb +107 -0
- data/test_support/spec/helpers/hydra-repository_controller_spec.rb +32 -0
- data/test_support/spec/helpers/hydra_assets_helper_spec.rb +195 -0
- data/test_support/spec/helpers/hydra_djatoka_helper_spec.rb +32 -0
- data/test_support/spec/helpers/hydra_fedora_metadata_helper_spec.rb +215 -0
- data/test_support/spec/helpers/hydra_helper_spec.rb +73 -0
- data/test_support/spec/helpers/hydra_model_methods_spec.rb +95 -0
- data/test_support/spec/helpers/hydra_uploader_helper_spec.rb +18 -0
- data/test_support/spec/helpers/javascript_includes_helper_spec.rb +43 -0
- data/test_support/spec/integration/file_asset_spec.rb +150 -0
- data/test_support/spec/lib/active_fedora_helper_spec.rb +56 -0
- data/test_support/spec/lib/catalog_spec.rb +16 -0
- data/test_support/spec/lib/common_mods_index_methods_spec.rb +28 -0
- data/test_support/spec/models/audio_asset_spec.rb +23 -0
- data/test_support/spec/models/file_asset_spec.rb +42 -0
- data/test_support/spec/models/generic_content_spec.rb +29 -0
- data/test_support/spec/models/generic_image_spec.rb +58 -0
- data/test_support/spec/models/hydra_rights_metadata_spec.rb +162 -0
- data/test_support/spec/models/image_asset_spec.rb +23 -0
- data/test_support/spec/models/mods_asset_spec.rb +29 -0
- data/test_support/spec/models/role_mapper_spec.rb +22 -0
- data/test_support/spec/models/user_spec.rb +52 -0
- data/test_support/spec/models/video_asset_spec.rb +23 -0
- data/test_support/spec/rcov.opts +3 -0
- data/test_support/spec/spec.opts +4 -0
- data/test_support/spec/spec_helper.rb +44 -0
- data/test_support/spec/support/matchers/helper_matcher.rb +14 -0
- data/test_support/spec/support/matchers/solr_matchers.rb +60 -0
- data/test_support/spec/unit/hydra-head-engine_spec.rb +8 -0
- data/test_support/spec/unit/hydra-head_spec.rb +8 -0
- data/test_support/spec/utilities/hydra_testing_server_spec.rb +49 -0
- data/test_support/spec/views/uploader.html.erb_spec.rb +30 -0
- data/vendor/cache/RedCloth-4.2.3.gem +0 -0
- data/vendor/cache/abstract-1.0.0.gem +0 -0
- data/vendor/cache/actionmailer-3.0.9.gem +0 -0
- data/vendor/cache/actionpack-3.0.9.gem +0 -0
- data/vendor/cache/active-fedora-2.3.3.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/arel-2.0.10.gem +0 -0
- data/vendor/cache/blacklight-3.0.0.gem +0 -0
- data/vendor/cache/block_helpers-0.3.3.gem +0 -0
- data/vendor/cache/builder-2.1.2.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/columnize-0.3.4.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/curb-0.7.15.gem +0 -0
- data/vendor/cache/daemons-1.1.4.gem +0 -0
- data/vendor/cache/database_cleaner-0.6.7.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/erubis-2.6.6.gem +0 -0
- data/vendor/cache/facets-2.8.4.gem +0 -0
- data/vendor/cache/factory_girl-1.3.3.gem +0 -0
- data/vendor/cache/fastercsv-1.5.4.gem +0 -0
- data/vendor/cache/ffi-1.0.9.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/i18n-0.5.0.gem +0 -0
- data/vendor/cache/jettywrapper-0.0.10.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/kaminari-0.12.4.gem +0 -0
- data/vendor/cache/launchy-2.0.3.gem +0 -0
- data/vendor/cache/linecache-0.46.gem +0 -0
- data/vendor/cache/logger-1.2.8.gem +0 -0
- data/vendor/cache/mail-2.2.19.gem +0 -0
- data/vendor/cache/marc-0.4.3.gem +0 -0
- data/vendor/cache/mediashelf-loggable-0.4.2.gem +0 -0
- data/vendor/cache/mime-types-1.16.gem +0 -0
- data/vendor/cache/mocha-0.9.12.gem +0 -0
- data/vendor/cache/multipart-post-1.1.2.gem +0 -0
- data/vendor/cache/nokogiri-1.5.0.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/rack-mount-0.6.14.gem +0 -0
- data/vendor/cache/rack-test-0.5.7.gem +0 -0
- data/vendor/cache/rails-3.0.9.gem +0 -0
- data/vendor/cache/railties-3.0.9.gem +0 -0
- data/vendor/cache/rake-0.9.2.gem +0 -0
- data/vendor/cache/rbx-require-relative-0.0.5.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/rsolr-1.0.2.gem +0 -0
- data/vendor/cache/rsolr-ext-1.0.3.gem +0 -0
- data/vendor/cache/rspec-2.6.0.gem +0 -0
- data/vendor/cache/rspec-core-2.6.4.gem +0 -0
- data/vendor/cache/rspec-expectations-2.6.0.gem +0 -0
- data/vendor/cache/rspec-mocks-2.6.0.gem +0 -0
- data/vendor/cache/rspec-rails-2.6.1.gem +0 -0
- data/vendor/cache/ruby-debug-0.10.4.gem +0 -0
- data/vendor/cache/ruby-debug-base-0.10.4.gem +0 -0
- data/vendor/cache/rubyzip-0.9.4.gem +0 -0
- data/vendor/cache/sanitize-2.0.3.gem +0 -0
- data/vendor/cache/selenium-webdriver-0.2.2.gem +0 -0
- data/vendor/cache/solr-ruby-0.0.8.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/sqlite3-ruby-1.2.5.gem +0 -0
- data/vendor/cache/stomp-1.1.9.gem +0 -0
- data/vendor/cache/term-ansicolor-1.0.5.gem +0 -0
- data/vendor/cache/thor-0.14.6.gem +0 -0
- data/vendor/cache/treetop-1.4.9.gem +0 -0
- data/vendor/cache/trollop-1.16.2.gem +0 -0
- data/vendor/cache/tzinfo-0.3.29.gem +0 -0
- data/vendor/cache/unicode-0.4.0.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/vendor/cache/xpath-0.1.4.gem +0 -0
- data/vendor/cache/yard-0.7.2.gem +0 -0
- metadata +1110 -0
@@ -0,0 +1,10 @@
|
|
1
|
+
@pending @articles
|
2
|
+
Feature: Edit an article without permission
|
3
|
+
As a logged-in user
|
4
|
+
attempt to edit an article
|
5
|
+
without sufficient permissions
|
6
|
+
|
7
|
+
Scenario: Visit Document Edit Page
|
8
|
+
Given I am logged in as "archivist1@example.com"
|
9
|
+
And I am on the edit document page for hydrangea:fixture_mods_article2
|
10
|
+
Then I should see a "div" tag with a "class" attribute of "notice"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
@catalog @articles
|
2
|
+
Feature: Article Search Result
|
3
|
+
As a user
|
4
|
+
In order to find articles
|
5
|
+
I want to see appropriate information about articles in a search result
|
6
|
+
|
7
|
+
Scenario: Viewing search results
|
8
|
+
Given I am on the search page
|
9
|
+
And I fill in "q" with "1234-5678"
|
10
|
+
When I press "submit"
|
11
|
+
Then I should see a link to "the show document page for hydrangea:fixture_mods_article3"
|
12
|
+
And I should see "Test Article"
|
13
|
+
And I should see "Aug. 1, 1998"
|
@@ -0,0 +1,39 @@
|
|
1
|
+
@show @articles
|
2
|
+
Feature: Show a document
|
3
|
+
In order to [goal]
|
4
|
+
[stakeholder]
|
5
|
+
wants [behaviour]
|
6
|
+
|
7
|
+
Scenario: Public visit Publicly Viewable Document
|
8
|
+
Given I am on the show document page for hydrangea:fixture_mods_article1
|
9
|
+
Then I should see "ARTICLE TITLE"
|
10
|
+
And I should see "GIVEN NAMES"
|
11
|
+
And I should see "FAMILY NAME"
|
12
|
+
And I should see "FACULTY, UNIVERSITY"
|
13
|
+
And I should see "TOPIC 1"
|
14
|
+
And I should see "TOPIC 2"
|
15
|
+
And I should see "CONTROLLED TERM"
|
16
|
+
And I should not see a link to "the edit document page for hydrangea:fixture_mods_article1"
|
17
|
+
|
18
|
+
Scenario: Public visit Document Show Page for a private document
|
19
|
+
Given I am on the show document page for hydrangea:fixture_archivist_only_mods_article
|
20
|
+
Then I should be on the search page
|
21
|
+
And I should see "You do not have sufficient access privileges to read this document, which has been marked private" within ".notice"
|
22
|
+
|
23
|
+
@wip
|
24
|
+
Scenario: Superuser visits Document Show Page for a private document
|
25
|
+
Given I am a superuser
|
26
|
+
And I am on the show document page for hydrangea:fixture_archivist_only_mods_article
|
27
|
+
Then I should see "Article for Archivist Eyes Only"
|
28
|
+
|
29
|
+
Scenario: Archivist visits Show Page for Restricted Document
|
30
|
+
Given I am logged in as "archivist1@example.com"
|
31
|
+
And I am on the show document page for hydrangea:fixture_archivist_only_mods_article
|
32
|
+
Then I should see "Article for Archivist Eyes Only"
|
33
|
+
And I should see "Sally"
|
34
|
+
And I should see "Whocontributes"
|
35
|
+
And I should see "University of Contributions"
|
36
|
+
And I should see "contributing"
|
37
|
+
And I should see "exclusiveness"
|
38
|
+
And I should not see a link to "the edit document page for hydrangea:fixture_public_mods_article"
|
39
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
@permissions
|
2
|
+
Feature: Add Individual Permissions
|
3
|
+
As a user with edit permissions
|
4
|
+
In order to edit who has which levels of access to a document
|
5
|
+
I want to see and edit the object-level permissions for users and groups
|
6
|
+
|
7
|
+
Scenario: Editing group permissions
|
8
|
+
Given I am logged in as "archivist1@example.com"
|
9
|
+
And I am on the edit document page for hydrangea:fixture_mods_article1
|
10
|
+
And I fill in "permission_actor_id" with "cucumber_user"
|
11
|
+
And I select "Read & Download" from "permission_level"
|
12
|
+
When I press "Add Permissions"
|
13
|
+
Then I should see "cucumber_user has been granted read permissions for hydrangea:fixture_mods_article1"
|
14
|
+
And "Read & Download" should be selected from "cucumber_user" within "form#permissions_metadata"
|
15
|
+
And "Discover" should be selected from "Public" within "form#permissions_metadata"
|
@@ -0,0 +1,63 @@
|
|
1
|
+
@permissions
|
2
|
+
Feature: Edit Permissions
|
3
|
+
|
4
|
+
As a user with edit permissions
|
5
|
+
In order to edit who has which levels of access to a document
|
6
|
+
I want to see and edit the object-level permissions for users and groups
|
7
|
+
|
8
|
+
Background:
|
9
|
+
Given that "hydrangea:fixture_mods_article1" has been loaded into fedora
|
10
|
+
|
11
|
+
Scenario: Viewing group & individual permissions
|
12
|
+
Given I am logged in as "archivist1@example.com"
|
13
|
+
Given I am on the edit document page for hydrangea:fixture_mods_article1
|
14
|
+
Then the following should be selected within "form#permissions_metadata"
|
15
|
+
|Archivist | Edit & Upload |
|
16
|
+
|Researcher | No Access |
|
17
|
+
|researcher1 | Edit & Upload |
|
18
|
+
|Admin_policy_object_editor | No Access |
|
19
|
+
|Public | Discover |
|
20
|
+
|
21
|
+
Scenario: Editing group permissions on article edit page
|
22
|
+
Given I am logged in as "archivist1@example.com"
|
23
|
+
And I am on the edit document page for hydrangea:fixture_mods_article1
|
24
|
+
And the following should be selected within "form#permissions_metadata"
|
25
|
+
|Archivist | Edit & Upload |
|
26
|
+
|researcher1 | Edit & Upload |
|
27
|
+
|Admin_policy_object_editor | No Access |
|
28
|
+
|Public | Discover |
|
29
|
+
When I select the following within "form#permissions_metadata"
|
30
|
+
|Archivist | Edit & Upload |
|
31
|
+
|Admin_policy_object_editor | Discover |
|
32
|
+
|Patron | Edit |
|
33
|
+
And I press "Save Permissions"
|
34
|
+
Then I should see "The permissions have been updated."
|
35
|
+
And the following should be selected within "form#permissions_metadata"
|
36
|
+
|Archivist | Edit & Upload |
|
37
|
+
|Admin_policy_object_editor | Discover |
|
38
|
+
|Patron | Edit |
|
39
|
+
|Public | Discover |
|
40
|
+
|
41
|
+
Scenario: Editing group permissions on permissions index page
|
42
|
+
Given I am logged in as "archivist1@example.com"
|
43
|
+
And I am on the permissions page for hydrangea:fixture_mods_dataset1
|
44
|
+
When I select the following within "form#permissions_metadata"
|
45
|
+
|Archivist | Edit & Upload |
|
46
|
+
|Admin_policy_object_editor | Discover |
|
47
|
+
|Patron | Edit |
|
48
|
+
And I press "Save Permissions"
|
49
|
+
Then I should see "The permissions have been updated."
|
50
|
+
And the following should be selected within "form#permissions_metadata"
|
51
|
+
|Archivist | Edit & Upload |
|
52
|
+
|Admin_policy_object_editor | Discover |
|
53
|
+
|Patron | Edit |
|
54
|
+
|
55
|
+
Scenario: Viewing individual permissions with your own permissions hidden
|
56
|
+
Given I am logged in as "researcher1@example.com"
|
57
|
+
And I am on the edit document page for hydrangea:fixture_mods_article1
|
58
|
+
##
|
59
|
+
## This one fails because Capybara's selectors can't find "#individual_permissions"
|
60
|
+
##
|
61
|
+
# Then I should not see "researcher1" within "form#permissions_metadata"
|
62
|
+
|
63
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Given /^the following catalog_indices:$/ do |catalog_indices|
|
2
|
+
CatalogIndex.create!(catalog_indices.hashes)
|
3
|
+
end
|
4
|
+
|
5
|
+
When /^I delete the (\d+)(?:st|nd|rd|th) catalog_index$/ do |pos|
|
6
|
+
visit catalog_indices_url
|
7
|
+
within("table tr:nth-child(#{pos.to_i+1})") do
|
8
|
+
click_link "Destroy"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
Then /^I should see the following catalog_indices:$/ do |expected_catalog_indices_table|
|
13
|
+
expected_catalog_indices_table.diff!(tableish('table tr', 'td,th'))
|
14
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require "hydra/fixtures"
|
2
|
+
# This is the post-submission complement to "I fill in the following" from web_steps.rb
|
3
|
+
Then /^the following (should contain|contain|should not contain|do not contain):$/ do |bool,table|
|
4
|
+
# table is a Cucumber::Ast::Table
|
5
|
+
if bool == "should contain" || bool == "contain"
|
6
|
+
table.rows_hash.each do |name, value|
|
7
|
+
Then %{the "#{name}" field should contain "#{value}"}
|
8
|
+
end
|
9
|
+
elsif bool == "should not contain" || bool == "do not contain"
|
10
|
+
table.rows_hash.each do |name, value|
|
11
|
+
Then %{the "#{name}" field should not contain "#{value}"}
|
12
|
+
end
|
13
|
+
else
|
14
|
+
pending
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
When /^I select the following(?: within "([^"]*)")?$/ do |scope_selector, table|
|
19
|
+
# table is a Cucumber::Ast::Table
|
20
|
+
table.rows_hash.each do |field_selector, value|
|
21
|
+
Given %{I select "#{value}" from "#{field_selector}" within "#{scope_selector}"}
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
Then /^the following should be selected(?: within "([^"]*)")?$/ do |scope_selector, table|
|
26
|
+
# table is a Cucumber::Ast::Table
|
27
|
+
table.rows_hash.each do |field_selector, value|
|
28
|
+
Then %{"#{value}" should be selected from "#{field_selector}" within "#{scope_selector}"}
|
29
|
+
# Then %{the "#{field_selector}" field within "#{scope_selector}" should contain "#{value}"}
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
Then /^"([^"]*)" should be selected from "([^"]*)"(?: within "([^"]*)")?$/ do |value, field_selector, scope_selector|
|
34
|
+
# table is a Cucumber::Ast::Table
|
35
|
+
with_scope(scope_selector) do
|
36
|
+
find_and_check_selected_value(field_selector, value)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
Then /^I should see a "([^"]*)" button(?: within "([^"]*)")?$/ do |button_locator, scope_selector|
|
41
|
+
with_scope(scope_selector) do
|
42
|
+
begin
|
43
|
+
find_button(button_locator)
|
44
|
+
rescue
|
45
|
+
raise "no button with value or id or text '#{button_locator}' found"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
Given /^that "([^"]*)" has been loaded into fedora$/ do |pid|
|
51
|
+
Hydra::Fixtures.reload(pid)
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
|
56
|
+
# Find a select tag on the page
|
57
|
+
# @param [String] locator Capybara locator
|
58
|
+
# @return [Capybara::Node]
|
59
|
+
def find_select(locator)
|
60
|
+
no_select_msg = "no select box with id, name, or label '#{locator}' found"
|
61
|
+
select = find(:xpath, XPath::HTML.select(locator), :message => no_select_msg)
|
62
|
+
return select
|
63
|
+
end
|
64
|
+
|
65
|
+
# Find a select tag on the page and test whether the given value is selected within it
|
66
|
+
# @param [String] locator Capybara locator for the select tag
|
67
|
+
# @param [String] value the value that should be selected
|
68
|
+
def find_and_check_selected_value(locator, value)
|
69
|
+
select = find_select(locator)
|
70
|
+
no_option_msg = "no option with text '#{value}' in select box '#{locator}'"
|
71
|
+
option = select.find(:xpath, XPath::HTML.option(value), :message => no_option_msg)
|
72
|
+
option.should be_selected
|
73
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
|
2
|
+
Then /^I (should|should not) see "([^"]*)" in the file assets list$/ do |bool, arg|
|
3
|
+
with_scope("#file_assets") do
|
4
|
+
if bool == "should"
|
5
|
+
Then %{I should see "#{arg}"}
|
6
|
+
else
|
7
|
+
Then %{I should not see "#{arg}"}
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
|
13
|
+
Then /^I should see a link to "([^"]*)" in the file assets list$/ do |link_name|
|
14
|
+
with_scope("#file_assets") do
|
15
|
+
Then %{I should see a link called "#{link_name}"}
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
|
20
|
+
Then /^I (should|should not) see a link to "([^"]*)" with label "([^"]*)" in the file assets list$/ do |bool, link_name, label_name|
|
21
|
+
with_scope("#file_assets") do
|
22
|
+
if bool == "should"
|
23
|
+
Then %{I should see a link to "#{link_name}" with label "#{label_name}"}
|
24
|
+
else
|
25
|
+
Then %{I should not see a link to "#{link_name}" with label "#{label_name}"}
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# This is borrowed from blacklight's record_view_steps.rb
|
2
|
+
Then /^I (should|should not) see an? "([^\"]*)" element containing "([^\"]*)"$/ do |bool,elem,content|
|
3
|
+
if bool == "should"
|
4
|
+
page.should have_selector("#{elem}",:content => content)
|
5
|
+
else
|
6
|
+
page.should_not have_selector("#{elem}",:content => content)
|
7
|
+
end
|
8
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
|
2
|
+
|
3
|
+
Then /^I should see an inline edit containing "([^"]*)"$/ do |arg1|
|
4
|
+
page.should have_selector(".editable-text", :content=>arg1)
|
5
|
+
end
|
6
|
+
|
7
|
+
Then /^the "([^\"]*)" inline edit should contain "([^\"]*)"$/ do |arg1, arg2|
|
8
|
+
page.should have_selector("dt", :content=>arg1) do |dt|
|
9
|
+
dt.each do |term|
|
10
|
+
term.next_element.should have_selector("dd span") do |editable|
|
11
|
+
editable.should have_selector(".editable-text", :content=>arg2)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
Then /^the "([^\"]*)" inline edit should be empty$/ do |arg1|
|
18
|
+
page.should have_selector("dt", :text=>arg1) do |dt|
|
19
|
+
dt.each do |term|
|
20
|
+
term.next_element.should have_selector("dd .editable-container") do |editable|
|
21
|
+
editable.should have_selector(".editable-edit", :content=>nil)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
Then /^the "([^\"]*)" inline date edit should contain "([^\"]*)"$/ do |arg1, arg2|
|
28
|
+
page.should have_selector("dt", :content=>arg1) do |dt|
|
29
|
+
dt.each do |term|
|
30
|
+
term.next_element.should have_selector("dd div.date-select") do |editable_date_picker|
|
31
|
+
editable_date_picker.should have_selector("input.controlled-date-part", :value=>arg2)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
# This was failing on some computers that displayed "selected" instead of "selected='selected'", so we made it an option in the next step definition
|
38
|
+
Then /^the "([^\"]*)" dropdown edit should be set to "([^\"]*)"$/ do |arg1, arg2|
|
39
|
+
page.should have_selector("dt", :content=>arg1) do |dt|
|
40
|
+
dt.each do |term|
|
41
|
+
term.next_element.should have_selector("select") do |dropdown|
|
42
|
+
dropdown.should have_selector("option", :content=>arg2, :selected=>"selected")
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
Then /^the "([^\"]*)" dropdown edit should contain "([^\"]*)" as an option$/ do |arg1, arg2|
|
49
|
+
page.should have_selector("dt", :content=>arg1) do |dt|
|
50
|
+
dt.each do |term|
|
51
|
+
term.next_element.should have_selector("select") do |dropdown|
|
52
|
+
dropdown.should have_selector("option", :content=>arg2)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
Then /^the "([^\"]*)" inline textarea edit should contain "([^\"]*)"$/ do |arg1, arg2|
|
59
|
+
page.should have_selector("dt", :content=>arg1) do |dt|
|
60
|
+
dt.each do |term|
|
61
|
+
term.next_element.should have_selector("dd ol li.editable_textarea") do |editable_textarea|
|
62
|
+
editable_textarea.should have_selector(".flc-inlineEdit-text", :content=>arg2)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
Then /^the "([^\"]*)" inline textarea edit should be empty$/ do |arg1|
|
69
|
+
page.should have_selector("dt", :content=>arg1) do |dt|
|
70
|
+
dt.each do |term|
|
71
|
+
term.next_element.should have_selector("dd ol li.editable_textarea") do |editable_textarea|
|
72
|
+
editable_textarea.should have_selector(".flc-inlineEdit-text", :content=>nil)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
@@ -0,0 +1,88 @@
|
|
1
|
+
# User added
|
2
|
+
Then /^I should see a search field$/ do
|
3
|
+
page.should have_tag("input#q")
|
4
|
+
end
|
5
|
+
|
6
|
+
Then /^I should see a selectable list with field choices$/ do
|
7
|
+
page.should have_tag("select#search_field")
|
8
|
+
end
|
9
|
+
|
10
|
+
Then /^I should see a selectable list with per page choices$/ do
|
11
|
+
page.should have_tag("select#per_page")
|
12
|
+
end
|
13
|
+
|
14
|
+
# Using the same step definition from edit_metadata_steps.rb
|
15
|
+
#
|
16
|
+
# Then /^I should see a "([^\"]*)" button$/ do |label|
|
17
|
+
# page.should have_tag("input[type=?][value=?]", 'submit', label)
|
18
|
+
# end
|
19
|
+
|
20
|
+
Then /^I should not see the "([^\"]*)" element$/ do |id|
|
21
|
+
page.should_not have_tag("##{id}")
|
22
|
+
end
|
23
|
+
|
24
|
+
Then /^I should see the "([^\"]*)" element$/ do |id|
|
25
|
+
page.should have_tag("##{id}")
|
26
|
+
end
|
27
|
+
|
28
|
+
Given /^the application is configured to have searchable fields "([^\"]*)" with values "([^\"]*)"$/ do |fields, values|
|
29
|
+
labels = fields.split(", ")
|
30
|
+
values = values.split(", ")
|
31
|
+
combined = labels.zip(values)
|
32
|
+
Blacklight.config[:search_fields] = []
|
33
|
+
combined.each do |pair|
|
34
|
+
Blacklight.config[:search_fields] << pair
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
Then /^I should see select list "([^\"]*)" with field labels "([^\"]*)"$/ do |list_css, names|
|
39
|
+
page.should have_tag(list_css) do
|
40
|
+
labels = names.split(", ")
|
41
|
+
labels.each do |label|
|
42
|
+
with_tag('option', label)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
Then /^I should see select list "([^\"]*)" with "([^\"]*)" selected$/ do |list_css, label|
|
48
|
+
page.should have_tag(list_css) do |e|
|
49
|
+
with_tag("[selected=selected]", {:count => 1}) do
|
50
|
+
with_tag("option", {:count => 1, :text => label})
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# Results Page
|
56
|
+
Given /^the application is configured to have sort fields "([^\"]*)" with values "([^\"]*)"$/ do |fields, values|
|
57
|
+
labels = fields.split(", ")
|
58
|
+
values = values.split(", ")
|
59
|
+
combined = labels.zip(values)
|
60
|
+
Blacklight.config[:sort_fields] = []
|
61
|
+
combined.each do |pair|
|
62
|
+
Blacklight.config[:sort_fields] << pair
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
Then /^I should get results$/ do
|
67
|
+
page.should have_selector("div.document")
|
68
|
+
end
|
69
|
+
|
70
|
+
Then /^I should not get results$/ do
|
71
|
+
page.should_not have_selector("div.document")
|
72
|
+
end
|
73
|
+
|
74
|
+
Then /^I should see the applied filter "([^\"]*)" with the value "([^\"]*)"$/ do |filter, text|
|
75
|
+
page.should have_tag("div#facets div") do |node|
|
76
|
+
node.should have_selector("h3", :content => filter)
|
77
|
+
node.should have_selector("span.selected", :content => text)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# Then /^I should see the applied filter "([^\"]*)" with the value
|
82
|
+
# "([^\"]*)"$/ do |filter, text|
|
83
|
+
# page.should have_tag("div#facets div") do |node|
|
84
|
+
# node.should have_selector("h3", :content => filter)
|
85
|
+
# node.should have_selector("span.selected", :content => /#{text}.*/)
|
86
|
+
# end
|
87
|
+
# end
|
88
|
+
|