blacklight-spotlight 3.3.0 → 3.4.2
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/pages_controller.rb +1 -1
- data/app/controllers/spotlight/roles_controller.rb +1 -1
- data/app/helpers/spotlight/pages_helper.rb +12 -0
- data/app/helpers/spotlight/title_helper.rb +0 -2
- data/app/models/sir_trevor_rails/block.rb +85 -0
- data/app/models/sir_trevor_rails/blocks/displayable.rb +1 -1
- data/app/models/spotlight/page_content/sir_trevor.rb +13 -4
- data/app/models/translation.rb +18 -0
- data/app/views/shared/_site_sidebar.html.erb +1 -1
- data/app/views/spotlight/sir_trevor/blocks/_video_block.html.erb +5 -0
- data/config/i18n-tasks.yml +1 -0
- data/config/locales/spotlight.de.yml +40 -0
- data/lib/generators/spotlight/install_generator.rb +40 -2
- data/lib/generators/spotlight/templates/config/initializers/translation.rb +5 -5
- data/lib/generators/spotlight/templates/solr/config/schema.xml +32 -50
- data/lib/generators/spotlight/templates/solr/config/solrconfig.xml +14 -12
- data/lib/spotlight/engine.rb +1 -1
- data/lib/spotlight/version.rb +1 -1
- data/lib/tasks/spotlight_tasks.rake +20 -0
- metadata +100 -597
- data/lib/generators/spotlight/templates/config/initializers/sir_trevor_rails.rb +0 -10
- data/spec/controllers/application_controller_spec.rb +0 -30
- data/spec/controllers/spotlight/about_pages_controller_spec.rb +0 -241
- 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/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 -88
- 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 -28
- 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 -28
- 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/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 -49
- 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 -303
- 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 -14
- 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 -147
- 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 -20
- 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 -69
- 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
@@ -1,158 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Browse pages' do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
|
6
|
-
context 'a browse page' do
|
7
|
-
let!(:search) { FactoryBot.create(:search, title: 'Some Saved Search', exhibit: exhibit, published: true) }
|
8
|
-
|
9
|
-
let(:mock_response) { Blacklight::Solr::Response.new({ response: { numFound: 10, docs: mock_documents } }, {}) }
|
10
|
-
let(:mock_documents) { [] }
|
11
|
-
|
12
|
-
before do
|
13
|
-
allow_any_instance_of(Blacklight::SearchService).to receive(:search_results).and_return([mock_response, mock_documents])
|
14
|
-
end
|
15
|
-
|
16
|
-
context 'with the standard exhibit masthead' do
|
17
|
-
it 'includes the search title and resource count in the body' do
|
18
|
-
visit spotlight.exhibit_browse_path(exhibit, search)
|
19
|
-
|
20
|
-
within '#main-container' do
|
21
|
-
expect(page).to have_selector 'h1', text: 'Some Saved Search'
|
22
|
-
end
|
23
|
-
|
24
|
-
expect(page).not_to have_selector '.masthead .h2', text: 'Some Saved Search'
|
25
|
-
end
|
26
|
-
|
27
|
-
it 'shows the search bar' do
|
28
|
-
visit spotlight.exhibit_browse_path(exhibit, search)
|
29
|
-
|
30
|
-
expect(page).to have_selector '.search-query-form'
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'has breadcrumbs' do
|
34
|
-
visit spotlight.exhibit_browse_path(exhibit, search)
|
35
|
-
|
36
|
-
expect(page).to have_selector '.breadcrumbs-container'
|
37
|
-
end
|
38
|
-
|
39
|
-
context 'when the exhibit is configured to not display the search bar' do
|
40
|
-
it 'does not show the search bar' do
|
41
|
-
expect_any_instance_of(Spotlight::Exhibit).to receive(:searchable?).at_least(:once).and_return(false)
|
42
|
-
|
43
|
-
visit spotlight.exhibit_browse_path(exhibit, search)
|
44
|
-
|
45
|
-
expect(page).not_to have_selector '.search-query-form'
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
context 'with a custom masthead' do
|
51
|
-
let(:masthead) { FactoryBot.create(:masthead, display: true, iiif_tilesource: 'http://test.host/images/1') }
|
52
|
-
|
53
|
-
before do
|
54
|
-
search.masthead = masthead
|
55
|
-
search.save!
|
56
|
-
end
|
57
|
-
|
58
|
-
it 'has a contextual masthead with the title and resource count' do
|
59
|
-
visit spotlight.exhibit_browse_path(exhibit, search)
|
60
|
-
|
61
|
-
expect(page).to have_selector '.masthead .h2', text: 'Some Saved Search'
|
62
|
-
|
63
|
-
within '#main-container' do
|
64
|
-
expect(page).not_to have_selector 'h1', text: 'Some Saved Search'
|
65
|
-
end
|
66
|
-
|
67
|
-
expect(page).to have_selector '.masthead small.item-count', text: /\d+ items/
|
68
|
-
end
|
69
|
-
|
70
|
-
it 'does not show the search bar' do
|
71
|
-
visit spotlight.exhibit_browse_path(exhibit, search)
|
72
|
-
|
73
|
-
expect(page).not_to have_selector '.search-query-form'
|
74
|
-
end
|
75
|
-
|
76
|
-
it 'does not have breadcrumbs' do
|
77
|
-
visit spotlight.exhibit_browse_path(exhibit, search)
|
78
|
-
|
79
|
-
expect(page).not_to have_selector '.breadcrumbs-container'
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
context 'in an exhibit that is configured to not show metadata in the default view' do
|
84
|
-
let(:mock_documents) do
|
85
|
-
[SolrDocument.new(id: 'abc123', language_ssm: %w[English Flemish])]
|
86
|
-
end
|
87
|
-
|
88
|
-
before do
|
89
|
-
blacklight_config = exhibit.blacklight_config
|
90
|
-
blacklight_config.index_fields.each do |_, config|
|
91
|
-
config.gallery = false
|
92
|
-
end
|
93
|
-
blacklight_config.save
|
94
|
-
|
95
|
-
allow_any_instance_of(Spotlight::BrowseController).to receive(:blacklight_config).and_return(
|
96
|
-
blacklight_config
|
97
|
-
)
|
98
|
-
end
|
99
|
-
|
100
|
-
it 'uses the appropriate view config' do
|
101
|
-
visit spotlight.exhibit_browse_path(exhibit, search)
|
102
|
-
|
103
|
-
expect(page).to have_css('#documents.documents-gallery .document', count: 1)
|
104
|
-
|
105
|
-
within '.document' do
|
106
|
-
expect(page).not_to have_css('dt')
|
107
|
-
expect(page).not_to have_css('dd')
|
108
|
-
end
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
|
-
context 'without a curator-selected view' do
|
113
|
-
it 'renders the gallery view' do
|
114
|
-
visit spotlight.exhibit_browse_path(exhibit, search)
|
115
|
-
expect(page).to have_selector '.view-type-gallery.active'
|
116
|
-
expect(page).to have_selector '#documents.documents-gallery'
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
|
-
context 'with a curator-selected default view' do
|
121
|
-
before do
|
122
|
-
search.update(default_index_view_type: 'list')
|
123
|
-
end
|
124
|
-
|
125
|
-
it 'renders the selected view' do
|
126
|
-
visit spotlight.exhibit_browse_path(exhibit, search)
|
127
|
-
expect(page).to have_selector '.view-type-list.active'
|
128
|
-
expect(page).to have_selector '#documents.documents-list'
|
129
|
-
end
|
130
|
-
end
|
131
|
-
|
132
|
-
context 'with category search box enabled' do
|
133
|
-
let(:search) { FactoryBot.create(:default_search, exhibit: exhibit, published: true, search_box: true) }
|
134
|
-
|
135
|
-
it 'renders search box' do
|
136
|
-
visit spotlight.exhibit_browse_path(exhibit, search)
|
137
|
-
expect(page).to have_selector '.browse-search-form'
|
138
|
-
expect(page).not_to have_css '.browse-search-expand'
|
139
|
-
|
140
|
-
fill_in 'Search within this browse category', with: 'SEPTENTRIONALE'
|
141
|
-
click_button 'Search within browse category'
|
142
|
-
|
143
|
-
expect(page).to have_css '.browse-search-expand'
|
144
|
-
end
|
145
|
-
end
|
146
|
-
|
147
|
-
it 'has <meta> tags' do
|
148
|
-
TopHat.current['twitter_card'] = nil
|
149
|
-
TopHat.current['opengraph'] = nil
|
150
|
-
|
151
|
-
visit spotlight.exhibit_browse_path(exhibit, search)
|
152
|
-
|
153
|
-
expect(page).to have_css "meta[name='twitter:title'][value='#{search.title}']", visible: false
|
154
|
-
expect(page).to have_css "meta[property='og:site_name']", visible: false
|
155
|
-
expect(page).to have_css "meta[property='og:title'][content='#{search.title}']", visible: false
|
156
|
-
end
|
157
|
-
end
|
158
|
-
end
|
@@ -1,72 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Bulk actions', type: :feature do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
let(:curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
6
|
-
|
7
|
-
before do
|
8
|
-
login_as curator
|
9
|
-
d = SolrDocument.new(id: 'dq287tq6352')
|
10
|
-
exhibit.tag(d.sidecar(exhibit), with: ['foo'], on: :tags)
|
11
|
-
d.make_private! exhibit
|
12
|
-
d.reindex
|
13
|
-
Blacklight.default_index.connection.commit
|
14
|
-
end
|
15
|
-
|
16
|
-
after do
|
17
|
-
d = SolrDocument.new(id: 'dq287tq6352')
|
18
|
-
exhibit.tag(d.sidecar(exhibit), with: [], on: :tags)
|
19
|
-
exhibit.owned_tags.destroy_all
|
20
|
-
d.make_public! exhibit
|
21
|
-
d.reindex
|
22
|
-
Blacklight.default_index.connection.commit
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'setting item visibility', js: true do
|
26
|
-
visit spotlight.search_exhibit_catalog_path(exhibit, { q: 'dq287tq6352' })
|
27
|
-
|
28
|
-
click_button 'Bulk actions'
|
29
|
-
click_link 'Change item visibility'
|
30
|
-
expect(page).to have_css 'h4', text: 'Change item visibility', visible: true
|
31
|
-
choose 'Private'
|
32
|
-
accept_confirm 'All items in the result set will be updated. Are you sure?' do
|
33
|
-
click_button 'Change'
|
34
|
-
end
|
35
|
-
expect(page).to have_css '.alert', text: 'Visibility of 1 item is being updated.'
|
36
|
-
expect(SolrDocument.new(id: 'dq287tq6352').private?(exhibit)).to be true
|
37
|
-
end
|
38
|
-
|
39
|
-
it 'adding tags', js: true do
|
40
|
-
visit spotlight.search_exhibit_catalog_path(exhibit, { q: 'dq287tq6352' })
|
41
|
-
|
42
|
-
click_button 'Bulk actions'
|
43
|
-
click_link 'Add tags'
|
44
|
-
expect(page).to have_css 'h4', text: 'Add tags', visible: true
|
45
|
-
within '#add-tags-modal' do
|
46
|
-
find('[data-autocomplete-fetched="true"]', visible: false)
|
47
|
-
find('.tt-input').set('good,stuff')
|
48
|
-
end
|
49
|
-
accept_confirm 'All items in the result set will be updated. Are you sure?' do
|
50
|
-
click_button 'Add'
|
51
|
-
end
|
52
|
-
expect(page).to have_css '.alert', text: 'Tags are being added for 1 item.'
|
53
|
-
expect(SolrDocument.new(id: 'dq287tq6352').sidecar(exhibit).all_tags_list).to include('foo', 'good', 'stuff')
|
54
|
-
end
|
55
|
-
|
56
|
-
it 'removing tags', js: true do
|
57
|
-
visit spotlight.search_exhibit_catalog_path(exhibit, { q: 'dq287tq6352' })
|
58
|
-
|
59
|
-
click_button 'Bulk actions'
|
60
|
-
click_link 'Remove tags'
|
61
|
-
expect(page).to have_css 'h4', text: 'Remove tags', visible: true
|
62
|
-
within '#remove-tags-modal' do
|
63
|
-
find('[data-autocomplete-fetched="true"]', visible: false)
|
64
|
-
find('.tt-input').set('foo')
|
65
|
-
end
|
66
|
-
accept_confirm 'All items in the result set will be updated. Are you sure?' do
|
67
|
-
click_button 'Remove'
|
68
|
-
end
|
69
|
-
expect(page).to have_css '.alert', text: 'Tags are being removed for 1 item.'
|
70
|
-
expect(SolrDocument.new(id: 'dq287tq6352').sidecar(exhibit).all_tags_list).to eq []
|
71
|
-
end
|
72
|
-
end
|
@@ -1,57 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Catalog', type: :feature do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
|
6
|
-
describe 'admin' do
|
7
|
-
let(:curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
8
|
-
|
9
|
-
before do
|
10
|
-
login_as curator
|
11
|
-
d = SolrDocument.new(id: 'dq287tq6352')
|
12
|
-
d.make_private! exhibit
|
13
|
-
d.reindex
|
14
|
-
Blacklight.default_index.connection.commit
|
15
|
-
end
|
16
|
-
|
17
|
-
after do
|
18
|
-
d = SolrDocument.new(id: 'dq287tq6352')
|
19
|
-
d.make_public! exhibit
|
20
|
-
d.reindex
|
21
|
-
Blacklight.default_index.connection.commit
|
22
|
-
end
|
23
|
-
|
24
|
-
it "has a 'Item Visiblity' facet" do
|
25
|
-
visit spotlight.search_exhibit_catalog_path(exhibit)
|
26
|
-
expect(page).to have_selector '.card-header', text: 'Item visibility'
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
it 'has breadcrumbs' do
|
31
|
-
visit spotlight.search_exhibit_catalog_path(exhibit, q: 'xyz')
|
32
|
-
expect(page).to have_breadcrumbs 'Home', 'Search results'
|
33
|
-
expect(page).to have_selector '.breadcrumb-item.active', text: 'Search results'
|
34
|
-
end
|
35
|
-
|
36
|
-
describe 'Non-spotlight #show' do
|
37
|
-
it 'is able to render without exhibit context' do
|
38
|
-
visit solr_document_path('dq287tq6352')
|
39
|
-
expect(page).to have_css 'h1', text: "L'AMERIQUE"
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
describe 'viewing the page' do
|
44
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
45
|
-
|
46
|
-
it 'has <meta> tags' do
|
47
|
-
TopHat.current['twitter_card'] = nil
|
48
|
-
TopHat.current['opengraph'] = nil
|
49
|
-
|
50
|
-
visit spotlight.exhibit_solr_document_path(exhibit, 'dq287tq6352')
|
51
|
-
|
52
|
-
expect(page).to have_css "meta[name='twitter:title']", visible: false
|
53
|
-
expect(page).to have_css "meta[property='og:site_name']", visible: false
|
54
|
-
expect(page).to have_css "meta[property='og:title']", visible: false
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Confirming an email', type: :feature do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
let(:contact_email) { Spotlight::ContactEmail.create!(email: 'justin@example.com', exhibit: exhibit) }
|
6
|
-
let(:raw_token) { contact_email.instance_variable_get(:@raw_confirmation_token) }
|
7
|
-
|
8
|
-
it 'resends confirmation instructions' do
|
9
|
-
visit spotlight.new_contact_email_confirmation_url(confirmation_token: contact_email.confirmation_token)
|
10
|
-
expect(page).to have_content('Resend confirmation instructions')
|
11
|
-
within '#new_contact_email' do
|
12
|
-
fill_in 'Email', with: contact_email.email
|
13
|
-
click_button 'Resend confirmation instructions'
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
it 'confirms email' do
|
18
|
-
visit spotlight.contact_email_confirmation_url(confirmation_token: raw_token)
|
19
|
-
expect(page).to have_content('successfully confirmed')
|
20
|
-
end
|
21
|
-
end
|
@@ -1,65 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Create a new exhibit', type: :feature do
|
4
|
-
let(:user) { FactoryBot.create(:site_admin) }
|
5
|
-
|
6
|
-
before do
|
7
|
-
allow(Spotlight::DefaultThumbnailJob).to receive(:perform_later)
|
8
|
-
login_as user
|
9
|
-
end
|
10
|
-
|
11
|
-
it 'has a link in the user dropdown' do
|
12
|
-
visit '/'
|
13
|
-
within '.dropdown-menu' do
|
14
|
-
click_link 'Create new exhibit'
|
15
|
-
end
|
16
|
-
expect(page).to have_selector 'h1', text: 'Create a new exhibit'
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'allows admins to create a new exhibit' do
|
20
|
-
visit '/'
|
21
|
-
within '.dropdown-menu' do
|
22
|
-
click_link 'Create new exhibit'
|
23
|
-
end
|
24
|
-
|
25
|
-
fill_in 'Title', with: 'My exhibit title'
|
26
|
-
|
27
|
-
find('input[name="commit"]').click
|
28
|
-
|
29
|
-
expect(page).to have_content 'The exhibit was created.'
|
30
|
-
expect(Spotlight::Exhibit.last.slug).to eq 'my-exhibit-title'
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'allows admins to create a new exhibit with a slug' do
|
34
|
-
visit '/'
|
35
|
-
within '.dropdown-menu' do
|
36
|
-
click_link 'Create new exhibit'
|
37
|
-
end
|
38
|
-
|
39
|
-
fill_in 'Title', with: 'My exhibit title'
|
40
|
-
fill_in 'URL slug', with: 'custom-slug'
|
41
|
-
|
42
|
-
find('input[name="commit"]').click
|
43
|
-
|
44
|
-
expect(page).to have_content 'The exhibit was created.'
|
45
|
-
expect(Spotlight::Exhibit.last.slug).to eq 'custom-slug'
|
46
|
-
end
|
47
|
-
|
48
|
-
it 'fails validation if the slug is already used' do
|
49
|
-
visit spotlight.new_exhibit_path
|
50
|
-
|
51
|
-
fill_in 'Title', with: 'My exhibit title'
|
52
|
-
fill_in 'URL slug', with: 'custom-slug'
|
53
|
-
|
54
|
-
find('input[name="commit"]').click
|
55
|
-
|
56
|
-
visit spotlight.new_exhibit_path
|
57
|
-
|
58
|
-
fill_in 'Title', with: 'My exhibit title'
|
59
|
-
fill_in 'URL slug', with: 'custom-slug'
|
60
|
-
|
61
|
-
find('input[name="commit"]').click
|
62
|
-
|
63
|
-
expect(page).to have_content 'has already been taken'
|
64
|
-
end
|
65
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Creating a page', type: :feature do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
6
|
-
|
7
|
-
describe 'when a bunch of about pages exist' do
|
8
|
-
let!(:page1) { FactoryBot.create(:about_page, exhibit: exhibit) }
|
9
|
-
let!(:page2) { FactoryBot.create(:about_page, exhibit: exhibit) }
|
10
|
-
let!(:page3) { FactoryBot.create(:about_page, exhibit: exhibit, title: 'A new one') }
|
11
|
-
|
12
|
-
it 'is able to show a list of About pages to be curated' do
|
13
|
-
login_as exhibit_curator
|
14
|
-
visit spotlight.exhibit_dashboard_path(exhibit)
|
15
|
-
within '#sidebar' do
|
16
|
-
click_link 'About pages'
|
17
|
-
end
|
18
|
-
expect(page).to have_content 'A new one'
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Dashboard', type: :feature do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
let!(:parent_feature_page) do
|
6
|
-
FactoryBot.create(:feature_page, title: 'Parent Page', exhibit: exhibit)
|
7
|
-
end
|
8
|
-
let!(:child_feature_page) do
|
9
|
-
FactoryBot.create(
|
10
|
-
:feature_page,
|
11
|
-
title: 'Child Page',
|
12
|
-
parent_page: parent_feature_page,
|
13
|
-
exhibit: exhibit
|
14
|
-
)
|
15
|
-
end
|
16
|
-
let(:admin) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
|
17
|
-
|
18
|
-
before do
|
19
|
-
login_as(admin)
|
20
|
-
end
|
21
|
-
|
22
|
-
it 'includes a list of recently edited feature pages' do
|
23
|
-
visit spotlight.exhibit_dashboard_path(exhibit)
|
24
|
-
expect(page).to have_content 'Recent site building activity'
|
25
|
-
expect(page).to have_content 'Parent Page'
|
26
|
-
expect(page).to have_content 'Child Page'
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'includes a list of recently indexed items' do
|
30
|
-
visit spotlight.exhibit_dashboard_path(exhibit)
|
31
|
-
expect(page).to have_content 'Recently updated items'
|
32
|
-
expect(page).to have_selector('#documents')
|
33
|
-
end
|
34
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Add a contact to an exhibit', type: :feature do
|
4
|
-
let(:curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
5
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
6
|
-
let!(:about_page) { FactoryBot.create(:about_page, exhibit: exhibit) }
|
7
|
-
let!(:contact) { FactoryBot.create(:contact, name: 'Marcus Aurelius', exhibit: exhibit) }
|
8
|
-
|
9
|
-
before { login_as curator }
|
10
|
-
|
11
|
-
it 'displays a newly added contact in the sidebar' do
|
12
|
-
visit spotlight.exhibit_about_pages_path(exhibit)
|
13
|
-
|
14
|
-
within '.contacts_admin' do
|
15
|
-
click_link 'Edit'
|
16
|
-
end
|
17
|
-
|
18
|
-
click_button 'Save'
|
19
|
-
expect(page).to have_content 'The contact was successfully updated.'
|
20
|
-
end
|
21
|
-
end
|
@@ -1,79 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Search Administration', type: :feature do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
let(:exhibit_admin) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
|
6
|
-
|
7
|
-
before { login_as exhibit_admin }
|
8
|
-
|
9
|
-
describe 'edit' do
|
10
|
-
it 'displays the search configuration edit screen' do
|
11
|
-
visit spotlight.edit_exhibit_search_configuration_path(exhibit)
|
12
|
-
expect(page).to have_css('h1 small', text: 'Search')
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'has breadcrumbs' do
|
16
|
-
visit spotlight.edit_exhibit_search_configuration_path exhibit
|
17
|
-
expect(page).to have_breadcrumbs 'Home', 'Configuration', 'Search'
|
18
|
-
end
|
19
|
-
|
20
|
-
describe 'facets' do
|
21
|
-
it 'displays information about the facets' do
|
22
|
-
visit spotlight.edit_exhibit_search_configuration_path(exhibit)
|
23
|
-
within("[data-id='genre_ssim']") do
|
24
|
-
expect(page).to have_content('Genre')
|
25
|
-
expect(page).to have_content(/\d+ items/)
|
26
|
-
expect(page).to have_content(/([\d+]+) unique values/)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
it 'allows curators to select and unselect facets for display' do
|
31
|
-
visit spotlight.edit_exhibit_search_configuration_path exhibit
|
32
|
-
|
33
|
-
expect(page).to have_content "Configuration Search\nOptions Facets Results"
|
34
|
-
expect(page).to have_button 'Save'
|
35
|
-
|
36
|
-
uncheck 'blacklight_configuration_facet_fields_language_ssim_show' # Language
|
37
|
-
uncheck 'blacklight_configuration_facet_fields_genre_ssim_show' # Genre
|
38
|
-
check 'blacklight_configuration_facet_fields_subject_temporal_ssim_show' # Era
|
39
|
-
|
40
|
-
click_on 'Save changes'
|
41
|
-
|
42
|
-
expect(exhibit.reload.blacklight_config.facet_fields.select { |_k, v| v.show }.keys).to include('subject_temporal_ssim')
|
43
|
-
expect(exhibit.blacklight_config.facet_fields.select { |_k, v| v.show }.keys).not_to include('language_ssim', 'genre_ssim')
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
describe 'sort' do
|
48
|
-
it 'displays the sort fields edit area' do
|
49
|
-
visit spotlight.edit_exhibit_search_configuration_path(exhibit)
|
50
|
-
expect(page).to have_content('Sort fields')
|
51
|
-
end
|
52
|
-
|
53
|
-
it 'updates sort options' do
|
54
|
-
visit spotlight.edit_exhibit_search_configuration_path(exhibit)
|
55
|
-
|
56
|
-
expect(page).to have_css("input[name='blacklight_configuration[sort_fields][relevance][enable]'][disabled='disabled']")
|
57
|
-
expect(page).to have_css('#nested-sort-fields .dd-item:nth-child(5) h3', text: 'date (new to old)')
|
58
|
-
|
59
|
-
uncheck 'blacklight_configuration_sort_fields_title_enabled'
|
60
|
-
uncheck 'blacklight_configuration_sort_fields_identifier_enabled'
|
61
|
-
|
62
|
-
find('#blacklight_configuration_sort_fields_type_weight', visible: false).set('100')
|
63
|
-
|
64
|
-
click_button 'Save changes'
|
65
|
-
|
66
|
-
click_link 'Results'
|
67
|
-
|
68
|
-
expect(page).to have_css("input[name='blacklight_configuration[sort_fields][relevance][enable]'][disabled='disabled']")
|
69
|
-
expect(find('#blacklight_configuration_sort_fields_type_enabled')).to be_checked
|
70
|
-
expect(find('#blacklight_configuration_sort_fields_date_enabled')).to be_checked
|
71
|
-
expect(find('#blacklight_configuration_sort_fields_title_enabled')).not_to be_checked
|
72
|
-
expect(find('#blacklight_configuration_sort_fields_identifier_enabled')).not_to be_checked
|
73
|
-
|
74
|
-
# Type is now sorted last
|
75
|
-
expect(page).to have_css('#nested-sort-fields .dd-item:nth-child(5) h3', text: 'type')
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
@@ -1,112 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Add and update the site masthead', type: :feature do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
let(:user) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
|
6
|
-
|
7
|
-
before { login_as user }
|
8
|
-
|
9
|
-
it 'updates exhibit masthead options' do
|
10
|
-
visit spotlight.exhibit_dashboard_path(exhibit)
|
11
|
-
|
12
|
-
within '#sidebar' do
|
13
|
-
click_link 'Appearance'
|
14
|
-
end
|
15
|
-
|
16
|
-
click_link 'Exhibit masthead'
|
17
|
-
|
18
|
-
within '#site-masthead' do
|
19
|
-
check 'Show background image in masthead'
|
20
|
-
choose 'Upload an image'
|
21
|
-
|
22
|
-
# The JS fills in these fields:
|
23
|
-
find('#exhibit_masthead_attributes_iiif_tilesource', visible: false).set 'http://test.host/images/7'
|
24
|
-
find('#exhibit_masthead_attributes_iiif_region', visible: false).set '0,0,100,200'
|
25
|
-
# attach_file('exhibit_masthead_attributes_image', File.absolute_path(File.join(FIXTURES_PATH, 'avatar.png')))
|
26
|
-
end
|
27
|
-
|
28
|
-
click_button 'Save changes'
|
29
|
-
|
30
|
-
expect(page).to have_content('The exhibit was successfully updated.')
|
31
|
-
|
32
|
-
within '#sidebar' do
|
33
|
-
click_link 'Appearance'
|
34
|
-
end
|
35
|
-
|
36
|
-
click_link 'Exhibit masthead'
|
37
|
-
|
38
|
-
within '#site-masthead' do
|
39
|
-
expect(page).to have_checked_field 'Show background image in masthead'
|
40
|
-
expect(page).to have_checked_field 'Upload an image'
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'displays a masthead image when one is uploaded and configured' do
|
45
|
-
visit spotlight.exhibit_dashboard_path(exhibit)
|
46
|
-
expect(page).not_to have_css('.image-masthead')
|
47
|
-
within '#sidebar' do
|
48
|
-
click_link 'Appearance'
|
49
|
-
end
|
50
|
-
|
51
|
-
click_link 'Exhibit masthead'
|
52
|
-
|
53
|
-
within '#site-masthead' do
|
54
|
-
check 'Show background image in masthead'
|
55
|
-
|
56
|
-
# attach_file('exhibit_masthead_attributes_image', File.absolute_path(File.join(FIXTURES_PATH, 'avatar.png')))
|
57
|
-
# The JS fills in these fields:
|
58
|
-
find('#exhibit_masthead_attributes_iiif_tilesource', visible: false).set 'http://test.host/images/7'
|
59
|
-
find('#exhibit_masthead_attributes_iiif_region', visible: false).set '0,0,100,200'
|
60
|
-
end
|
61
|
-
|
62
|
-
click_button 'Save changes'
|
63
|
-
|
64
|
-
expect(page).to have_content('The exhibit was successfully updated.')
|
65
|
-
|
66
|
-
expect(page).to have_css('.image-masthead .background-container')
|
67
|
-
end
|
68
|
-
|
69
|
-
it 'does not display an uploaded masthead if configured to not display' do
|
70
|
-
visit spotlight.exhibit_dashboard_path(exhibit)
|
71
|
-
expect(page).not_to have_css('.image-masthead')
|
72
|
-
within '#sidebar' do
|
73
|
-
click_link 'Appearance'
|
74
|
-
end
|
75
|
-
|
76
|
-
click_link 'Exhibit masthead'
|
77
|
-
|
78
|
-
within '#site-masthead' do
|
79
|
-
attach_file('exhibit_masthead_attributes_file', File.absolute_path(File.join(FIXTURES_PATH, 'avatar.png')))
|
80
|
-
end
|
81
|
-
|
82
|
-
click_button 'Save changes'
|
83
|
-
|
84
|
-
expect(page).to have_content('The exhibit was successfully updated.')
|
85
|
-
|
86
|
-
expect(page).not_to have_css('.image-masthead .background-container')
|
87
|
-
end
|
88
|
-
|
89
|
-
it 'displays a masthead image when one is uploaded from an exhibit item', js: true do
|
90
|
-
skip "Capyabara and the cropping tool don't play well together.."
|
91
|
-
|
92
|
-
visit spotlight.exhibit_dashboard_path(exhibit)
|
93
|
-
expect(page).not_to have_css('.image-masthead')
|
94
|
-
within '#sidebar' do
|
95
|
-
click_link 'Appearance'
|
96
|
-
end
|
97
|
-
|
98
|
-
click_link 'Exhibit masthead'
|
99
|
-
|
100
|
-
within '#site-masthead' do
|
101
|
-
check 'Show background image in masthead'
|
102
|
-
|
103
|
-
fill_in_typeahead_field 'document_title', with: 'Armenia'
|
104
|
-
end
|
105
|
-
|
106
|
-
click_button 'Save changes'
|
107
|
-
|
108
|
-
expect(page).to have_content('The appearance was successfully updated.')
|
109
|
-
|
110
|
-
expect(page).to have_css('.image-masthead .background-container')
|
111
|
-
end
|
112
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Update the site theme', type: :feature do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
let(:user) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
|
6
|
-
|
7
|
-
before { login_as user }
|
8
|
-
|
9
|
-
it 'updates the exhibit theme' do
|
10
|
-
visit spotlight.edit_exhibit_appearance_path(exhibit)
|
11
|
-
|
12
|
-
expect(page).to have_content('Visual theme')
|
13
|
-
choose 'Modern'
|
14
|
-
|
15
|
-
click_button 'Save changes'
|
16
|
-
|
17
|
-
expect(page).to have_content('The exhibit was successfully updated.')
|
18
|
-
|
19
|
-
within '#sidebar' do
|
20
|
-
click_link 'Appearance'
|
21
|
-
end
|
22
|
-
|
23
|
-
click_link 'Exhibit masthead'
|
24
|
-
|
25
|
-
expect(page).to have_checked_field 'Modern'
|
26
|
-
expect(page).to have_xpath('//link[contains(@href, "/assets/application_modern")]', visible: false)
|
27
|
-
end
|
28
|
-
end
|