krikri 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/krikri/application.css +15 -0
- data/app/controllers/krikri/providers_controller.rb +27 -0
- data/app/controllers/krikri/qa_reports_controller.rb +28 -0
- data/app/controllers/krikri/records_controller.rb +29 -5
- data/app/controllers/krikri/reports_controller.rb +24 -0
- data/app/controllers/krikri/validation_reports_controller.rb +11 -29
- data/app/helpers/krikri/application_helper.rb +62 -0
- data/app/helpers/krikri/records_helper.rb +14 -0
- data/app/helpers/krikri/reports_helper.rb +16 -0
- data/app/models/krikri/activity.rb +27 -0
- data/app/models/krikri/provider.rb +80 -0
- data/app/models/krikri/qa_report.rb +238 -0
- data/app/models/krikri/validation_report.rb +62 -0
- data/app/views/krikri/providers/index.html.erb +18 -0
- data/app/views/krikri/providers/show.html.erb +21 -0
- data/app/views/krikri/qa_reports/index.html.erb +12 -0
- data/app/views/krikri/qa_reports/show.html.erb +1 -0
- data/app/views/krikri/records/index.html.erb +0 -2
- data/app/views/krikri/records/show.html.erb +12 -9
- data/app/views/krikri/reports/_qa_report_list.html.erb +13 -0
- data/app/views/krikri/reports/_validation_report_list.html.erb +10 -0
- data/app/views/krikri/reports/index.html.erb +11 -0
- data/app/views/krikri/shared/_flash_message.html.erb +1 -0
- data/app/views/krikri/shared/_navigation.html.erb +38 -8
- data/app/views/krikri/validation_reports/_validation_report.html.erb +23 -0
- data/app/views/krikri/validation_reports/show.html.erb +19 -0
- data/config/routes.rb +6 -2
- data/config/settings/development.yml +6 -0
- data/config/settings/test.yml +9 -0
- data/db/migrate/20150328035550_add_qa_report.rb +11 -0
- data/lib/generators/krikri/templates/schema.xml +36 -36
- data/lib/krikri/engine.rb +10 -0
- data/lib/krikri/enricher.rb +14 -15
- data/lib/krikri/entity_behavior.rb +40 -0
- data/lib/krikri/entity_behaviors/aggregation_entity_behavior.rb +29 -0
- data/lib/krikri/entity_behaviors/original_record_entity_behavior.rb +26 -0
- data/lib/krikri/entity_consumer.rb +48 -0
- data/lib/krikri/harvester.rb +8 -0
- data/lib/krikri/indexer.rb +46 -0
- data/lib/krikri/mapper.rb +25 -9
- data/lib/krikri/qa_query_client.rb +154 -0
- data/lib/krikri/random_search_index_document_builder.rb +41 -0
- data/lib/krikri/search_index.rb +326 -0
- data/lib/krikri/search_results_helper_behavior.rb +2 -29
- data/lib/krikri/software_agent.rb +15 -0
- data/lib/krikri/solr_response_builder.rb +14 -0
- data/lib/krikri/version.rb +1 -1
- data/lib/krikri.rb +5 -0
- data/lib/tasks/krikri.rake +10 -11
- data/spec/controllers/application_controller_spec.rb +5 -0
- data/spec/controllers/providers_controller_spec.rb +37 -0
- data/spec/controllers/qa_reports_controller_spec.rb +69 -0
- data/spec/controllers/records_controller_spec.rb +73 -0
- data/spec/controllers/reports_controller_spec.rb +56 -0
- data/spec/controllers/validation_reports_controller_spec.rb +4 -5
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +207 -0
- data/spec/factories/krikri_activities.rb +34 -10
- data/spec/factories/krikri_provider.rb +8 -0
- data/spec/factories/krikri_qa_report.rb +7 -0
- data/spec/helpers/krikri/application_helper_spec.rb +43 -0
- data/spec/helpers/krikri/records_helper_spec.rb +15 -3
- data/spec/internal/Gemfile +3 -4
- data/spec/internal/Gemfile.lock +59 -37
- data/spec/internal/app/assets/javascripts/application.js +1 -1
- data/spec/internal/config/initializers/blacklight_initializer.rb +1 -1
- data/spec/internal/config/initializers/devise.rb +2 -2
- data/spec/internal/config/secrets.yml +2 -2
- data/spec/internal/db/development.sqlite3 +0 -0
- data/spec/internal/db/migrate/{20150320153132_devise_create_users.rb → 20150403220331_devise_create_users.rb} +0 -0
- data/spec/internal/db/migrate/{20150320153151_create_searches.blacklight.rb → 20150403220354_create_searches.blacklight.rb} +0 -0
- data/spec/internal/db/migrate/{20150320153152_create_bookmarks.blacklight.rb → 20150403220355_create_bookmarks.blacklight.rb} +0 -0
- data/spec/internal/db/migrate/{20150320153153_add_polymorphic_type_to_bookmarks.blacklight.rb → 20150403220356_add_polymorphic_type_to_bookmarks.blacklight.rb} +0 -0
- data/spec/internal/db/schema.rb +9 -1
- data/spec/internal/db/test.sqlite3 +0 -0
- data/spec/internal/log/development.log +88 -83
- data/spec/internal/log/test.log +3229 -83003
- data/spec/internal/tmp/cache/assets/test/sass/{b28605b1c659cf09fc72f3c1fff32918869d28b8 → 6449c927c92ef1ea4378c66161e3b0efe1bf954d}/_bootstrap-sprockets.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b28605b1c659cf09fc72f3c1fff32918869d28b8 → 6449c927c92ef1ea4378c66161e3b0efe1bf954d}/_bootstrap.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{93e201cf4a11978a1f491a057a3bd569c3825210 → 71fba6bdfa89d88fe8a72b36eafd3b91cf10a6d0}/blacklight.css.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_alerts.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_background-variant.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_border-radius.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_buttons.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_center-block.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_clearfix.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_forms.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_gradients.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_grid-framework.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_grid.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_hide-text.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_image.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_labels.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_list-group.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_nav-divider.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_nav-vertical-align.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_opacity.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_pagination.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_panels.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_progress-bar.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_reset-filter.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_resize.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_responsive-visibility.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_size.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_tab-focus.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_table-row.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_text-emphasis.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_text-overflow.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{4a3ee647961c7e45976eb2c0a94406aad3427b3d → 75eb48b5361d55a8133e0091d663a085dacee3c5}/_vendor-prefixes.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{ca8c12d03785e0d6cd4554f4d3939e7836d38282 → 78e0580c292179fc5fdd7b74b703dad1702b4176}/_blacklight_base.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{ca8c12d03785e0d6cd4554f4d3939e7836d38282 → 78e0580c292179fc5fdd7b74b703dad1702b4176}/_bookmark.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{ca8c12d03785e0d6cd4554f4d3939e7836d38282 → 78e0580c292179fc5fdd7b74b703dad1702b4176}/_catalog.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{ca8c12d03785e0d6cd4554f4d3939e7836d38282 → 78e0580c292179fc5fdd7b74b703dad1702b4176}/_facets.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{ca8c12d03785e0d6cd4554f4d3939e7836d38282 → 78e0580c292179fc5fdd7b74b703dad1702b4176}/_group.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{ca8c12d03785e0d6cd4554f4d3939e7836d38282 → 78e0580c292179fc5fdd7b74b703dad1702b4176}/_header.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{ca8c12d03785e0d6cd4554f4d3939e7836d38282 → 78e0580c292179fc5fdd7b74b703dad1702b4176}/_layout.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{ca8c12d03785e0d6cd4554f4d3939e7836d38282 → 78e0580c292179fc5fdd7b74b703dad1702b4176}/_modal.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{ca8c12d03785e0d6cd4554f4d3939e7836d38282 → 78e0580c292179fc5fdd7b74b703dad1702b4176}/_search_history.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{ca8c12d03785e0d6cd4554f4d3939e7836d38282 → 78e0580c292179fc5fdd7b74b703dad1702b4176}/blacklight.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{ca8c12d03785e0d6cd4554f4d3939e7836d38282 → 78e0580c292179fc5fdd7b74b703dad1702b4176}/blacklight_defaults.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_alerts.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_badges.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_breadcrumbs.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_button-groups.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_buttons.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_carousel.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_close.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_code.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_component-animations.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_dropdowns.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_forms.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_glyphicons.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_grid.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_input-groups.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_jumbotron.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_labels.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_list-group.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_media.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_mixins.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_modals.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_navbar.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_navs.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_normalize.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_pager.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_pagination.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_panels.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_popovers.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_print.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_progress-bars.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_responsive-embed.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_responsive-utilities.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_scaffolding.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_tables.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_thumbnails.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_tooltip.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_type.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_utilities.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_variables.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{a1ec1bb9c9cafeb054d542e861ebc8ffd5904439 → f79e9f3544f6b8d5f7ca05529260dceec8dd44ed}/_wells.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/05604ccd7329b6afb8e7cdafbaa09fe3 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/0b3850cd2568d76d8583e8e6bffa44d9 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/0dffbe192bade10cf2b568c73695e96e +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/0e349883625d7536c00fac0eafde4415 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/0f05dd42159c418ddcfa12edd10d98bb +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{ab2a05b91d7d316d4ceb47ce067006fb → 11b7eeb5da37de1c315d886349adbc98} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/16648e86ab6ef2950f3630ff0d566409 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/1877c8233ee501d08788d7324a70bd70 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/1c814c5c5dfd63768fff312c442847d6 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/1e699d4d1e439eeb1d52a210573f5053 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/2c58fb6a2406edc8067b46ee33af7262 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/2d0220441d85355dcd9ade523f95c048 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{3cc20a63495e66e9251101ccfb0d389c → 39329b3558b9f58b0d4e43621aeaa8c2} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/39ed74e4d194593ec48c481d0fd76007 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/40271adcb3c4654dcb20b55abc2505c9 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/402ffe46f4586abacce366e0e3f690d8 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{43da966542fafc2a4c768be78527391c → 46ec3d34d3576e4452b0a95b87176996} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{9f68eb44ffcb9dd95623c179300414fd → 4a9e62d054a09c7c8e486f73bd032bdc} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/4c5e3966eae6a44e852dcf449c3f4cb0 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/52ce034583a746333fd7b8aa3916b8e1 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/52fe40fddbd8e73f6743866d4930bde6 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{f3935581a84aba9a499005ed6a8e18be → 53329c49c9b4ba25d31c73c9b98260b0} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{c9efce42580b0ad0374a052aa61f2a07 → 59b1fd64c6fc18a82465ad6fdc7094fa} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/677fd27eda24da657f51d725742582f3 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/6b2c5572f9e2cd322ad7b2878673d0dd +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/735621cd88de5e37980cced4fb13ded9 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/7e4f29f7a7327f10677cd047be78cf8a +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{350a65d446eb7398f96d102f7a1a6d69 → 7f804c48c333d9758fa49ff9331b78e2} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/806c560c2f6e89ba0ad39561804ff79c +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{f3e7729c53b8a2c408086a61b58922ae → 82dd05a187bccd30f62fabb16491fe03} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{f74af03e26e893af40b07a6d0f970cd4 → 82de1c42365fd1cf6a2adc2f644150c1} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{813e23719129cf9f19349f720bebdf70 → 853ad370adfaa0da7ec26f51b89421f1} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/857d45eb67a43a30a6d5d0370464e596 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/8da6b6aafe413b1ba635e82f71c194be +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{b1a42de74c934edd0e5eed0f98a23597 → 8ea9ff17090b736331312d04c8036810} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{d1bce36d6e3ab792562b9c929f2ce897 → 8fad7abbbfbb3748b36d73dfb482c2bd} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/9181f512b689ddb01d6778bac83791ac +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{b660ec1ede271559cfd0259eed96ae9c → 92c82efebbff4c3a9f96e08b308e92dd} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/93aaa9231a32901266b05632f3d35ecd +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{8ad5c3dc0f5fcc5d7a775d6294dda9f5 → 93c6b8da8f3373c42510a25694457483} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{bb92f4b8c1bedafe60b6f226b549138a → 93dd91f6519f569f11fddf4df22460d9} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/9443255223294f7ad9ad6daba446afc3 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/96ff03d6a5f9604c6980874bb00c1d17 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/9ca9885875e2e0ab4e531cba60aa03e5 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{41b62fb10530766b5b9fef3338f5f30b → a13d3a27038cf6570d22b54c54442642} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{ba078b29a7f067b3acdd538a286235a8 → aa92d8a74950d2d6217a51424ce4b33b} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/ad4a54c43c2a4c3874bfde1c9f08c248 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{30ca7caa200fa8eaddaef443913ad9ad → b146aa842b38c17ed4117b2f52d4b51f} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b37776526b5809e55fbb0add6d059127 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{db0d9534ecdebba33af5d1d81060e855 → b6d54919d5e4a3921287a5fb178dc455} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/c514fd002d57ddf3d94669e369d45283 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{b225d67626669cb154cbe08a3c439d48 → cd59839c2fc0d494ffa76ef4c4dbfa42} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{b3ae9e3cdd9991d7103b0a00e33b5778 → d32e733978c8eb7c7db3ec2b865ee87f} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/d6995317fba3b6344c75db70b8c997e2 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{ecfc314951b349e27742c1b26880619e → d7bf17ad1471147b5314b4dda0bad9fe} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{9ce190f082dc4fb74bddb818cc011ce6 → e6a1afebb687728d619fe27e84335d2f} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{19f4ba6fa86d2609c171da9f5ee3b11a → e83c10c393da1c028c7d4217ecfc9c03} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/f64fd792a429f69332c1489015953219 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{fa11f1beb15b0f04503ce1f06701a8bf → f7a87683461c3a58ee9b6e9546473c4e} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{4e93570db72bb61820711448b78d548d → fed76e6bd857a06488c186874bbe2bb2} +0 -0
- data/spec/krikri_spec.rb +8 -0
- data/spec/lib/krikri/aggregation_entity_behavior_spec.rb +37 -0
- data/spec/lib/krikri/enricher_spec.rb +38 -1
- data/spec/lib/krikri/entity_consumer_spec.rb +27 -0
- data/spec/lib/krikri/indexer_spec.rb +48 -0
- data/spec/lib/krikri/mapper_agent_spec.rb +54 -40
- data/spec/lib/krikri/qa_query_client_spec.rb +120 -0
- data/spec/lib/krikri/random_search_index_docmument_builder_spec.rb +31 -0
- data/spec/lib/krikri/search_index_spec.rb +547 -0
- data/spec/models/activity_spec.rb +19 -0
- data/spec/models/provider_spec.rb +119 -0
- data/spec/models/qa_report_spec.rb +102 -0
- data/spec/models/validation_report_spec.rb +49 -0
- data/spec/spec_helper.rb +8 -0
- data/spec/support/shared_contexts/entities_query.rb +22 -0
- data/spec/support/shared_contexts/indexed_item.rb +27 -0
- data/spec/support/shared_contexts/provenance_query_client.rb +15 -2
- data/spec/views/krikri/providers/index.html.erb_spec.rb +23 -0
- data/spec/views/krikri/providers/show.html.erb_spec.rb +22 -0
- data/spec/views/krikri/qa_reports/index.html.erb_spec.rb +42 -0
- data/spec/views/krikri/qa_reports/show.html.erb_spec.rb +5 -0
- data/spec/views/krikri/records/index.html.erb_spec.rb +5 -0
- data/spec/views/krikri/records/show.html.erb_spec.rb +49 -0
- data/spec/views/krikri/reports/index.html.erb_spec.rb +26 -0
- metadata +501 -593
- data/app/controllers/krikri/report_lists_controller.rb +0 -10
- data/app/helpers/krikri/validation_reports_helper.rb +0 -5
- data/app/models/krikri/harvesters/oai_harvester.rb~ +0 -10
- data/app/models/krikri/original_record_desc.rb~ +0 -6
- data/app/models/krikri/original_record_metadata.rb~ +0 -9
- data/app/models/krikri/parser.rb~ +0 -5
- data/app/models/krikri/parsers/xml_parser.rb~ +0 -5
- data/app/views/krikri/report_lists/_validation_report_list.html.erb +0 -14
- data/app/views/krikri/report_lists/index.html.erb +0 -5
- data/app/views/krikri/validation_reports/_document_list.html.erb +0 -18
- data/app/views/krikri/validation_reports/_search_header.html.erb +0 -1
- data/app/views/krikri/validation_reports/_zero_results.html.erb +0 -1
- data/app/views/krikri/validation_reports/index.html.erb +0 -18
- data/config/initializers/config.rb~ +0 -19
- data/config/settings/test.yml~ +0 -3
- data/lib/aggregation.rb~ +0 -4
- data/lib/blacklight.rb~ +0 -8
- data/lib/krikri/enrichment.rb~ +0 -5
- data/lib/krikri/enrichment_agent.rb~ +0 -11
- data/lib/krikri/enrichment_agent_spec.rb~ +0 -2
- data/lib/krikri/enrichment_job.rb~ +0 -13
- data/lib/krikri/enrichments/dedup_values.rb~ +0 -7
- data/lib/krikri/enrichments/strip_ending_punctuation.rb~ +0 -18
- data/lib/krikri/enrichments/strip_leading_colons.rb~ +0 -15
- data/lib/krikri/enrichments/strip_leading_punctuation.rb~ +0 -18
- data/lib/krikri/enrichments.rb~ +0 -4
- data/lib/krikri/field_enrichment.rb~ +0 -3
- data/lib/krikri/harvesters/api_harvester.rb~ +0 -44
- data/lib/krikri/harvesters/basic_save_behavior.rb~ +0 -1
- data/lib/krikri/harvesters/file_harvester.rb~ +0 -4
- data/lib/krikri/harvesters/harvest_behavior.rb~ +0 -14
- data/lib/krikri/harvesters/mdl_api_harvester.rb~ +0 -7
- data/lib/krikri/harvesters/mdl_harvester.rb~ +0 -4
- data/lib/krikri/harvesters/oai_skip_deleted_behavior.rb~ +0 -17
- data/lib/krikri/id_minter.rb~ +0 -8
- data/lib/krikri/id_service.rb~ +0 -4
- data/lib/krikri/index_service.rb +0 -128
- data/lib/krikri/ldp/container.rb~ +0 -22
- data/lib/krikri/ldp/nr_source.rb~ +0 -4
- data/lib/krikri/ldp/rdf_source.rb~ +0 -24
- data/lib/krikri/ldp/resource.rb~ +0 -49
- data/lib/krikri/mapping_dsl.rb~ +0 -4
- data/lib/krikri/mapping_job.rb~ +0 -13
- data/lib/krikri/md5_minter.rb~ +0 -8
- data/lib/krikri/parsers/json_parser.rb~ +0 -17
- data/lib/krikri/parsers/oai_headers.rb~ +0 -4
- data/lib/krikri/parsers/oai_parser.rb~ +0 -2
- data/lib/krikri/parsers/oai_parser_headers.rb~ +0 -4
- data/lib/krikri/parsers/xml_parser.rb~ +0 -61
- data/lib/krikri/provenance_query.rb~ +0 -4
- data/lib/krikri/provenance_query_client.rb~ +0 -11
- data/lib/krikri/random_record_generator.rb +0 -19
- data/lib/krikri/util/edtf_converter.rb~ +0 -26
- data/lib/krikri/util/extended_date_parser.rb~ +0 -70
- data/lib/krikri/validation_report_list.rb +0 -61
- data/lib/tasks/jetty.rake~ +0 -12
- data/lib/tasks/krikri.rake~ +0 -20
- data/spec/factories/krikri_original_record.rb~ +0 -5
- data/spec/internal/lib/generators/test_app_generator.rb~ +0 -14
- data/spec/internal/tmp/cache/assets/test/sprockets/059eceaa18e2eaee3d5168f3949f4957 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/093d898bf3f20b26b13c82714a77c040 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/10517c9579f8d23c82fb8caa66dca6a7 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/2bec18569db80effd80a2a19a038100b +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/4052820c15af72ba690230a0f92bd75e +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/421c89c58d3e76046a0294dae1f731ff +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/496a0d7dce1ff6bf4a9c3a089ea3a635 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/50b9db0b908b421a9b941a445dbaeacc +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/5155772cce704d83a64aa83eeda20c5a +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/528c628cf107f8be6dd122e1154344be +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/5ed02c7072bb024fa0832a1ca4113227 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/60141dc3d16c502963c3d798a099862d +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/6df5b5c0a8e6d87ced9504a460df875e +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/6eefd2765a716d66ff857cfcda69a119 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/88ded10f28177bec1bddb0d72d6b1cd2 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/8edfca9082e02111be92e79000667f22 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/90b54a819800edfa41b67722d1561040 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/9c653367feff82588eb6041d783a5809 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b1c03c36188b4f58f819510adb9a7e9c +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b35e12934e9f05662777579549e31cd7 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b42c247628daaf44109584724682a6ad +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/bb108ef3fc4c96d1c20cc41f97d943a0 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/c644ecad928e076f999e9c9a3bc350c9 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/c78dd20a0df27e9394a413bf2e4abf92 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/d24a7c4b8ac71a90e809881a64970898 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/dbba4bbc32c17ade3d618c5d0baeb371 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/e8276b98892dcac8285a592bb63fe75b +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/e9f7ccc553ce1a217709cc7a08cfb032 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/eddae0741d973a8ab3df27c1ea5b635e +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/f274b5f22db177b6464b50691d531688 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/f45dfdb34e84d3c72a3319399a7316a3 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/faac2909046aa87e1f1f08b2bf0ad2b2 +0 -0
- data/spec/krikri_spec.rb~ +0 -30
- data/spec/ldp/active_triples_spec.rb~ +0 -15
- data/spec/ldp/at_resource_spec.rb~ +0 -41
- data/spec/ldp/nr_source_spec.rb~ +0 -3
- data/spec/ldp/rdf_source_spec.rb~ +0 -4
- data/spec/ldp/resource_spec.rb~ +0 -49
- data/spec/lib/krikri/enrichment_agent_spec.rb~ +0 -4
- data/spec/lib/krikri/enrichments/capitalize_spec.rb~ +0 -24
- data/spec/lib/krikri/enrichments/dedup_values_spec.rb~ +0 -10
- data/spec/lib/krikri/enrichments/deduplication_spec.rb~ +0 -5
- data/spec/lib/krikri/enrichments/genre_filter_spec.rb~ +0 -19
- data/spec/lib/krikri/enrichments/iso_enrich_spec.rb~ +0 -5
- data/spec/lib/krikri/enrichments/parse_date_spec.rb~ +0 -16
- data/spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb~ +0 -16
- data/spec/lib/krikri/enrichments/strip_leading_colons_spec.rb~ +0 -16
- data/spec/lib/krikri/enrichments/strip_leading_punctuation_spec.rb~ +0 -16
- data/spec/lib/krikri/enrichments/timespan_spec.rb~ +0 -10
- data/spec/lib/krikri/enrichments/timespan_split_spec.rb~ +0 -59
- data/spec/lib/krikri/harvesters/api_harvester_spec.rb~ +0 -47
- data/spec/lib/krikri/harvesters/basic_save_behavior_spec.rb~ +0 -12
- data/spec/lib/krikri/harvesters/file_harvester_spec.rb~ +0 -3
- data/spec/lib/krikri/harvesters/harvest_behavior_spec.rb~ +0 -5
- data/spec/lib/krikri/harvesters/mdl_api_harvester_spec.rb~ +0 -11
- data/spec/lib/krikri/harvesters/mdl_harvester_spec.rb~ +0 -8
- data/spec/lib/krikri/harvesters/oai_skip_deleted_behavior.rb~ +0 -7
- data/spec/lib/krikri/harvesters/oai_skip_deleted_behavior_spec.rb~ +0 -15
- data/spec/lib/krikri/id_service_spec.rb~ +0 -3
- data/spec/lib/krikri/index_service_spec.rb +0 -83
- data/spec/lib/krikri/job_spec.rb~ +0 -13
- data/spec/lib/krikri/mapper_agent_spec.rb~ +0 -64
- data/spec/lib/krikri/mapper_spec.rb~ +0 -5
- data/spec/lib/krikri/mapping_dsl/parser_methods_spec.rb~ +0 -65
- data/spec/lib/krikri/mapping_dsl/property_declaration_spec.rb~ +0 -87
- data/spec/lib/krikri/mapping_dsl/rdf_subjects_spec.rb~ +0 -16
- data/spec/lib/krikri/mapping_dsl_spec.rb~ +0 -10
- data/spec/lib/krikri/mapping_job.rb~ +0 -12
- data/spec/lib/krikri/mapping_job_spec.rb~ +0 -11
- data/spec/lib/krikri/mapping_spec.rb~ +0 -5
- data/spec/lib/krikri/md5_minter_spec.rb~ +0 -5
- data/spec/lib/krikri/parser_value_array.rb~ +0 -5
- data/spec/lib/krikri/parsers/json_parser_spec.rb~ +0 -17
- data/spec/lib/krikri/parsers/xml_parser_spec.rb~ +0 -21
- data/spec/lib/krikri/provenance_query_client.rb~ +0 -5
- data/spec/lib/krikri/provenance_query_client_spec.rb~ +0 -8
- data/spec/lib/krikri/util/edtf_converter_spec.rb~ +0 -17
- data/spec/lib/krikri/util/extended_date_parser_spec.rb~ +0 -102
- data/spec/lib/krikri/validation_report_list_spec.rb +0 -50
- data/spec/models/activity_spec.rb~ +0 -41
- data/spec/models/dpla/map/aggregation_spec.rb~ +0 -67
- data/spec/models/harvesters/oai_harvester_spec.rb~ +0 -15
- data/spec/models/mapper_spec.rb~ +0 -5
- data/spec/models/original_record_metadata_spec.rb~ +0 -5
- data/spec/models/original_record_spec.rb~ +0 -5
- data/spec/support/shared_contexts/mapping_dsl.rb~ +0 -12
- data/spec/support/shared_contexts/provenance_query_client.rb~ +0 -6
- data/spec/support/shared_examples/enrichment.rb~ +0 -5
- data/spec/support/shared_examples/harvest_behavior.rb~ +0 -13
- data/spec/support/shared_examples/job.rb~ +0 -20
- data/spec/support/shared_examples/ldp_resource.rb~ +0 -4
- data/spec/support/shared_examples/oai_parser_headers.rb~ +0 -12
- data/spec/support/shared_examples/rdf_source.rb~ +0 -1
- data/spec/support/shared_examples/software_agent.rb~ +0 -5
- data/spec/support/shared_examples/string_enrichment.rb~ +0 -12
- data/spec/test_app_templates/lib/generators/test_app_generator.rb~ +0 -14
- data/spec/webmocks/oai.rb~ +0 -13
@@ -0,0 +1,326 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rsolr'
|
3
|
+
require 'elasticsearch'
|
4
|
+
|
5
|
+
module Krikri
|
6
|
+
##
|
7
|
+
# Search index base class that gets extended by QA and Production index
|
8
|
+
# classes
|
9
|
+
class SearchIndex
|
10
|
+
def initialize(opts)
|
11
|
+
@bulk_update_size = opts.delete(:bulk_update_size) { 10 }
|
12
|
+
end
|
13
|
+
|
14
|
+
##
|
15
|
+
# Add a single JSON document to the search index.
|
16
|
+
# Implemented in a child class.
|
17
|
+
#
|
18
|
+
# @param _ [Hash] Hash that can be serialized to JSON with #to_json
|
19
|
+
def add(_)
|
20
|
+
fail NotImplementedError
|
21
|
+
end
|
22
|
+
|
23
|
+
##
|
24
|
+
# Add a number of JSON documents to the search index at once.
|
25
|
+
# Implemented in a child class.
|
26
|
+
#
|
27
|
+
# @param _ [Array] Hashes that can be serialized to JSON with #to_json
|
28
|
+
def bulk_add(_)
|
29
|
+
fail NotImplementedError
|
30
|
+
end
|
31
|
+
|
32
|
+
##
|
33
|
+
# Shim that determines, for a particular type of index, which strategy
|
34
|
+
# to use, adding a single document, or adding them in bulk. Intended
|
35
|
+
# to be overridden as necessary.
|
36
|
+
# @see #add
|
37
|
+
# @see #bulk_add
|
38
|
+
def update_from_activity(activity)
|
39
|
+
fail "#{activity} is not an Activity" \
|
40
|
+
unless activity.class == Krikri::Activity
|
41
|
+
incremental_update_from_activity(activity)
|
42
|
+
end
|
43
|
+
|
44
|
+
protected
|
45
|
+
|
46
|
+
##
|
47
|
+
# Given an activity, use the bulk-update method to load its revised
|
48
|
+
# entities into the search index.
|
49
|
+
#
|
50
|
+
# @param activity [Krikri::Activity]
|
51
|
+
def bulk_update_from_activity(activity)
|
52
|
+
all_aggs = entities_as_json_hashes(activity)
|
53
|
+
agg_batches = bulk_update_batches(all_aggs)
|
54
|
+
agg_batches.each do |batch|
|
55
|
+
bulk_add(batch)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
##
|
60
|
+
# Enumerate arrays of JSON strings, one array per batch that is supposed
|
61
|
+
# to be loaded into the search index.
|
62
|
+
#
|
63
|
+
# @param aggregations [Enumerator]
|
64
|
+
# @return [Enumerator] Each array of JSON strings
|
65
|
+
def bulk_update_batches(aggregations)
|
66
|
+
en = Enumerator.new do |e|
|
67
|
+
i = 1
|
68
|
+
batch = []
|
69
|
+
aggregations.each do |agg|
|
70
|
+
batch << agg
|
71
|
+
if i % @bulk_update_size == 0
|
72
|
+
e.yield batch
|
73
|
+
batch = []
|
74
|
+
end
|
75
|
+
i += 1
|
76
|
+
end
|
77
|
+
e.yield batch if batch.count > 0 # last one
|
78
|
+
end
|
79
|
+
en.lazy
|
80
|
+
end
|
81
|
+
|
82
|
+
##
|
83
|
+
# Given an activity, load its revised entities into the search index one
|
84
|
+
# at a time.
|
85
|
+
#
|
86
|
+
# @param activity [Krikri::Activity]
|
87
|
+
def incremental_update_from_activity(activity)
|
88
|
+
entities_as_json_hashes(activity).each do |h|
|
89
|
+
add(h)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
##
|
94
|
+
# Given an activity, enumerate over revised entities, represented as
|
95
|
+
# hashes that can be serialized to JSON.
|
96
|
+
#
|
97
|
+
# @param activity [Krikri::Activity]
|
98
|
+
# @return [Enumerator]
|
99
|
+
def entities_as_json_hashes(activity)
|
100
|
+
activity.entities.lazy.map do |agg|
|
101
|
+
hash_for_index_schema(agg)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
##
|
106
|
+
# Return a JSON string from the given aggregation in a format suitable for
|
107
|
+
# the search index.
|
108
|
+
#
|
109
|
+
# The default behavior is to turn out the MAPv4 JSON-LD straight from
|
110
|
+
# the aggregation.
|
111
|
+
#
|
112
|
+
# This can be overridden to convert this to MAPv3 JSON-LD or whatever.
|
113
|
+
#
|
114
|
+
# @param aggregation [DPLA::MAP::Aggregation] The aggregation
|
115
|
+
# @return [Hash] Hash that can respond to #to_json for serialization
|
116
|
+
def hash_for_index_schema(aggregation)
|
117
|
+
aggregation.to_jsonld['@graph'][0]
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
|
122
|
+
##
|
123
|
+
# Generates flattened Solr documents and manages indexing of DPLA MAP models.
|
124
|
+
#
|
125
|
+
# @example
|
126
|
+
#
|
127
|
+
# indexer = Krikri::QASearchIndex.new
|
128
|
+
# agg = Krikri::Aggregation.new
|
129
|
+
# doc = agg.to_jsonld['@graph'].first
|
130
|
+
#
|
131
|
+
# indexer.add(doc)
|
132
|
+
# indexer.commit
|
133
|
+
#
|
134
|
+
class QASearchIndex < Krikri::SearchIndex
|
135
|
+
attr_reader :solr
|
136
|
+
|
137
|
+
##
|
138
|
+
# @param opts [Hash] options to pass to RSolr
|
139
|
+
# @see RSolr.connect
|
140
|
+
def initialize(opts = Krikri::Settings.solr.to_h)
|
141
|
+
@solr = RSolr.connect(opts)
|
142
|
+
super(opts)
|
143
|
+
end
|
144
|
+
|
145
|
+
# TODO: Assure that the following metacharacters are escaped:
|
146
|
+
# + - && || ! ( ) { } [ ] ^ " ~ * ? : \
|
147
|
+
|
148
|
+
##
|
149
|
+
# Adds a single JSON document to Solr
|
150
|
+
# @param doc [Hash] A hash that complies with the Solr schema
|
151
|
+
def add(doc)
|
152
|
+
solr.add solr_doc(doc)
|
153
|
+
end
|
154
|
+
|
155
|
+
##
|
156
|
+
# @see Krikri::SearchIndex#update_from_activity
|
157
|
+
def update_from_activity(activity)
|
158
|
+
fail "#{activity} is not an Activity" \
|
159
|
+
unless activity.class == Krikri::Activity
|
160
|
+
bulk_update_from_activity(activity)
|
161
|
+
end
|
162
|
+
|
163
|
+
##
|
164
|
+
# Add multiple documents to Solr
|
165
|
+
# @param docs [Array] Array of hashes that comply with the Solr schema
|
166
|
+
def bulk_add(docs)
|
167
|
+
solr.add(docs.map { |d| solr_doc(d) })
|
168
|
+
end
|
169
|
+
|
170
|
+
##
|
171
|
+
# Deletes an item from Solr
|
172
|
+
# @param String or Array
|
173
|
+
def delete_by_id(id)
|
174
|
+
solr.delete_by_id id
|
175
|
+
end
|
176
|
+
|
177
|
+
##
|
178
|
+
# Deletes items from Solr that match query
|
179
|
+
# @param String or Array
|
180
|
+
def delete_by_query(query)
|
181
|
+
solr.delete_by_query query
|
182
|
+
end
|
183
|
+
|
184
|
+
##
|
185
|
+
# Commits changes to Solr, making them visible to new requests
|
186
|
+
# Should be run after self.add and self.delete
|
187
|
+
# Okay to add or delete multiple docs and commit them all with
|
188
|
+
# a single self.commit
|
189
|
+
def commit
|
190
|
+
solr.commit
|
191
|
+
end
|
192
|
+
|
193
|
+
##
|
194
|
+
# Converts JSON document into a Hash that complies with Solr schema
|
195
|
+
# @param [JSON]
|
196
|
+
# @return [Hash]
|
197
|
+
def solr_doc(doc)
|
198
|
+
remove_invalid_keys(flat_hash(doc))
|
199
|
+
end
|
200
|
+
|
201
|
+
##
|
202
|
+
# Get field names from Solr schema in host application.
|
203
|
+
# Will raise exception if file not found.
|
204
|
+
# @return [Array]
|
205
|
+
def schema_keys
|
206
|
+
schema_file = File.join(Rails.root, 'solr_conf', 'schema.xml')
|
207
|
+
file = File.open(schema_file)
|
208
|
+
doc = Nokogiri::XML(file)
|
209
|
+
file.close
|
210
|
+
doc.xpath('//fields/field').map { |f| f.attr('name') }
|
211
|
+
end
|
212
|
+
|
213
|
+
private
|
214
|
+
|
215
|
+
##
|
216
|
+
# Flattens a nested hash
|
217
|
+
# Joins keys with "_" and removes "@" symbols
|
218
|
+
# Example:
|
219
|
+
# flat_hash( {"a"=>"1", "b"=>{"c"=>"2", "d"=>"3"} )
|
220
|
+
# => {"a"=>"1", "b_c"=>"2", "b_d"=>"3"}
|
221
|
+
def flat_hash(hash, keys = [])
|
222
|
+
new_hash = {}
|
223
|
+
|
224
|
+
hash.each do |key, val|
|
225
|
+
new_hash[format_key(keys + [key])] = val unless
|
226
|
+
val.is_a?(Array) || val.is_a?(Hash)
|
227
|
+
new_hash.merge!(flat_hash(val, keys + [key])) if val.is_a? Hash
|
228
|
+
|
229
|
+
if val.is_a? Array
|
230
|
+
val.each do |v|
|
231
|
+
if v.is_a? Hash
|
232
|
+
new_hash.merge!(flat_hash(v, keys + [key])) do |key, f, s|
|
233
|
+
Array(f) << s
|
234
|
+
end
|
235
|
+
else
|
236
|
+
formatted_key = format_key(keys + [key])
|
237
|
+
new_hash[formatted_key] =
|
238
|
+
new_hash[formatted_key] ? (Array(new_hash[formatted_key]) << v) : v
|
239
|
+
end
|
240
|
+
end
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
new_hash
|
245
|
+
end
|
246
|
+
|
247
|
+
##
|
248
|
+
# Formats a key to match a field name in the Solr schema
|
249
|
+
#
|
250
|
+
# Removes unnecessary special character strings that would
|
251
|
+
# require special treatment in Solr
|
252
|
+
#
|
253
|
+
# @param Array
|
254
|
+
#
|
255
|
+
# TODO: Revisit this to make it more generalizable
|
256
|
+
def format_key(keys)
|
257
|
+
keys.join('_')
|
258
|
+
.gsub('@', '')
|
259
|
+
.gsub('http://www.geonames.org/ontology#', '')
|
260
|
+
.gsub('http://www.w3.org/2003/01/geo/wgs84_pos#', '')
|
261
|
+
end
|
262
|
+
|
263
|
+
##
|
264
|
+
# Remove keys (ie. fields) that are not in the Solr schema.
|
265
|
+
# @param [Hash]
|
266
|
+
# @return [Hash]
|
267
|
+
def remove_invalid_keys(solr_doc)
|
268
|
+
valid_keys = schema_keys
|
269
|
+
solr_doc.delete_if { |key, _| !key.in? valid_keys }
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
273
|
+
|
274
|
+
##
|
275
|
+
# Production ElasticSearch search index class
|
276
|
+
class ProdSearchIndex < Krikri::SearchIndex
|
277
|
+
attr_reader :elasticsearch, :index_name
|
278
|
+
|
279
|
+
##
|
280
|
+
# @param [Hash] opts
|
281
|
+
#
|
282
|
+
# Options used by this class:
|
283
|
+
# - index_name [String] The name of the ElasticSearch index
|
284
|
+
# Other options are passed along to Elasticsearch::Client.
|
285
|
+
#
|
286
|
+
def initialize(opts = Krikri::Settings.elasticsearch.to_h)
|
287
|
+
super(opts)
|
288
|
+
@index_name = opts.delete(:index_name) { 'dpla_alias' }
|
289
|
+
@elasticsearch = Elasticsearch::Client.new(opts)
|
290
|
+
end
|
291
|
+
|
292
|
+
##
|
293
|
+
# Add a number of JSON documents to the search index at once.
|
294
|
+
# @param docs [Array] Array of hashes that can be serialized with #to_json
|
295
|
+
def bulk_add(docs)
|
296
|
+
body = docs.map do |doc|
|
297
|
+
{
|
298
|
+
index: {
|
299
|
+
_index: @index_name,
|
300
|
+
_type: doc[:ingestType],
|
301
|
+
_id: doc[:id],
|
302
|
+
data: doc
|
303
|
+
}
|
304
|
+
}
|
305
|
+
end
|
306
|
+
@elasticsearch.bulk body: body
|
307
|
+
end
|
308
|
+
|
309
|
+
##
|
310
|
+
# @see Krikri::SearchIndex#update_from_activity
|
311
|
+
def update_from_activity(activity)
|
312
|
+
fail "#{activity} is not an Activity" \
|
313
|
+
unless activity.class == Krikri::Activity
|
314
|
+
bulk_update_from_activity(activity)
|
315
|
+
end
|
316
|
+
|
317
|
+
##
|
318
|
+
# @see Krikri::SearchIndex#hash_for_index_schema
|
319
|
+
def hash_for_index_schema(aggregation)
|
320
|
+
graph = aggregation.to_jsonld['@graph'][0]
|
321
|
+
# TODO: munge graph to MAPv3
|
322
|
+
# update search_index_spec.rb when that's done.
|
323
|
+
graph
|
324
|
+
end
|
325
|
+
end
|
326
|
+
end
|
@@ -10,31 +10,8 @@ module Krikri
|
|
10
10
|
|
11
11
|
# Override method in Blacklight::UrlHelperBehavior.
|
12
12
|
def link_to_document(document, field_or_opts = nil, opts = {})
|
13
|
-
link_to field_or_opts, url_for_document(document
|
14
|
-
|
15
|
-
|
16
|
-
# This method is used to make display fields into hyperlinks.
|
17
|
-
def make_this_a_link(options = {})
|
18
|
-
# options[:document] # the original document
|
19
|
-
# options[:field] # the field to render
|
20
|
-
# options[:value] # the value of the field
|
21
|
-
|
22
|
-
link_to options[:value], options[:value]
|
23
|
-
end
|
24
|
-
|
25
|
-
# This method is used to link display fields to the document's show path.
|
26
|
-
def link_to_show(options = {})
|
27
|
-
# options[:document] # the original document
|
28
|
-
# options[:field] # the field to render
|
29
|
-
# options[:value] # the value of the field
|
30
|
-
|
31
|
-
link_to_document options[:document], options[:value]
|
32
|
-
end
|
33
|
-
|
34
|
-
def render_document_field_data(document, key)
|
35
|
-
if document[key]
|
36
|
-
render_index_field_value document, :field => key
|
37
|
-
end
|
13
|
+
link_to field_or_opts, url_for_document(document, { :provider =>
|
14
|
+
params[:provider] })
|
38
15
|
end
|
39
16
|
|
40
17
|
# Disable bookmarks.
|
@@ -97,9 +74,5 @@ module Krikri
|
|
97
74
|
def error_msg(message = '')
|
98
75
|
"There was a problem getting the record.\n\n#{message}"
|
99
76
|
end
|
100
|
-
|
101
|
-
def random_record_url
|
102
|
-
url_for_document(Krikri::RandomRecordGenerator.new.record)
|
103
|
-
end
|
104
77
|
end
|
105
78
|
end
|
@@ -6,8 +6,23 @@ module Krikri
|
|
6
6
|
module SoftwareAgent
|
7
7
|
extend ActiveSupport::Concern
|
8
8
|
|
9
|
+
included do
|
10
|
+
attr_writer :entity_behavior
|
11
|
+
end
|
12
|
+
|
9
13
|
Logger = ActiveSupport::TaggedLogging.new(Rails.logger)
|
10
14
|
|
15
|
+
##
|
16
|
+
# Return the EntityBehavior associated with the SoftwareAgent.
|
17
|
+
# Meant to be overridden as necessary.
|
18
|
+
#
|
19
|
+
# @see Krikri::Activity#entities
|
20
|
+
# @see Krikri::EntityBehavior
|
21
|
+
#
|
22
|
+
def entity_behavior
|
23
|
+
@entity_behavior ||= nil
|
24
|
+
end
|
25
|
+
|
11
26
|
##
|
12
27
|
# Return an agent name suitable for saving in an Activity.
|
13
28
|
# This is the name of the most-derived class upon which this is invoked.
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Krikri
|
2
|
+
class SolrResponseBuilder
|
3
|
+
attr_accessor :response
|
4
|
+
##
|
5
|
+
# @param query_terms [Hash] of terms for a Solr query
|
6
|
+
# Sample use:
|
7
|
+
# SolrResponseBuilder.new({ :q => 'dogs' }).response
|
8
|
+
# @return Blacklight::SolrResponse
|
9
|
+
def initialize(query_params)
|
10
|
+
self.response = Blacklight::SolrResponse.new(Blacklight::SolrRepository
|
11
|
+
.new(Blacklight::Configuration.new).search(query_params), query_params)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/krikri/version.rb
CHANGED
data/lib/krikri.rb
CHANGED
@@ -13,4 +13,9 @@ module Krikri
|
|
13
13
|
autoload :ModsParser, 'krikri/parsers/mods_parser'
|
14
14
|
autoload :QdcParser, 'krikri/parsers/qdc_parser'
|
15
15
|
autoload :OaiParserHeaders, 'krikri/parsers/oai_parser_headers'
|
16
|
+
autoload :AggregationEntityBehavior,
|
17
|
+
'krikri/entity_behaviors/aggregation_entity_behavior'
|
18
|
+
autoload :OriginalRecordEntityBehavior,
|
19
|
+
'krikri/entity_behaviors/original_record_entity_behavior'
|
20
|
+
|
16
21
|
end
|
data/lib/tasks/krikri.rake
CHANGED
@@ -4,7 +4,7 @@ require 'dpla/map/factories'
|
|
4
4
|
require 'open-uri'
|
5
5
|
require 'resque/tasks'
|
6
6
|
|
7
|
-
require 'krikri/
|
7
|
+
require 'krikri/search_index'
|
8
8
|
|
9
9
|
krikri_dir = Gem::Specification.find_by_name('krikri').gem_dir
|
10
10
|
require "#{krikri_dir}/app/models/krikri/original_record"
|
@@ -13,9 +13,8 @@ require "#{krikri_dir}/spec/factories/krikri_original_record"
|
|
13
13
|
namespace :krikri do
|
14
14
|
|
15
15
|
def index_aggregation(agg)
|
16
|
-
|
17
|
-
indexer
|
18
|
-
indexer.add graph.to_json
|
16
|
+
indexer = Krikri::QASearchIndex.new
|
17
|
+
indexer.add agg.to_jsonld['@graph'].first
|
19
18
|
indexer.commit
|
20
19
|
end
|
21
20
|
|
@@ -28,12 +27,12 @@ namespace :krikri do
|
|
28
27
|
original_record = build(:oai_dc_record)
|
29
28
|
original_record.save unless original_record.exists?
|
30
29
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
30
|
+
provider = Krikri::Provider.new('123')
|
31
|
+
provider.label = 'Moomin valley Historical Society'
|
32
|
+
|
33
|
+
agg = build(:aggregation)
|
34
|
+
agg.originalRecord = original_record.rdf_source
|
35
|
+
agg.provider = provider
|
37
36
|
|
38
37
|
agg.mint_id!('krikri_sample')
|
39
38
|
|
@@ -81,7 +80,7 @@ namespace :krikri do
|
|
81
80
|
original_record.delete! if original_record.exists?
|
82
81
|
|
83
82
|
# Delete all sample records from Solr
|
84
|
-
indexer = Krikri::
|
83
|
+
indexer = Krikri::QASearchIndex.new
|
85
84
|
indexer.delete_by_query 'id:*krikri_sample*'
|
86
85
|
indexer.commit
|
87
86
|
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Krikri::ProvidersController, :type => :controller do
|
4
|
+
|
5
|
+
routes { Krikri::Engine.routes }
|
6
|
+
|
7
|
+
describe 'GET #show' do
|
8
|
+
login_user
|
9
|
+
|
10
|
+
it 'sets provider variable' do
|
11
|
+
expect { get :show, id: 'moomin' }
|
12
|
+
.to change { assigns[:current_provider] }
|
13
|
+
.to an_instance_of(Krikri::Provider)
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'renders the :show view' do
|
17
|
+
get :show, id: 'moomin'
|
18
|
+
expect(response).to render_template('krikri/providers/show')
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe 'GET #index' do
|
23
|
+
login_user
|
24
|
+
|
25
|
+
it 'renders the :show view' do
|
26
|
+
get :index
|
27
|
+
expect(response).to render_template('krikri/providers/index')
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'sets providers variable' do
|
31
|
+
providers = [instance_double(Krikri::Provider)]
|
32
|
+
allow(Krikri::Provider).to receive(:all).and_return(providers)
|
33
|
+
|
34
|
+
expect { get :index }.to change { assigns[:providers] }.to(providers)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Krikri::QaReportsController, :type => :controller do
|
4
|
+
routes { Krikri::Engine.routes }
|
5
|
+
|
6
|
+
let(:report) { instance_double(Krikri::QAReport) }
|
7
|
+
|
8
|
+
describe 'GET #index' do
|
9
|
+
login_user
|
10
|
+
|
11
|
+
let(:reports) { [report] }
|
12
|
+
|
13
|
+
before { allow(Krikri::QAReport).to receive(:all).and_return(reports) }
|
14
|
+
|
15
|
+
it 'renders the index view' do
|
16
|
+
get :index
|
17
|
+
expect(response).to render_template('krikri/qa_reports/index')
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'populates the reports list' do
|
21
|
+
get :index
|
22
|
+
expect(assigns(:reports)).to eq(reports)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe 'GET #show' do
|
27
|
+
login_user
|
28
|
+
|
29
|
+
before do
|
30
|
+
allow(Krikri::QAReport)
|
31
|
+
.to receive(:find).with(report_id.to_s).and_return(report)
|
32
|
+
allow(report).to receive(:field_csv).and_return(csv)
|
33
|
+
end
|
34
|
+
|
35
|
+
let(:report_id) { 123 }
|
36
|
+
|
37
|
+
let(:csv) do
|
38
|
+
CSV::Table.new([CSV::Row.new(['field_name', 'aggregation', 'isShownAt'],
|
39
|
+
['moomin', '123', 'http://example.org/123'])])
|
40
|
+
end
|
41
|
+
|
42
|
+
let(:count_csv) do
|
43
|
+
CSV::Table.new([CSV::Row.new(['name', 'count'], ['moomin', '1'])])
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'accepts a type ' do
|
47
|
+
get :show, id: report_id, type: 'count'
|
48
|
+
expect(assigns(:type)).to eq :count
|
49
|
+
end
|
50
|
+
|
51
|
+
context 'CSV' do
|
52
|
+
it 'gives CSV result' do
|
53
|
+
get :show, id: report_id, format: 'csv'
|
54
|
+
expect(response.content_type).to eq 'text/csv'
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'gives correct text in CSV result' do
|
58
|
+
get :show, id: report_id, format: 'csv'
|
59
|
+
expect(response.body).to eq csv.to_s
|
60
|
+
end
|
61
|
+
|
62
|
+
it 'gives count text in CSV result' do
|
63
|
+
allow(report).to receive(:count_csv).and_return(count_csv)
|
64
|
+
get :show, id: report_id, type: 'count', format: 'csv'
|
65
|
+
expect(response.body).to eq count_csv.to_s
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Krikri::RecordsController, :type => :controller do
|
4
|
+
include_context 'with indexed item'
|
5
|
+
|
6
|
+
routes { Krikri::Engine.routes }
|
7
|
+
|
8
|
+
let(:doc_id) { agg.rdf_subject.to_s.split('/').last }
|
9
|
+
|
10
|
+
describe 'GET #index' do
|
11
|
+
login_user
|
12
|
+
|
13
|
+
let(:user_query) { 'history' }
|
14
|
+
|
15
|
+
it 'renders the index view' do
|
16
|
+
get :index, q: user_query
|
17
|
+
expect(response).to render_template('krikri/records/index')
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'gives a solr response' do
|
21
|
+
get :index, q: user_query
|
22
|
+
expect(assigns[:response]).to be_a Blacklight::SolrResponse
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'responds to json requests' do
|
26
|
+
get :index, q: user_query, format: 'json'
|
27
|
+
expect { JSON.parse(response.body) }.not_to raise_error
|
28
|
+
end
|
29
|
+
|
30
|
+
context 'with provider filter' do
|
31
|
+
it 'sets provider id' do
|
32
|
+
get :index, provider: provider.id
|
33
|
+
expect(assigns[:provider_id]).to eq provider.id
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'finds records with provider' do
|
37
|
+
get :index, provider: provider.id
|
38
|
+
ids = assigns[:response][:response][:docs].map { |doc| doc[:id] }
|
39
|
+
expect(ids).to include agg.rdf_subject.to_s
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'filters records by provider' do
|
43
|
+
get :index, provider: 'abc'
|
44
|
+
expect(assigns[:response][:response][:docs]).to be_empty
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
describe 'GET #show' do
|
50
|
+
login_user
|
51
|
+
|
52
|
+
it 'renders show view' do
|
53
|
+
get :show, id: doc_id
|
54
|
+
require 'pry'
|
55
|
+
binding.pry unless assigns[:document]
|
56
|
+
|
57
|
+
expect(response).to render_template('krikri/records/show')
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'gets document by local name' do
|
61
|
+
get :show, id: doc_id
|
62
|
+
|
63
|
+
expect(assigns[:document][:id]).to eq agg.rdf_subject.to_s
|
64
|
+
end
|
65
|
+
|
66
|
+
context 'with provider filter' do
|
67
|
+
it 'sets provider id' do
|
68
|
+
get :show, id: doc_id, provider: provider.id
|
69
|
+
expect(assigns[:provider_id]).to eq provider.id
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|