blacklight-spotlight 3.4.0 → 3.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/spotlight/roles_controller.rb +1 -1
- data/lib/spotlight/version.rb +1 -1
- metadata +6 -610
- data/spec/controllers/application_controller_spec.rb +0 -30
- data/spec/controllers/spotlight/about_pages_controller_spec.rb +0 -239
- data/spec/controllers/spotlight/admin_users_controller_spec.rb +0 -53
- data/spec/controllers/spotlight/appearances_controller_spec.rb +0 -88
- data/spec/controllers/spotlight/application_controller_spec.rb +0 -11
- data/spec/controllers/spotlight/attachments_controller_spec.rb +0 -28
- data/spec/controllers/spotlight/browse_controller_spec.rb +0 -133
- data/spec/controllers/spotlight/bulk_actions_controller_spec.rb +0 -124
- data/spec/controllers/spotlight/bulk_updates_controller_spec.rb +0 -77
- data/spec/controllers/spotlight/catalog_controller_spec.rb +0 -552
- data/spec/controllers/spotlight/confirmations_controller_spec.rb +0 -38
- data/spec/controllers/spotlight/contact_email_controller_spec.rb +0 -65
- data/spec/controllers/spotlight/contact_forms_controller_spec.rb +0 -38
- data/spec/controllers/spotlight/contacts_controller_spec.rb +0 -103
- data/spec/controllers/spotlight/custom_fields_controller_spec.rb +0 -62
- data/spec/controllers/spotlight/custom_search_fields_controller_spec.rb +0 -62
- data/spec/controllers/spotlight/dashboards_controller_spec.rb +0 -68
- data/spec/controllers/spotlight/exhibits_controller_spec.rb +0 -216
- data/spec/controllers/spotlight/feature_pages_controller_spec.rb +0 -251
- data/spec/controllers/spotlight/featured_images_controller_spec.rb +0 -77
- data/spec/controllers/spotlight/filters_controller_spec.rb +0 -72
- data/spec/controllers/spotlight/groups_controller_spec.rb +0 -103
- data/spec/controllers/spotlight/home_pages_controller_spec.rb +0 -126
- data/spec/controllers/spotlight/job_trackers_controller_spec.rb +0 -37
- data/spec/controllers/spotlight/languages_controller_spec.rb +0 -70
- data/spec/controllers/spotlight/metadata_configurations_controller_spec.rb +0 -93
- data/spec/controllers/spotlight/pages_controller_spec.rb +0 -50
- data/spec/controllers/spotlight/resources/csv_upload_controller_spec.rb +0 -71
- data/spec/controllers/spotlight/resources/upload_controller_spec.rb +0 -55
- data/spec/controllers/spotlight/resources_controller_spec.rb +0 -85
- data/spec/controllers/spotlight/roles_controller_spec.rb +0 -141
- data/spec/controllers/spotlight/search_configurations_controller_spec.rb +0 -141
- data/spec/controllers/spotlight/searches_controller_spec.rb +0 -195
- data/spec/controllers/spotlight/sites_controller_spec.rb +0 -67
- data/spec/controllers/spotlight/solr_controller_spec.rb +0 -116
- data/spec/controllers/spotlight/tags_controller_spec.rb +0 -56
- data/spec/controllers/spotlight/translations_controller_spec.rb +0 -132
- data/spec/controllers/spotlight/versions_controller_spec.rb +0 -56
- data/spec/controllers/spotlight/view_configurations_controller_spec.rb +0 -35
- data/spec/examples.txt +0 -1515
- data/spec/factories/bulk_updates.rb +0 -21
- data/spec/factories/contact_emails.rb +0 -8
- data/spec/factories/contact_images.rb +0 -8
- data/spec/factories/contacts.rb +0 -11
- data/spec/factories/custom_fields.rb +0 -9
- data/spec/factories/custom_search_fields.rb +0 -9
- data/spec/factories/exhibit_thumbnails.rb +0 -8
- data/spec/factories/exhibits.rb +0 -17
- data/spec/factories/featured_images.rb +0 -16
- data/spec/factories/group.rb +0 -17
- data/spec/factories/job_trackers.rb +0 -11
- data/spec/factories/language.rb +0 -8
- data/spec/factories/main_navigation.rb +0 -9
- data/spec/factories/pages.rb +0 -34
- data/spec/factories/resources.rb +0 -14
- data/spec/factories/roles.rb +0 -9
- data/spec/factories/searches.rb +0 -33
- data/spec/factories/tags.rb +0 -14
- data/spec/factories/translation.rb +0 -8
- data/spec/factories/users.rb +0 -50
- data/spec/features/about_page_spec.rb +0 -46
- data/spec/features/add_contacts_spec.rb +0 -63
- data/spec/features/add_custom_field_metadata_spec.rb +0 -88
- data/spec/features/add_iiif_manifest_spec.rb +0 -46
- data/spec/features/add_items_spec.rb +0 -135
- data/spec/features/autocomplete_typeahead_spec.rb +0 -89
- data/spec/features/browse_category_admin_spec.rb +0 -163
- data/spec/features/browse_category_navigation_spec.rb +0 -44
- data/spec/features/browse_category_spec.rb +0 -158
- data/spec/features/bulk_actions_spec.rb +0 -72
- data/spec/features/catalog_spec.rb +0 -57
- data/spec/features/confirm_email_spec.rb +0 -21
- data/spec/features/create_exhibit_spec.rb +0 -65
- data/spec/features/create_page_spec.rb +0 -21
- data/spec/features/dashboard_spec.rb +0 -34
- data/spec/features/edit_contact_spec.rb +0 -21
- data/spec/features/edit_search_fields_spec.rb +0 -79
- data/spec/features/exhibit_masthead_spec.rb +0 -112
- data/spec/features/exhibit_themes_spec.rb +0 -30
- data/spec/features/exhibits/add_tags_spec.rb +0 -35
- data/spec/features/exhibits/administration_spec.rb +0 -141
- data/spec/features/exhibits/custom_metadata_fields_spec.rb +0 -97
- data/spec/features/exhibits/custom_search_fields_spec.rb +0 -55
- data/spec/features/exhibits/edit_metadata_fields_spec.rb +0 -49
- data/spec/features/exhibits/language_create_edit_spec.rb +0 -59
- data/spec/features/exhibits/translation_editing_spec.rb +0 -463
- data/spec/features/exhibits_index_spec.rb +0 -55
- data/spec/features/feature_page_spec.rb +0 -155
- data/spec/features/home_page_spec.rb +0 -102
- data/spec/features/import_exhibit_spec.rb +0 -58
- data/spec/features/item_admin_spec.rb +0 -59
- data/spec/features/javascript/about_page_admin_spec.rb +0 -21
- data/spec/features/javascript/block_controls_spec.rb +0 -42
- data/spec/features/javascript/blocks/browse_group_categories_block_spec.rb +0 -64
- data/spec/features/javascript/blocks/featured_browse_categories_block_spec.rb +0 -46
- data/spec/features/javascript/blocks/featured_pages_block_spec.rb +0 -61
- data/spec/features/javascript/blocks/link_to_search_block_spec.rb +0 -46
- data/spec/features/javascript/blocks/rule_block_spec.rb +0 -23
- data/spec/features/javascript/blocks/search_result_block_spec.rb +0 -47
- data/spec/features/javascript/blocks/solr_documents_block_spec.rb +0 -232
- data/spec/features/javascript/blocks/solr_documents_carousel_block_spec.rb +0 -29
- data/spec/features/javascript/blocks/uploaded_items_block_spec.rb +0 -94
- data/spec/features/javascript/browse_group_admin_spec.rb +0 -45
- data/spec/features/javascript/edit_in_place_spec.rb +0 -93
- data/spec/features/javascript/feature_page_admin_spec.rb +0 -140
- data/spec/features/javascript/home_page_edit_spec.rb +0 -34
- data/spec/features/javascript/locale_selector_spec.rb +0 -66
- data/spec/features/javascript/metadata_admin_spec.rb +0 -41
- data/spec/features/javascript/multi_image_select_spec.rb +0 -50
- data/spec/features/javascript/reindex_monitor_spec.rb +0 -23
- data/spec/features/javascript/roles_admin_spec.rb +0 -38
- data/spec/features/javascript/search_config_admin_spec.rb +0 -140
- data/spec/features/javascript/search_context_spec.rb +0 -88
- data/spec/features/main_navigation_spec.rb +0 -96
- data/spec/features/metadata_admin_spec.rb +0 -18
- data/spec/features/report_a_problem_spec.rb +0 -62
- data/spec/features/site_masthead_spec.rb +0 -91
- data/spec/features/site_users_management_spec.rb +0 -74
- data/spec/features/slideshow_spec.rb +0 -21
- data/spec/features/translation_scope_spec.rb +0 -27
- data/spec/fixtures/800x600.png +0 -0
- data/spec/fixtures/avatar.png +0 -0
- data/spec/fixtures/bulk-update-template.csv +0 -57
- data/spec/fixtures/csv-upload-fixture.csv +0 -4
- data/spec/fixtures/gk446cj2442-manifest.json +0 -58
- data/spec/fixtures/iiif_responses.rb +0 -312
- data/spec/fixtures/json-upload-fixture.json +0 -3
- data/spec/fixtures/sample_solr_documents.yml +0 -9385
- data/spec/fixtures/updated-bulk-update-template-no-cols.csv +0 -4
- data/spec/fixtures/updated-bulk-update-template-w-tags.csv +0 -4
- data/spec/fixtures/updated-bulk-update-template.csv +0 -4
- data/spec/helpers/spotlight/application_helper_spec.rb +0 -196
- data/spec/helpers/spotlight/browse_helper_spec.rb +0 -13
- data/spec/helpers/spotlight/crop_helper_spec.rb +0 -11
- data/spec/helpers/spotlight/crud_link_helpers_spec.rb +0 -163
- data/spec/helpers/spotlight/languages_helper_spec.rb +0 -79
- data/spec/helpers/spotlight/main_app_helpers_spec.rb +0 -101
- data/spec/helpers/spotlight/masthead_helper_spec.rb +0 -51
- data/spec/helpers/spotlight/meta_helper_spec.rb +0 -33
- data/spec/helpers/spotlight/navbar_helper_spec.rb +0 -24
- data/spec/helpers/spotlight/pages_helper_spec.rb +0 -123
- data/spec/helpers/spotlight/roles_helper_spec.rb +0 -7
- data/spec/helpers/spotlight/search_configurations_helper_spec.rb +0 -23
- data/spec/helpers/spotlight/title_helper_spec.rb +0 -64
- data/spec/helpers/spotlight/translations_helper_spec.rb +0 -16
- data/spec/i18n_spec.rb +0 -27
- data/spec/jobs/spotlight/add_tags_job_spec.rb +0 -34
- data/spec/jobs/spotlight/add_uploads_from_csv_spec.rb +0 -58
- data/spec/jobs/spotlight/change_visibility_job_spec.rb +0 -30
- data/spec/jobs/spotlight/default_thumbnail_job_spec.rb +0 -14
- data/spec/jobs/spotlight/process_bulk_updates_csv_job_spec.rb +0 -86
- data/spec/jobs/spotlight/reindex_exhibit_job_spec.rb +0 -43
- data/spec/jobs/spotlight/reindex_job_spec.rb +0 -79
- data/spec/jobs/spotlight/remove_tags_job_spec.rb +0 -39
- data/spec/jobs/spotlight/rename_sidecar_field_job_spec.rb +0 -33
- data/spec/lib/migration/iiif_spec.rb +0 -91
- data/spec/lib/migration/page_language_spec.rb +0 -25
- data/spec/lib/spotlight/catalog_spec.rb +0 -0
- data/spec/lib/spotlight/controller_spec.rb +0 -102
- data/spec/lib/spotlight/upload_field_config_spec.rb +0 -40
- data/spec/mailers/spotlight/indexing_complete_mailer_spec.rb +0 -42
- data/spec/models/sir_trevor_rails/block_spec.rb +0 -72
- data/spec/models/sir_trevor_rails/blocks/browse_block_spec.rb +0 -42
- data/spec/models/sir_trevor_rails/blocks/browse_group_categories_block_spec.rb +0 -41
- data/spec/models/sir_trevor_rails/blocks/featured_pages_block_spec.rb +0 -50
- data/spec/models/sir_trevor_rails/blocks/search_results_block_spec.rb +0 -23
- data/spec/models/sir_trevor_rails/blocks/solr_documents_block_spec.rb +0 -59
- data/spec/models/sir_trevor_rails/blocks/textable_spec.rb +0 -42
- data/spec/models/solr_document_spec.rb +0 -214
- data/spec/models/spotlight/ability_spec.rb +0 -118
- data/spec/models/spotlight/about_page_spec.rb +0 -19
- data/spec/models/spotlight/access_controls_enforcement_search_builder_spec.rb +0 -82
- data/spec/models/spotlight/analytics/ga_spec.rb +0 -22
- data/spec/models/spotlight/background_job_progress_spec.rb +0 -137
- data/spec/models/spotlight/blacklight_configuration_spec.rb +0 -649
- data/spec/models/spotlight/browse_category_search_builder_spec.rb +0 -51
- data/spec/models/spotlight/contact_email_spec.rb +0 -48
- data/spec/models/spotlight/contact_form_spec.rb +0 -94
- data/spec/models/spotlight/contact_image_spec.rb +0 -11
- data/spec/models/spotlight/contact_spec.rb +0 -38
- data/spec/models/spotlight/custom_field_spec.rb +0 -204
- data/spec/models/spotlight/custom_search_field_spec.rb +0 -56
- data/spec/models/spotlight/custom_translation_extension_spec.rb +0 -24
- data/spec/models/spotlight/exhibit_spec.rb +0 -383
- data/spec/models/spotlight/exhibit_thumbnail_spec.rb +0 -10
- data/spec/models/spotlight/feature_page_spec.rb +0 -87
- data/spec/models/spotlight/featured_image_spec.rb +0 -110
- data/spec/models/spotlight/field_metadata_spec.rb +0 -58
- data/spec/models/spotlight/filter_spec.rb +0 -19
- data/spec/models/spotlight/group_spec.rb +0 -19
- data/spec/models/spotlight/home_page_spec.rb +0 -38
- data/spec/models/spotlight/language_spec.rb +0 -42
- data/spec/models/spotlight/main_navigation_spec.rb +0 -19
- data/spec/models/spotlight/masthead_spec.rb +0 -45
- data/spec/models/spotlight/page_configurations_spec.rb +0 -45
- data/spec/models/spotlight/page_spec.rb +0 -293
- data/spec/models/spotlight/resource_spec.rb +0 -137
- data/spec/models/spotlight/resources/iiif_harvester_spec.rb +0 -52
- data/spec/models/spotlight/resources/iiif_manifest_spec.rb +0 -178
- data/spec/models/spotlight/resources/iiif_service_spec.rb +0 -57
- data/spec/models/spotlight/resources/upload_spec.rb +0 -71
- data/spec/models/spotlight/resources/web_spec.rb +0 -25
- data/spec/models/spotlight/role_spec.rb +0 -51
- data/spec/models/spotlight/search_spec.rb +0 -125
- data/spec/models/spotlight/site_spec.rb +0 -9
- data/spec/models/spotlight/sitemap_spec.rb +0 -113
- data/spec/models/spotlight/solr_document/atomic_updates_spec.rb +0 -56
- data/spec/models/spotlight/solr_document/uploaded_resource_spec.rb +0 -38
- data/spec/models/spotlight/solr_document_sidecar_spec.rb +0 -48
- data/spec/models/spotlight/user_spec.rb +0 -26
- data/spec/models/translation_spec.rb +0 -26
- data/spec/presenters/spotlight/iiif_manifest_presenter_spec.rb +0 -132
- data/spec/routing/spotlight/exhibit_catalog_spec.rb +0 -34
- data/spec/routing/spotlight/featured_images_spec.rb +0 -23
- data/spec/routing/spotlight/pages_routing_spec.rb +0 -42
- data/spec/services/spotlight/bulk_updates_csv_template_service_spec.rb +0 -26
- data/spec/services/spotlight/carrierwave_file_resolver_spec.rb +0 -16
- data/spec/services/spotlight/clone_translated_page_from_locale_spec.rb +0 -30
- data/spec/services/spotlight/etl/context_spec.rb +0 -66
- data/spec/services/spotlight/etl/executor_spec.rb +0 -149
- data/spec/services/spotlight/etl/pipeline_spec.rb +0 -22
- data/spec/services/spotlight/etl/solr_loader_spec.rb +0 -76
- data/spec/services/spotlight/etl/step_spec.rb +0 -70
- data/spec/services/spotlight/exhibit_import_export_service_spec.rb +0 -569
- data/spec/services/spotlight/iiif_resource_resolver_spec.rb +0 -94
- data/spec/services/spotlight/invite_users_service_spec.rb +0 -47
- data/spec/spec_helper.rb +0 -146
- data/spec/support/controllers/engine_helpers.rb +0 -9
- data/spec/support/disable_friendly_id_deprecation_warnings.rb +0 -11
- data/spec/support/features/capybara_default_max_wait_metadata_helper.rb +0 -20
- data/spec/support/features/test_features_helpers.rb +0 -92
- data/spec/support/helpers/controller_level_helpers.rb +0 -25
- data/spec/support/stub_iiif_response.rb +0 -26
- data/spec/support/views/test_view_helpers.rb +0 -21
- data/spec/test_app_templates/Gemfile.extra +0 -2
- data/spec/test_app_templates/carrierwave.rb +0 -8
- data/spec/test_app_templates/catalog_controller.rb +0 -108
- data/spec/test_app_templates/fixture.css +0 -0
- data/spec/test_app_templates/fixture.png +0 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +0 -71
- data/spec/test_app_templates/spotlight_test.rake +0 -14
- data/spec/uploaders/spotlight/attachment_uploader_spec.rb +0 -27
- data/spec/uploaders/spotlight/featured_image_uploader_spec.rb +0 -33
- data/spec/views/shared/_analytics.html.erb_spec.rb +0 -17
- data/spec/views/shared/_exhibit_navbar.html.erb_spec.rb +0 -127
- data/spec/views/shared/_header_navbar.html.erb_spec.rb +0 -12
- data/spec/views/shared/_masthead.html.erb_spec.rb +0 -91
- data/spec/views/shared/_user_util_links.html.erb_spec.rb +0 -102
- data/spec/views/spotlight/about_pages/_empty.html.erb_spec.rb +0 -28
- data/spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb +0 -24
- data/spec/views/spotlight/about_pages/index.html.erb_spec.rb +0 -69
- data/spec/views/spotlight/browse/_search.html.erb_spec.rb +0 -30
- data/spec/views/spotlight/browse/index.html.erb_spec.rb +0 -22
- data/spec/views/spotlight/browse/show.html.erb_spec.rb +0 -65
- data/spec/views/spotlight/catalog/_edit_default.html.erb_spec.rb +0 -63
- data/spec/views/spotlight/catalog/admin.html.erb_spec.rb +0 -39
- data/spec/views/spotlight/catalog/edit.html.erb_spec.rb +0 -20
- data/spec/views/spotlight/contacts/edit.html.erb_spec.rb +0 -43
- data/spec/views/spotlight/dashboards/_analytics.html.erb_spec.rb +0 -45
- data/spec/views/spotlight/dashboards/_reindexing_activity.html.erb_spec.rb +0 -94
- data/spec/views/spotlight/dashboards/analytics.html.erb_spec.rb +0 -33
- data/spec/views/spotlight/exhibits/_exhibit_card.html.erb_spec.rb +0 -46
- data/spec/views/spotlight/exhibits/_form.html.erb_spec.rb +0 -38
- data/spec/views/spotlight/exhibits/edit.html.erb_spec.rb +0 -29
- data/spec/views/spotlight/exhibits/index.html.erb_spec.rb +0 -140
- data/spec/views/spotlight/feature_pages/_empty.html.erb_spec.rb +0 -28
- data/spec/views/spotlight/feature_pages/_sidebar.html.erb_spec.rb +0 -45
- data/spec/views/spotlight/featured_images/_form.html.erb_spec.rb +0 -32
- data/spec/views/spotlight/featured_images/_upload_form.html.erb_spec.rb +0 -32
- data/spec/views/spotlight/home_pages/_empty.html.erb_spec.rb +0 -28
- data/spec/views/spotlight/home_pages/_sidebar.html.erb_spec.rb +0 -12
- data/spec/views/spotlight/job_trackers/show.html.erb_spec.rb +0 -65
- data/spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb +0 -30
- data/spec/views/spotlight/metadata_configurations/edit.html.erb_spec.rb +0 -23
- data/spec/views/spotlight/pages/_form.html.erb_spec.rb +0 -20
- data/spec/views/spotlight/pages/edit.html.erb_spec.rb +0 -68
- data/spec/views/spotlight/pages/index.html.erb_spec.rb +0 -42
- data/spec/views/spotlight/pages/new.html.erb_spec.rb +0 -21
- data/spec/views/spotlight/pages/show.html.erb_spec.rb +0 -84
- data/spec/views/spotlight/resources/_external_resources_form.html.erb_spec.rb +0 -36
- data/spec/views/spotlight/resources/new.html.erb_spec.rb +0 -30
- data/spec/views/spotlight/roles/index.html.erb_spec.rb +0 -30
- data/spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb +0 -58
- data/spec/views/spotlight/search_configurations/_facets.html.erb_spec.rb +0 -54
- data/spec/views/spotlight/search_configurations/_search_fields.html.erb_spec.rb +0 -54
- data/spec/views/spotlight/search_configurations/_sort.html.erb_spec.rb +0 -40
- data/spec/views/spotlight/searches/_search.html.erb_spec.rb +0 -37
- data/spec/views/spotlight/searches/edit.html.erb_spec.rb +0 -40
- data/spec/views/spotlight/searches/index.html.erb_spec.rb +0 -33
- data/spec/views/spotlight/sir_trevor/blocks/_browse_block.html.erb_spec.rb +0 -20
- data/spec/views/spotlight/sir_trevor/blocks/_iframe_block.html.erb_spec.rb +0 -20
- data/spec/views/spotlight/sir_trevor/blocks/_link_to_search_block.html.erb_spec.rb +0 -20
- data/spec/views/spotlight/sir_trevor/blocks/_rule_block.html.erb_spec.rb +0 -10
- data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb_spec.rb +0 -43
- data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb_spec.rb +0 -34
- data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb +0 -53
- data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb_spec.rb +0 -54
- data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb_spec.rb +0 -42
- data/spec/views/spotlight/sites/edit_exhibits.html.erb_spec.rb +0 -25
- data/spec/views/spotlight/tags/index.html.erb_spec.rb +0 -27
- data/spec/views/spotlight/translations/_import.html.erb_spec.rb +0 -24
- data/spec/views/spotlight/translations/_page.html.erb_spec.rb +0 -76
data/spec/spec_helper.rb
DELETED
@@ -1,146 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
ENV['RAILS_ENV'] ||= 'test'
|
4
|
-
require 'factory_bot'
|
5
|
-
require 'devise'
|
6
|
-
require 'engine_cart'
|
7
|
-
EngineCart.load_application!
|
8
|
-
|
9
|
-
Internal::Application.config.active_job.queue_adapter = :inline
|
10
|
-
|
11
|
-
require 'rails-controller-testing'
|
12
|
-
require 'rspec/collection_matchers'
|
13
|
-
require 'rspec/its'
|
14
|
-
require 'rspec/rails'
|
15
|
-
require 'rspec/active_model/mocks'
|
16
|
-
require 'paper_trail/frameworks/rspec'
|
17
|
-
|
18
|
-
require 'selenium-webdriver'
|
19
|
-
require 'webdrivers'
|
20
|
-
require 'webmock/rspec'
|
21
|
-
|
22
|
-
Capybara.javascript_driver = :headless_chrome
|
23
|
-
|
24
|
-
Capybara.register_driver :headless_chrome do |app|
|
25
|
-
Capybara::Selenium::Driver.load_selenium
|
26
|
-
browser_options = ::Selenium::WebDriver::Chrome::Options.new.tap do |opts|
|
27
|
-
opts.args << '--headless'
|
28
|
-
opts.args << '--disable-gpu'
|
29
|
-
opts.args << '--no-sandbox'
|
30
|
-
opts.args << '--window-size=1280,1696'
|
31
|
-
end
|
32
|
-
Capybara::Selenium::Driver.new(app, browser: :chrome, capabilities: [browser_options])
|
33
|
-
end
|
34
|
-
require 'webmock/rspec'
|
35
|
-
allowed_sites = ['chromedriver.storage.googleapis.com']
|
36
|
-
|
37
|
-
WebMock.disable_net_connect!(net_http_connect_on_start: true, allow_localhost: true, allow: allowed_sites)
|
38
|
-
|
39
|
-
if ENV['COVERAGE'] || ENV['CI']
|
40
|
-
require 'simplecov'
|
41
|
-
|
42
|
-
SimpleCov.start do
|
43
|
-
add_filter '/spec/'
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
require 'spotlight'
|
48
|
-
|
49
|
-
# configure spotlight with all the settings necessary to test functionality
|
50
|
-
Spotlight::Engine.config.reindexing_batch_count = 1
|
51
|
-
Spotlight::Engine.config.assign_default_roles_to_first_user = false
|
52
|
-
|
53
|
-
Dir['./spec/support/**/*.rb'].sort.each { |f| require f }
|
54
|
-
|
55
|
-
FactoryBot.definition_file_paths = [File.expand_path('factories', __dir__)]
|
56
|
-
FactoryBot.find_definitions
|
57
|
-
|
58
|
-
FIXTURES_PATH = File.expand_path('fixtures', __dir__)
|
59
|
-
|
60
|
-
RSpec.configure do |config|
|
61
|
-
config.infer_spec_type_from_file_location!
|
62
|
-
config.filter_rails_from_backtrace!
|
63
|
-
|
64
|
-
config.use_transactional_fixtures = true
|
65
|
-
|
66
|
-
if defined? Devise::Test::ControllerHelpers
|
67
|
-
config.include Devise::Test::ControllerHelpers, type: :controller
|
68
|
-
config.include Devise::Test::ControllerHelpers, type: :view
|
69
|
-
else
|
70
|
-
config.include Devise::TestHelpers, type: :controller
|
71
|
-
config.include Devise::TestHelpers, type: :view
|
72
|
-
end
|
73
|
-
|
74
|
-
config.include Spotlight::TestViewHelpers, type: :view
|
75
|
-
config.include Warden::Test::Helpers, type: :feature
|
76
|
-
|
77
|
-
config.include(ControllerLevelHelpers, type: :helper)
|
78
|
-
config.before(:each, type: :helper) { initialize_controller_helpers(helper) }
|
79
|
-
|
80
|
-
config.include(ControllerLevelHelpers, type: :view)
|
81
|
-
config.before(:each, type: :view) { initialize_controller_helpers(view) }
|
82
|
-
|
83
|
-
config.after(:each, type: :feature) { Warden.test_reset! }
|
84
|
-
config.include Controllers::EngineHelpers, type: :controller
|
85
|
-
config.include Capybara::DSL
|
86
|
-
config.include ::Rails.application.routes.url_helpers
|
87
|
-
config.include ::Rails.application.routes.mounted_helpers
|
88
|
-
config.include Spotlight::TestFeaturesHelpers, type: :feature
|
89
|
-
config.include CapybaraDefaultMaxWaitMetadataHelper, type: :feature
|
90
|
-
|
91
|
-
config.expect_with :rspec do |expectations|
|
92
|
-
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
93
|
-
end
|
94
|
-
|
95
|
-
config.default_formatter = 'doc' if config.files_to_run.one?
|
96
|
-
|
97
|
-
config.shared_context_metadata_behavior = :apply_to_host_groups
|
98
|
-
|
99
|
-
# This allows you to limit a spec run to individual examples or groups
|
100
|
-
# you care about by tagging them with `:focus` metadata. When nothing
|
101
|
-
# is tagged with `:focus`, all examples get run. RSpec also provides
|
102
|
-
# aliases for `it`, `describe`, and `context` that include `:focus`
|
103
|
-
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
104
|
-
config.filter_run_when_matching :focus
|
105
|
-
|
106
|
-
config.example_status_persistence_file_path = 'spec/examples.txt'
|
107
|
-
# Many RSpec users commonly either run the entire suite or an individual
|
108
|
-
# file, and it's useful to allow more verbose output when running an
|
109
|
-
# individual spec file.
|
110
|
-
if config.files_to_run.one?
|
111
|
-
# Use the documentation formatter for detailed output,
|
112
|
-
# unless a formatter has already been configured
|
113
|
-
# (e.g. via a command-line flag).
|
114
|
-
config.default_formatter = 'doc'
|
115
|
-
end
|
116
|
-
|
117
|
-
# Print the 10 slowest examples and example groups at the
|
118
|
-
# end of the spec run, to help surface which specs are running
|
119
|
-
# particularly slow.
|
120
|
-
config.profile_examples = 10
|
121
|
-
|
122
|
-
# Run specs in random order to surface order dependencies. If you find an
|
123
|
-
# order dependency and want to debug it, you can fix the order by providing
|
124
|
-
# the seed, which is printed after each run.
|
125
|
-
# --seed 1234
|
126
|
-
# config.order = :random
|
127
|
-
|
128
|
-
# Seed global randomization in this process using the `--seed` CLI option.
|
129
|
-
# Setting this allows you to use `--seed` to deterministically reproduce
|
130
|
-
# test failures related to randomization by passing the same `--seed` value
|
131
|
-
# as the one that triggered the failure.
|
132
|
-
Kernel.srand config.seed
|
133
|
-
end
|
134
|
-
|
135
|
-
def add_new_via_button(title = 'New Page')
|
136
|
-
add_link = find('[data-expanded-add-button]')
|
137
|
-
within(add_link) do
|
138
|
-
expect(page).to have_css("input[type='text']", visible: false)
|
139
|
-
end
|
140
|
-
add_link.hover
|
141
|
-
within(add_link) do
|
142
|
-
input = find("input[type='text']", visible: true)
|
143
|
-
input.set(title)
|
144
|
-
find("input[data-behavior='save']").click
|
145
|
-
end
|
146
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
if Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR <= 1
|
4
|
-
default_deprecation_behaviours = ActiveSupport::Deprecation.behavior
|
5
|
-
ActiveSupport::Deprecation.behavior = lambda do |message, callstack|
|
6
|
-
unless callstack.find { |l| l.path =~ %r{gems/friendly_id} } &&
|
7
|
-
message =~ /The behavior of .* inside of after callbacks will be changing/
|
8
|
-
default_deprecation_behaviours.each { |b| b.call(message, callstack) }
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module CapybaraDefaultMaxWaitMetadataHelper
|
4
|
-
extend ActiveSupport::Concern
|
5
|
-
|
6
|
-
included do
|
7
|
-
before do |example|
|
8
|
-
next unless example.metadata[:default_max_wait_time]
|
9
|
-
|
10
|
-
@previous_wait_time = Capybara.default_max_wait_time
|
11
|
-
Capybara.default_max_wait_time = example.metadata[:default_max_wait_time]
|
12
|
-
end
|
13
|
-
|
14
|
-
after do |example|
|
15
|
-
next unless example.metadata[:default_max_wait_time]
|
16
|
-
|
17
|
-
Capybara.default_max_wait_time = @previous_wait_time
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,92 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Spotlight
|
4
|
-
module TestFeaturesHelpers
|
5
|
-
def fill_in_typeahead_field(opts = {})
|
6
|
-
type = opts[:type] || 'twitter'
|
7
|
-
# Poltergeist / Capybara doesn't fire the events typeahead.js
|
8
|
-
# is listening for, so we help it out a little:
|
9
|
-
page.execute_script <<-EOF
|
10
|
-
$("[data-#{type}-typeahead]:visible").val("#{opts[:with]}").trigger("input");
|
11
|
-
$("[data-#{type}-typeahead]:visible").typeahead("open");
|
12
|
-
$(".tt-suggestion").click();
|
13
|
-
EOF
|
14
|
-
|
15
|
-
find('.tt-suggestion', text: opts[:with], match: :first).click
|
16
|
-
end
|
17
|
-
|
18
|
-
##
|
19
|
-
# For typeahead "prefetched" fields, we need to wait for a resolved selector
|
20
|
-
# before proceeding.
|
21
|
-
def fill_in_prefetched_typeahead_field(opts)
|
22
|
-
type = opts[:type] || 'twitter'
|
23
|
-
# Poltergeist / Capybara doesn't fire the events typeahead.js
|
24
|
-
# is listening for, so we help it out a little:
|
25
|
-
find(opts[:wait_for]) if opts[:wait_for]
|
26
|
-
page.execute_script <<-EOF
|
27
|
-
$("[data-#{type}-typeahead]:visible").val("#{opts[:with]}").trigger("input");
|
28
|
-
$("[data-#{type}-typeahead]:visible").typeahead("open");
|
29
|
-
$(".tt-suggestion").click();
|
30
|
-
EOF
|
31
|
-
end
|
32
|
-
|
33
|
-
# just like #fill_in_typeahead_field, but wait for the
|
34
|
-
# form fields to show up on the page too
|
35
|
-
def fill_in_solr_document_block_typeahead_field(opts)
|
36
|
-
fill_in_typeahead_field(opts)
|
37
|
-
expect(page).to have_css('li[data-resource-id="' + opts[:with] + '"]')
|
38
|
-
end
|
39
|
-
|
40
|
-
def add_widget(type)
|
41
|
-
click_add_widget
|
42
|
-
|
43
|
-
# click the item + image widget
|
44
|
-
expect(page).to have_css("button[data-type='#{type}']")
|
45
|
-
find("button[data-type='#{type}']").click
|
46
|
-
end
|
47
|
-
|
48
|
-
def click_add_widget
|
49
|
-
unless all('.st-block-replacer').present?
|
50
|
-
expect(page).to have_css('.st-block-addition')
|
51
|
-
first('.st-block-addition').click
|
52
|
-
end
|
53
|
-
expect(page).to have_css('.st-block-replacer')
|
54
|
-
first('.st-block-replacer').click
|
55
|
-
end
|
56
|
-
|
57
|
-
def save_page
|
58
|
-
page.execute_script <<-EOF
|
59
|
-
SirTrevor.getInstance().onFormSubmit();
|
60
|
-
EOF
|
61
|
-
click_button('Save changes')
|
62
|
-
# verify that the page was created
|
63
|
-
expect(page).not_to have_selector('.alert-danger')
|
64
|
-
expect(page).to have_selector('.alert-info', text: 'page was successfully updated')
|
65
|
-
end
|
66
|
-
|
67
|
-
RSpec::Matchers.define :have_breadcrumbs do |*expected|
|
68
|
-
match do |actual|
|
69
|
-
errors = []
|
70
|
-
errors << 'Unable to find breadcrumbs' unless actual.has_css? '.breadcrumb'
|
71
|
-
|
72
|
-
breadcrumbs = expected.dup
|
73
|
-
|
74
|
-
actual.within('.breadcrumb') do
|
75
|
-
last = breadcrumbs.pop
|
76
|
-
breadcrumbs.each do |e|
|
77
|
-
errors << "Unable to find breadcrumb #{e}" unless actual.has_link? e
|
78
|
-
end
|
79
|
-
|
80
|
-
errors << "Unable to find breadcrumb #{last}" unless actual.has_content? last
|
81
|
-
errors << "Expected #{last} not to be a link" if actual.has_link? last
|
82
|
-
end
|
83
|
-
|
84
|
-
errors.empty?
|
85
|
-
end
|
86
|
-
|
87
|
-
failure_message do |actual|
|
88
|
-
"expected that #{actual.all('.breadcrumb li').map(&:text).join(' / ')} would include #{expected.join(' / ')}"
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ControllerLevelHelpers
|
4
|
-
def search_state
|
5
|
-
@search_state ||= Blacklight::SearchState.new(params, blacklight_config)
|
6
|
-
end
|
7
|
-
|
8
|
-
def current_site
|
9
|
-
Spotlight::Site.instance
|
10
|
-
end
|
11
|
-
|
12
|
-
def blacklight_configuration_context
|
13
|
-
@blacklight_configuration_context ||= Blacklight::Configuration::Context.new(controller)
|
14
|
-
end
|
15
|
-
|
16
|
-
def initialize_controller_helpers(helper)
|
17
|
-
helper.extend ControllerLevelHelpers
|
18
|
-
initialize_routing_helpers(helper)
|
19
|
-
end
|
20
|
-
|
21
|
-
def initialize_routing_helpers(helper)
|
22
|
-
helper.class.include ::Rails.application.routes.url_helpers
|
23
|
-
helper.class.include ::Rails.application.routes.mounted_helpers if ::Rails.application.routes.respond_to?(:mounted_helpers)
|
24
|
-
end
|
25
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'fixtures/iiif_responses'
|
4
|
-
module StubIiifResponse
|
5
|
-
def stub_iiif_response_for_url(url, response)
|
6
|
-
allow(Spotlight::Resources::IiifService).to receive(:iiif_response).with(url).and_return(response)
|
7
|
-
end
|
8
|
-
|
9
|
-
def stub_default_collection
|
10
|
-
allow_any_instance_of(Spotlight::Resources::IiifHarvester).to receive_messages(url_is_iiif?: true)
|
11
|
-
stub_iiif_response_for_url('uri://for-top-level-collection', complex_collection)
|
12
|
-
stub_iiif_response_for_url('uri://for-child-collection1', child_collection1)
|
13
|
-
stub_iiif_response_for_url('uri://for-child-collection2', child_collection2)
|
14
|
-
stub_iiif_response_for_url('uri://for-child-collection3', child_collection3)
|
15
|
-
|
16
|
-
stub_iiif_response_for_url('uri://for-manifest1', test_manifest1)
|
17
|
-
stub_iiif_response_for_url('uri://for-manifest2', test_manifest2)
|
18
|
-
stub_iiif_response_for_url('uri://for-manifest3', test_manifest3)
|
19
|
-
stub_iiif_response_for_url('uri://for-manifest4', test_manifest4)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
RSpec.configure do |config|
|
24
|
-
config.include IiifResponses
|
25
|
-
config.include StubIiifResponse
|
26
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Spotlight
|
4
|
-
module TestViewHelpers
|
5
|
-
extend ActiveSupport::Concern
|
6
|
-
|
7
|
-
included do
|
8
|
-
before do
|
9
|
-
view.send(:extend, Spotlight::RenderingHelper)
|
10
|
-
view.send(:extend, Spotlight::MainAppHelpers)
|
11
|
-
view.send(:extend, Spotlight::CrudLinkHelpers)
|
12
|
-
view.send(:extend, Spotlight::TitleHelper)
|
13
|
-
view.send(:extend, Spotlight::NavbarHelper)
|
14
|
-
view.send(:extend, Spotlight::CropHelper)
|
15
|
-
view.send(:extend, Spotlight::PagesHelper)
|
16
|
-
view.send(:extend, Blacklight::ComponentHelperBehavior)
|
17
|
-
view.send(:extend, BreadcrumbsOnRails::ActionController::HelperMethods)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,108 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class CatalogController < ApplicationController
|
4
|
-
include Blacklight::Catalog
|
5
|
-
helper Openseadragon::OpenseadragonHelper
|
6
|
-
before_action :set_paper_trail_whodunnit
|
7
|
-
|
8
|
-
configure_blacklight do |config|
|
9
|
-
config.view.gallery(document_component: Blacklight::Gallery::DocumentComponent)
|
10
|
-
# config.view.gallery.classes = 'row-cols-2 row-cols-md-3'
|
11
|
-
config.view.masonry(document_component: Blacklight::Gallery::DocumentComponent)
|
12
|
-
config.view.slideshow(document_component: Blacklight::Gallery::SlideshowComponent)
|
13
|
-
config.show.tile_source_field = :content_metadata_image_iiif_info_ssm
|
14
|
-
config.show.partials.insert(1, :openseadragon)
|
15
|
-
## Default parameters to send to solr for all search-like requests. See also SolrHelper#solr_search_params
|
16
|
-
config.default_solr_params = {
|
17
|
-
qt: 'search',
|
18
|
-
rows: 10,
|
19
|
-
fl: '*'
|
20
|
-
}
|
21
|
-
|
22
|
-
## Default parameters to send on single-document requests to Solr. These settings are the Blackligt defaults (see SolrHelper#solr_doc_params) or
|
23
|
-
## parameters included in the Blacklight document requestHandler.
|
24
|
-
#
|
25
|
-
# config.default_document_solr_params = {
|
26
|
-
# :qt => 'document',
|
27
|
-
# ## These are hard-coded in the blacklight 'document' requestHandler
|
28
|
-
# # :fl => '*',
|
29
|
-
# # :rows => 1
|
30
|
-
# # :q => '{!raw f=id v=$id}'
|
31
|
-
# }
|
32
|
-
|
33
|
-
# solr field configuration for search results/index views
|
34
|
-
config.index.title_field = 'full_title_tesim'
|
35
|
-
config.index.display_type_field = 'content_metadata_type_ssm'
|
36
|
-
config.index.thumbnail_field = Spotlight::Engine.config.thumbnail_field
|
37
|
-
|
38
|
-
config.show.tile_source_field = :content_metadata_image_iiif_info_ssm
|
39
|
-
|
40
|
-
config.add_results_collection_tool(:sort_widget)
|
41
|
-
config.add_results_collection_tool(:per_page_widget)
|
42
|
-
config.add_results_collection_tool(:view_type_group)
|
43
|
-
|
44
|
-
# solr fields that will be treated as facets by the blacklight application
|
45
|
-
# The ordering of the field names is the order of the display
|
46
|
-
#
|
47
|
-
# Setting a limit will trigger Blacklight's 'more' facet values link.
|
48
|
-
# * If left unset, then all facet values returned by solr will be displayed.
|
49
|
-
# * If set to an integer, then "f.somefield.facet.limit" will be added to
|
50
|
-
# solr request, with actual solr request being +1 your configured limit --
|
51
|
-
# you configure the number of items you actually want _displayed_ in a page.
|
52
|
-
# * If set to 'true', then no additional parameters will be sent to solr,
|
53
|
-
# but any 'sniffed' request limit parameters will be used for paging, with
|
54
|
-
# paging at requested limit -1. Can sniff from facet.limit or
|
55
|
-
# f.specific_field.facet.limit solr request params. This 'true' config
|
56
|
-
# can be used if you set limits in :default_solr_params, or as defaults
|
57
|
-
# on the solr side in the request handler itself. Request handler defaults
|
58
|
-
# sniffing requires solr requests to be made with "echoParams=all", for
|
59
|
-
# app code to actually have it echo'd back to see it.
|
60
|
-
#
|
61
|
-
# :show may be set to false if you don't want the facet to be drawn in the
|
62
|
-
# facet bar
|
63
|
-
config.add_facet_field 'genre_ssim', label: I18n.t('spotlight.search.fields.facet.genre_ssim'), limit: true
|
64
|
-
config.add_facet_field 'personal_name_ssm', label: I18n.t('spotlight.search.fields.facet.personal_name_ssm'), limit: true
|
65
|
-
config.add_facet_field 'corporate_name_ssm', label: I18n.t('spotlight.search.fields.facet.corporate_name_ssm'), limit: true
|
66
|
-
config.add_facet_field 'subject_geographic_ssim', label: I18n.t('spotlight.search.fields.facet.subject_geographic_ssim')
|
67
|
-
config.add_facet_field 'subject_temporal_ssim', label: I18n.t('spotlight.search.fields.facet.subject_temporal_ssim')
|
68
|
-
config.add_facet_field 'language_ssim', label: I18n.t('spotlight.search.fields.facet.language_ssim')
|
69
|
-
|
70
|
-
# Have BL send all facet field names to Solr, which has been the default
|
71
|
-
# previously. Simply remove these lines if you'd rather use Solr request
|
72
|
-
# handler defaults, or have no facets.
|
73
|
-
config.add_facet_fields_to_solr_request!
|
74
|
-
|
75
|
-
# solr fields to be displayed in the index (search results) view
|
76
|
-
# The ordering of the field names is the order of the display
|
77
|
-
config.add_index_field 'language_ssm', label: I18n.t('spotlight.search.fields.language_ssm')
|
78
|
-
config.add_index_field 'abstract_tesim', label: I18n.t('spotlight.search.fields.abstract_tesim')
|
79
|
-
config.add_index_field 'note_mapuse_tesim', label: I18n.t('spotlight.search.fields.note_mapuse_tesim')
|
80
|
-
config.add_index_field 'note_source_tesim', label: I18n.t('spotlight.search.fields.note_source_tesim')
|
81
|
-
config.add_index_field 'subject_geographic_tesim', label: I18n.t('spotlight.search.fields.subject_geographic_tesim')
|
82
|
-
config.add_index_field 'subject_temporal_tesim', label: I18n.t('spotlight.search.fields.subject_temporal_tesim')
|
83
|
-
|
84
|
-
# solr fields to be displayed in the show (single result) view
|
85
|
-
# The ordering of the field names is the order of the display
|
86
|
-
config.add_show_field 'note_phys_desc_tesim', label: I18n.t('spotlight.search.fields.note_phys_desc_tesim')
|
87
|
-
config.add_show_field 'note_source_tesim', label: I18n.t('spotlight.search.fields.note_source_tesim')
|
88
|
-
config.add_show_field 'note_desc_note_tesim', label: I18n.t('spotlight.search.fields.note_desc_note_tesim')
|
89
|
-
config.add_show_field 'note_references_tesim', label: I18n.t('spotlight.search.fields.note_references_tesim')
|
90
|
-
config.add_show_field 'note_provenance_tesim', label: I18n.t('spotlight.search.fields.note_provenance_tesim')
|
91
|
-
config.add_show_field 'note_page_num_tesim', label: I18n.t('spotlight.search.fields.note_page_num_tesim')
|
92
|
-
config.add_show_field 'subject_geographic_tesim', label: I18n.t('spotlight.search.fields.subject_geographic_tesim')
|
93
|
-
config.add_show_field 'subject_temporal_tesim', label: I18n.t('spotlight.search.fields.subject_temporal_tesim')
|
94
|
-
config.add_show_field 'personal_name_ssm', label: I18n.t('spotlight.search.fields.personal_name_ssm')
|
95
|
-
config.add_show_field 'corporate_name_ssm', label: I18n.t('spotlight.search.fields.corporate_name_ssm')
|
96
|
-
|
97
|
-
config.add_search_field 'all_fields', label: I18n.t('spotlight.search.fields.search.all_fields')
|
98
|
-
config.add_search_field 'title', label: I18n.t('spotlight.search.fields.search.title'), solr_parameters: { qf: 'full_title_tesim', pf: 'full_title_tesim' }
|
99
|
-
config.add_search_field 'author', label: I18n.t('spotlight.search.fields.search.author'), solr_parameters: { qf: '${qf_author}', pf: '${pf_author}' }
|
100
|
-
|
101
|
-
config.add_sort_field 'relevance', sort: 'score desc, sort_title_ssi asc', label: I18n.t('spotlight.search.fields.sort.relevance')
|
102
|
-
config.add_sort_field 'title', sort: 'sort_title_ssi asc', label: I18n.t('spotlight.search.fields.sort.title')
|
103
|
-
config.add_sort_field 'type', sort: 'sort_type_ssi asc', label: I18n.t('spotlight.search.fields.sort.type')
|
104
|
-
config.add_sort_field 'source', sort: 'sort_source_ssi asc', label: I18n.t('spotlight.search.fields.sort.source')
|
105
|
-
config.add_sort_field 'identifier', sort: 'id asc', label: I18n.t('spotlight.search.fields.sort.identifier')
|
106
|
-
config.add_sort_field 'date', sort: 'sort_date_dtsi desc', label: I18n.t('spotlight.search.fields.sort.date')
|
107
|
-
end
|
108
|
-
end
|
File without changes
|
Binary file
|
@@ -1,71 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'rails/generators'
|
4
|
-
|
5
|
-
class TestAppGenerator < Rails::Generators::Base
|
6
|
-
source_root '../spec/test_app_templates'
|
7
|
-
|
8
|
-
def use_capybara3
|
9
|
-
gsub_file 'Gemfile', /gem 'capybara'/, '# gem \'capybara\''
|
10
|
-
end
|
11
|
-
|
12
|
-
def add_gems
|
13
|
-
gem 'blacklight', '~> 7.17'
|
14
|
-
gem 'blacklight-gallery', '~> 4.0'
|
15
|
-
Bundler.with_clean_env do
|
16
|
-
run 'bundle install'
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
def run_blacklight_generator
|
21
|
-
say_status('warning', 'GENERATING BL', :yellow)
|
22
|
-
|
23
|
-
generate 'blacklight:install', '--devise'
|
24
|
-
end
|
25
|
-
|
26
|
-
def run_spotlight_migrations
|
27
|
-
rake 'spotlight:install:migrations'
|
28
|
-
rake 'db:migrate'
|
29
|
-
end
|
30
|
-
|
31
|
-
def add_spotlight_routes_and_assets
|
32
|
-
generate 'spotlight:install', '-f --mailer_default_url_host=localhost:3000'
|
33
|
-
end
|
34
|
-
|
35
|
-
def install_test_catalog_controller
|
36
|
-
copy_file 'catalog_controller.rb', 'app/controllers/catalog_controller.rb', force: true
|
37
|
-
end
|
38
|
-
|
39
|
-
def add_rake_tasks_to_app
|
40
|
-
rakefile 'spotlight_test.rake', File.read(find_in_source_paths('spotlight_test.rake'))
|
41
|
-
end
|
42
|
-
|
43
|
-
def disable_carrierwave_processing
|
44
|
-
copy_file 'carrierwave.rb', 'config/initializers/carrierwave.rb'
|
45
|
-
end
|
46
|
-
|
47
|
-
def add_theme_assets
|
48
|
-
copy_file 'fixture.png', 'app/assets/images/spotlight/themes/default_preview.png'
|
49
|
-
copy_file 'fixture.png', 'app/assets/images/spotlight/themes/modern_preview.png'
|
50
|
-
|
51
|
-
copy_file 'fixture.css', 'app/assets/stylesheets/application_modern.css'
|
52
|
-
append_to_file 'config/initializers/assets.rb', 'Rails.application.config.assets.precompile += %w( application_modern.css )'
|
53
|
-
|
54
|
-
append_to_file 'config/initializers/spotlight_initializer.rb', "\nSpotlight::Engine.config.exhibit_themes = %w[default modern]"
|
55
|
-
end
|
56
|
-
|
57
|
-
def disable_filter_resources_by_exhibit
|
58
|
-
initializer 'disable_filter_resources_by_exhibit.rb' do
|
59
|
-
<<-EOF
|
60
|
-
# Setting this to false when running tests so that we don't have to set up
|
61
|
-
# exhibit specific solr documents for tests that don't use the default exhibit.
|
62
|
-
Spotlight::Engine.config.filter_resources_by_exhibit = false
|
63
|
-
EOF
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
def raise_on_missing_translation
|
68
|
-
uncomment_lines 'config/environments/development.rb', /config.action_view.raise_on_missing_translations/
|
69
|
-
uncomment_lines 'config/environments/test.rb', /config.action_view.raise_on_missing_translations/
|
70
|
-
end
|
71
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'rake'
|
4
|
-
|
5
|
-
namespace :spotlight_test do
|
6
|
-
namespace :solr do
|
7
|
-
desc 'Index test data into solr; must be run from within an app (see spotlight:fixtures)'
|
8
|
-
task :seed do
|
9
|
-
docs = YAML.safe_load(File.open(File.expand_path(File.join('..', 'spec', 'fixtures', 'sample_solr_documents.yml'), Rails.root)))
|
10
|
-
Blacklight.default_index.connection.add docs
|
11
|
-
Blacklight.default_index.connection.commit
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe Spotlight::AttachmentUploader do
|
4
|
-
subject(:attachment_uploader) { described_class.new(mounter, 'mounted_as') }
|
5
|
-
|
6
|
-
let(:mounter) { Spotlight::Attachment.new(id: '5') }
|
7
|
-
|
8
|
-
describe '#store_dir' do
|
9
|
-
let(:store_dir) { attachment_uploader.store_dir }
|
10
|
-
|
11
|
-
it 'is prefixed with "uploads/spotlight"' do
|
12
|
-
expect(store_dir).to start_with 'uploads/spotlight/'
|
13
|
-
end
|
14
|
-
|
15
|
-
it "includes the mounter's class name" do
|
16
|
-
expect(store_dir).to match '/attachment/'
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'includes the mounted_as option' do
|
20
|
-
expect(store_dir).to match '/mounted_as/'
|
21
|
-
end
|
22
|
-
|
23
|
-
it "ends with the mounter's id" do
|
24
|
-
expect(store_dir).to end_with "/#{mounter.id}"
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe Spotlight::FeaturedImageUploader do
|
4
|
-
subject(:featured_image_uploader) { described_class.new(mounter, 'mounted_as') }
|
5
|
-
|
6
|
-
let(:mounter) { FactoryBot.create(:featured_image) }
|
7
|
-
|
8
|
-
describe '#extension_allowlist' do
|
9
|
-
it 'is the configured array of approved extension to be uploaded' do
|
10
|
-
expect(featured_image_uploader.extension_allowlist).to eq Spotlight::Engine.config.allowed_upload_extensions
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
describe '#store_dir' do
|
15
|
-
let(:store_dir) { featured_image_uploader.store_dir }
|
16
|
-
|
17
|
-
it 'is prefixed with "uploads/spotlight"' do
|
18
|
-
expect(store_dir).to start_with 'uploads/spotlight/'
|
19
|
-
end
|
20
|
-
|
21
|
-
it "includes the mounter's class name" do
|
22
|
-
expect(store_dir).to match '/featured_image/'
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'includes the mounted_as option' do
|
26
|
-
expect(store_dir).to match '/mounted_as/'
|
27
|
-
end
|
28
|
-
|
29
|
-
it "ends with the mounter's id" do
|
30
|
-
expect(store_dir).to end_with "/#{mounter.id}"
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'shared/_analytics', type: :view do
|
4
|
-
it 'is empty without Google Analytics configured' do
|
5
|
-
render
|
6
|
-
expect(rendered).to be_empty
|
7
|
-
end
|
8
|
-
|
9
|
-
it 'renders the GA script tag if the web property id is configured' do
|
10
|
-
allow(Spotlight::Engine.config).to receive(:ga_web_property_id).and_return('XYZ-234')
|
11
|
-
allow(Spotlight::Engine.config).to receive(:ga_anonymize_ip).and_return(true)
|
12
|
-
render
|
13
|
-
expect(rendered).to have_selector 'script', visible: false
|
14
|
-
expect(rendered).to have_content 'XYZ-234'
|
15
|
-
expect(rendered).to have_content "ga('set', 'anonymizeIp', true)"
|
16
|
-
end
|
17
|
-
end
|