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
@@ -1,232 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Solr Document Block', feature: true, versioning: true, default_max_wait_time: 15 do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
6
|
-
let(:feature_page) do
|
7
|
-
FactoryBot.create(
|
8
|
-
:feature_page,
|
9
|
-
title: 'FeaturePage1',
|
10
|
-
exhibit: exhibit
|
11
|
-
)
|
12
|
-
end
|
13
|
-
|
14
|
-
before do
|
15
|
-
login_as exhibit_curator
|
16
|
-
visit spotlight.edit_exhibit_feature_page_path(exhibit, feature_page)
|
17
|
-
add_widget 'solr_documents'
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'allows you to add the solr document block widget', js: true do
|
21
|
-
expect(page).to have_content 'This widget displays exhibit items in a horizontal row.'
|
22
|
-
expect(page).to have_content 'Optionally, you can add a heading and/or text to be displayed adjacent to the items.'
|
23
|
-
expect(page).to have_content 'Primary caption'
|
24
|
-
expect(page).to have_content 'Secondary caption'
|
25
|
-
expect(page).to have_content 'Display text on'
|
26
|
-
expect(page).to have_content 'Heading'
|
27
|
-
expect(page).to have_content 'Text'
|
28
|
-
end
|
29
|
-
|
30
|
-
it 'allows you to add a solr document to the widget', js: true do
|
31
|
-
fill_in_solr_document_block_typeahead_field with: 'dq287tq6352'
|
32
|
-
within(:css, '.card') do
|
33
|
-
expect(page).to have_content "L'AMERIQUE"
|
34
|
-
end
|
35
|
-
|
36
|
-
save_page
|
37
|
-
|
38
|
-
# verify that the item + image widget is displaying an image from the document.
|
39
|
-
within(:css, '.items-block', visible: true) do
|
40
|
-
expect(page).to have_css('.img-thumbnail')
|
41
|
-
expect(page).not_to have_css('.title')
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
it 'allows you to add multiple solr documents to the widget', js: true do
|
46
|
-
fill_in_solr_document_block_typeahead_field with: 'dq287tq6352'
|
47
|
-
fill_in_solr_document_block_typeahead_field with: 'gk446cj2442'
|
48
|
-
expect(page).to have_selector '.panels li', count: 2, visible: true
|
49
|
-
|
50
|
-
save_page
|
51
|
-
|
52
|
-
expect(page).to have_selector '.items-block .box', count: 2, visible: true
|
53
|
-
end
|
54
|
-
|
55
|
-
it 'allows you to choose from a multi-image solr document (and persist through edits)', js: true, default_max_wait_time: 30 do
|
56
|
-
fill_in_solr_document_block_typeahead_field with: 'xd327cm9378'
|
57
|
-
|
58
|
-
expect(page).to have_css('[data-panel-image-pagination]', text: /Image 1 of 2/, visible: true)
|
59
|
-
|
60
|
-
# Select the last image
|
61
|
-
click_link('Change')
|
62
|
-
find('.thumbs-list li[data-index="1"]').click
|
63
|
-
expect(page).to have_css('[data-panel-image-pagination]', text: /Image 2 of 2/, visible: true)
|
64
|
-
|
65
|
-
save_page
|
66
|
-
|
67
|
-
# The thumbnail on the rendered block should be correct
|
68
|
-
thumb = find('.img-thumbnail')
|
69
|
-
expect(thumb['src']).to match(%r{xd327cm9378_05_0002/full})
|
70
|
-
|
71
|
-
# revisit the edit page
|
72
|
-
visit spotlight.edit_exhibit_feature_page_path(exhibit, feature_page)
|
73
|
-
|
74
|
-
# Expect the image on the rendered edit screen to be correct
|
75
|
-
expect(page).to have_css('[data-panel-image-pagination]', text: /Image 2 of 2/, visible: true)
|
76
|
-
thumb = find('.pic .img-thumbnail')
|
77
|
-
expect(thumb['src']).to match(%r{xd327cm9378_05_0002/full})
|
78
|
-
|
79
|
-
save_page
|
80
|
-
|
81
|
-
# Expect that the original image selection was retained
|
82
|
-
thumb = find('.img-thumbnail')
|
83
|
-
expect(thumb['src']).to match(%r{xd327cm9378_05_0002/full})
|
84
|
-
end
|
85
|
-
|
86
|
-
it 'allows you toggle visibility of solr documents', js: true do
|
87
|
-
fill_in_solr_document_block_typeahead_field with: 'dq287tq6352'
|
88
|
-
|
89
|
-
within(:css, '.card') do
|
90
|
-
uncheck 'Display?'
|
91
|
-
end
|
92
|
-
|
93
|
-
fill_in_solr_document_block_typeahead_field with: 'gk446cj2442'
|
94
|
-
|
95
|
-
# display the title as the primary caption
|
96
|
-
within('.primary-caption') do
|
97
|
-
check('Primary caption')
|
98
|
-
select('Title', from: 'primary-caption-field')
|
99
|
-
end
|
100
|
-
|
101
|
-
save_page
|
102
|
-
|
103
|
-
expect(page).to have_selector '.items-block .box', count: 1, visible: true
|
104
|
-
expect(page).to have_content '[World map]'
|
105
|
-
expect(page).not_to have_content "L'AMERIQUE"
|
106
|
-
|
107
|
-
visit spotlight.edit_exhibit_feature_page_path(exhibit, feature_page)
|
108
|
-
# display the title as the primary caption
|
109
|
-
within('.primary-caption') do
|
110
|
-
uncheck('Primary caption')
|
111
|
-
end
|
112
|
-
|
113
|
-
save_page
|
114
|
-
expect(page).to have_selector '.items-block .box', count: 1, visible: true
|
115
|
-
expect(page).not_to have_content '[World map]'
|
116
|
-
end
|
117
|
-
|
118
|
-
it 'allows you to optionally display captions with the image', js: true do
|
119
|
-
fill_in_solr_document_block_typeahead_field with: 'gk446cj2442'
|
120
|
-
|
121
|
-
# display the title as the primary caption
|
122
|
-
within('.primary-caption') do
|
123
|
-
check('Primary caption')
|
124
|
-
select('Title', from: 'primary-caption-field')
|
125
|
-
end
|
126
|
-
# display the language as the secondary caption
|
127
|
-
within('.secondary-caption') do
|
128
|
-
check('Secondary caption')
|
129
|
-
select('Language', from: 'secondary-caption-field')
|
130
|
-
end
|
131
|
-
# create the page
|
132
|
-
save_page
|
133
|
-
|
134
|
-
# verify that the item + image widget is displaying image and title from the requested document.
|
135
|
-
within(:css, '.items-block', visible: true) do
|
136
|
-
expect(page).to have_css('.img-thumbnail')
|
137
|
-
expect(page).to have_css('.primary-caption', text: '[World map]')
|
138
|
-
expect(page).to have_css('.secondary-caption', text: 'Latin')
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
|
-
it 'allows you to optionally display a ZPR link with the image', js: true do
|
143
|
-
skip('Passes locally, but soooo flakey on Travis.') if ENV['CI']
|
144
|
-
|
145
|
-
fill_in_solr_document_block_typeahead_field with: 'gk446cj2442'
|
146
|
-
|
147
|
-
check 'Offer "View larger" option'
|
148
|
-
# this seems silly, but also seems to help with the flappy-ness of this spec
|
149
|
-
expect(find_field('Offer "View larger" option', checked: true)).to be_checked
|
150
|
-
|
151
|
-
save_page
|
152
|
-
|
153
|
-
within '.contents' do
|
154
|
-
click_button 'View [World map] larger'
|
155
|
-
end
|
156
|
-
|
157
|
-
within '.modal-content' do
|
158
|
-
expect(page).to have_css('#osd-modal-container')
|
159
|
-
end
|
160
|
-
end
|
161
|
-
|
162
|
-
it 'allows you to add text to the image', js: true do
|
163
|
-
# fill in the content-editable div
|
164
|
-
content_editable = find('.st-text-block')
|
165
|
-
content_editable.set('zzz')
|
166
|
-
# create the page
|
167
|
-
save_page
|
168
|
-
|
169
|
-
# visit the show page for the document we just saved
|
170
|
-
# verify that the item + image widget is displaying image and title from the requested document.
|
171
|
-
within(:css, '.items-block', visible: true) do
|
172
|
-
expect(page).to have_content 'zzz'
|
173
|
-
end
|
174
|
-
end
|
175
|
-
|
176
|
-
it 'allows you to choose which side the text will be on', js: true do
|
177
|
-
skip('Passes locally, but soooo flakey on Travis.') if ENV['CI']
|
178
|
-
fill_in_solr_document_block_typeahead_field with: 'dq287tq6352'
|
179
|
-
|
180
|
-
# Select to align the text right
|
181
|
-
choose 'Left'
|
182
|
-
# this seems silly, but also seems to help with the flappy-ness of this spec
|
183
|
-
expect(find_field('Left', checked: true)).to be_checked
|
184
|
-
|
185
|
-
# fill in the content editable div
|
186
|
-
content_editable = find('.st-text-block')
|
187
|
-
content_editable.set('zzz')
|
188
|
-
|
189
|
-
# create the page
|
190
|
-
save_page
|
191
|
-
|
192
|
-
# verify that the item + image widget is displaying image and title from the requested document.
|
193
|
-
within(:css, '.items-block') do
|
194
|
-
within('.text-col') do
|
195
|
-
expect(page).to have_content 'zzz'
|
196
|
-
end
|
197
|
-
expect(page).to have_css('.items-col.float-right')
|
198
|
-
end
|
199
|
-
end
|
200
|
-
|
201
|
-
it 'round-trip data', js: true do
|
202
|
-
fill_in_solr_document_block_typeahead_field with: 'dq287tq6352'
|
203
|
-
|
204
|
-
within(:css, '.card') do
|
205
|
-
uncheck 'Display?'
|
206
|
-
end
|
207
|
-
|
208
|
-
fill_in_solr_document_block_typeahead_field with: 'gk446cj2442'
|
209
|
-
|
210
|
-
# display the title as the primary caption
|
211
|
-
within('.primary-caption') do
|
212
|
-
check('Primary caption')
|
213
|
-
select('Title', from: 'primary-caption-field')
|
214
|
-
end
|
215
|
-
|
216
|
-
# fill in the content editable div
|
217
|
-
content_editable = find('.st-text-block')
|
218
|
-
content_editable.set('zzz')
|
219
|
-
# Select to align the text right
|
220
|
-
choose 'Right'
|
221
|
-
|
222
|
-
save_page
|
223
|
-
|
224
|
-
click_on 'Edit'
|
225
|
-
|
226
|
-
expect(page).to have_selector '.card', count: 2, visible: true
|
227
|
-
|
228
|
-
# for some reason, the text area above isn't getting filled in
|
229
|
-
# expect(page).to have_selector ".st-text-block", text: "zzz"
|
230
|
-
expect(find_field('primary-caption-field').value).to eq Spotlight::PageConfigurations::DOCUMENT_TITLE_KEY
|
231
|
-
end
|
232
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Solr Documents Carousel Block', type: :feature, js: true do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
6
|
-
|
7
|
-
let!(:feature_page) { FactoryBot.create(:feature_page, exhibit: exhibit) }
|
8
|
-
|
9
|
-
before do
|
10
|
-
login_as exhibit_curator
|
11
|
-
|
12
|
-
visit spotlight.edit_exhibit_feature_page_path(exhibit, feature_page)
|
13
|
-
add_widget 'solr_documents_carousel'
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'allows a curator to select a caption to display' do
|
17
|
-
fill_in_typeahead_field with: 'dq287tq6352'
|
18
|
-
|
19
|
-
check 'Primary caption'
|
20
|
-
select 'Title', from: 'primary-caption-field'
|
21
|
-
|
22
|
-
save_page
|
23
|
-
|
24
|
-
within '.carousel-block' do
|
25
|
-
expect(page).to have_css('.carousel-item', count: 1)
|
26
|
-
expect(page).to have_css('.carousel-caption .primary', text: "L'AMERIQUE")
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,94 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Uploaded Items Block', feature: true, js: true, versioning: true do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
6
|
-
let(:fixture_file1) { File.join(FIXTURES_PATH, '800x600.png') }
|
7
|
-
let(:fixture_file2) { File.join(FIXTURES_PATH, 'avatar.png') }
|
8
|
-
|
9
|
-
before do
|
10
|
-
login_as exhibit_curator
|
11
|
-
visit spotlight.edit_exhibit_home_page_path(exhibit)
|
12
|
-
add_widget 'uploaded_items'
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'users can upload images with text' do
|
16
|
-
heading = 'Some Uploaded Images'
|
17
|
-
text = 'Take a look at these images I just uploaded!'
|
18
|
-
fill_in 'Heading', with: heading
|
19
|
-
content_editable = find('.st-text-block')
|
20
|
-
content_editable.set(text)
|
21
|
-
|
22
|
-
expect(page).not_to have_css('.dd-list li')
|
23
|
-
attach_file('uploaded_item_url', fixture_file1)
|
24
|
-
|
25
|
-
expect(page).to have_css('.dd-list li', count: 1)
|
26
|
-
within('.dd-list') do
|
27
|
-
expect(page).to have_css('.card-title', text: '800x600.png')
|
28
|
-
fill_in 'Caption', with: 'Some caption text'
|
29
|
-
fill_in 'Link URL', with: 'https://example.com/'
|
30
|
-
end
|
31
|
-
|
32
|
-
attach_file('uploaded_item_url', fixture_file2)
|
33
|
-
|
34
|
-
expect(page).to have_css('.dd-list li', count: 2)
|
35
|
-
within('.dd-list') do
|
36
|
-
expect(page).to have_css('.card-title', text: 'avatar.png')
|
37
|
-
end
|
38
|
-
|
39
|
-
save_page
|
40
|
-
|
41
|
-
expect(page).to have_css('h3', text: heading)
|
42
|
-
expect(page).to have_css('p', text: text)
|
43
|
-
|
44
|
-
within('.uploaded-items-block') do
|
45
|
-
expect(page).to have_css('img[alt=""]', count: 1)
|
46
|
-
expect(page).to have_css('img[alt="Some caption text"]', count: 1)
|
47
|
-
expect(page).to have_css '.caption', text: 'Some caption text'
|
48
|
-
expect(page).to have_link 'Some caption text', href: 'https://example.com/'
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
it 'users can toggle individual images to not display' do
|
53
|
-
attach_file('uploaded_item_url', fixture_file1)
|
54
|
-
attach_file('uploaded_item_url', fixture_file2)
|
55
|
-
|
56
|
-
# This line blocks until the javascript has added the file to the page:
|
57
|
-
expect(find('input[name="item[file_0][display]"]')).to be_present
|
58
|
-
|
59
|
-
# Uncheck the first checkbox
|
60
|
-
all('input[type="checkbox"]').first.click
|
61
|
-
|
62
|
-
save_page
|
63
|
-
|
64
|
-
within('.uploaded-items-block') do
|
65
|
-
expect(page).to have_css('img[alt=""]', count: 1)
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
it 'may have ZPR links' do
|
70
|
-
attach_file('uploaded_item_url', fixture_file1)
|
71
|
-
attach_file('uploaded_item_url', fixture_file2)
|
72
|
-
|
73
|
-
check 'Offer "View larger" option'
|
74
|
-
# this seems silly, but also seems to help with the flappy-ness of this spec
|
75
|
-
expect(find_field('Offer "View larger" option', checked: true)).to be_checked
|
76
|
-
|
77
|
-
save_page
|
78
|
-
|
79
|
-
within('.uploaded-items-block') do
|
80
|
-
expect(page).to have_button('View larger', count: 2)
|
81
|
-
end
|
82
|
-
|
83
|
-
within first('.contents') do
|
84
|
-
data = find('button')['data-iiif-tilesource']
|
85
|
-
expect(data).to be_present
|
86
|
-
expect(JSON.parse(data).with_indifferent_access).to include type: 'image', url: end_with('800x600.png')
|
87
|
-
click_button 'View larger'
|
88
|
-
end
|
89
|
-
|
90
|
-
within '.modal-content' do
|
91
|
-
expect(page).to have_css('#osd-modal-container')
|
92
|
-
end
|
93
|
-
end
|
94
|
-
end
|
@@ -1,45 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Browse Group Adminstration', js: true do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
6
|
-
let!(:group1) do
|
7
|
-
FactoryBot.create(
|
8
|
-
:group,
|
9
|
-
title: 'Good group 1',
|
10
|
-
exhibit: exhibit
|
11
|
-
)
|
12
|
-
end
|
13
|
-
|
14
|
-
before { login_as exhibit_curator }
|
15
|
-
|
16
|
-
it 'is able to create new groups' do
|
17
|
-
visit spotlight.exhibit_searches_path(exhibit, anchor: 'browse-groups')
|
18
|
-
|
19
|
-
add_new_via_button('My New Group')
|
20
|
-
|
21
|
-
expect(page).to have_content 'The browse group was created.'
|
22
|
-
expect(page).to have_css('li.dd-item')
|
23
|
-
expect(page).to have_css('h4', text: 'My New Group')
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'updates the page titles' do
|
27
|
-
visit spotlight.exhibit_searches_path(exhibit, anchor: 'browse-groups')
|
28
|
-
|
29
|
-
within("[data-id='#{group1.id}']") do
|
30
|
-
within('h4') do
|
31
|
-
expect(page).to have_content('Good group 1')
|
32
|
-
expect(page).to have_css('.title-field', visible: false)
|
33
|
-
click_link('Good group 1')
|
34
|
-
expect(page).to have_css('.title-field', visible: true)
|
35
|
-
find('.title-field').set('New good group 1')
|
36
|
-
end
|
37
|
-
end
|
38
|
-
click_button('Save changes')
|
39
|
-
within("[data-id='#{group1.id}']") do
|
40
|
-
within('h4') do
|
41
|
-
expect(page).to have_content('New good group 1')
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
@@ -1,93 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Edit in place', type: :feature, js: true do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
let(:admin) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
|
6
|
-
|
7
|
-
before { login_as admin }
|
8
|
-
|
9
|
-
describe 'Feature Pages' do
|
10
|
-
it 'updates the label' do
|
11
|
-
visit spotlight.exhibit_dashboard_path(exhibit)
|
12
|
-
|
13
|
-
click_link 'Feature pages'
|
14
|
-
|
15
|
-
add_new_via_button('My New Feature Page')
|
16
|
-
|
17
|
-
expect(page).to have_css('h3', text: 'My New Feature Page')
|
18
|
-
|
19
|
-
within('.feature_pages_admin') do
|
20
|
-
expect(page).to have_css('#exhibit_feature_pages_attributes_0_title[type="hidden"]', visible: false)
|
21
|
-
expect(page).not_to have_css('#exhibit_feature_pages_attributes_0_title[type="text"]')
|
22
|
-
click_link('My New Feature Page')
|
23
|
-
expect(page).not_to have_css('#exhibit_feature_pages_attributes_0_title[type="hidden"]')
|
24
|
-
expect(page).to have_css('#exhibit_feature_pages_attributes_0_title[type="text"]')
|
25
|
-
fill_in 'exhibit_feature_pages_attributes_0_title', with: 'My Newer Feature Page'
|
26
|
-
end
|
27
|
-
click_button 'Save changes'
|
28
|
-
|
29
|
-
expect(page).to have_content('Feature pages were successfully updated.')
|
30
|
-
expect(page).to have_css('h3', text: 'My Newer Feature Page')
|
31
|
-
expect(page).not_to have_css('h3', text: 'My New Feature Page')
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'rejects blank values' do
|
35
|
-
skip('Throws Selenium::WebDriver::Error::ElementNotInteractableError')
|
36
|
-
skip('Passes locally, but soooo flakey on Travis.') if ENV['CI']
|
37
|
-
visit spotlight.exhibit_dashboard_path(exhibit)
|
38
|
-
|
39
|
-
click_link 'Feature pages'
|
40
|
-
|
41
|
-
add_new_via_button('My New Feature Page')
|
42
|
-
|
43
|
-
expect(page).to have_css('h3', text: 'My New Feature Page')
|
44
|
-
|
45
|
-
within('.feature_pages_admin') do
|
46
|
-
expect(page).to have_css('#exhibit_feature_pages_attributes_0_title[type="hidden"]', visible: false)
|
47
|
-
expect(page).not_to have_css('#exhibit_feature_pages_attributes_0_title[type="text"]')
|
48
|
-
click_link('My New Feature Page')
|
49
|
-
expect(page).not_to have_css('#exhibit_feature_pages_attributes_0_title[type="hidden"]')
|
50
|
-
expect(page).to have_css('#exhibit_feature_pages_attributes_0_title[type="text"]')
|
51
|
-
fill_in 'exhibit_feature_pages_attributes_0_title', with: ''
|
52
|
-
# blur out of the now-emptytitle field
|
53
|
-
field = page.find_field('exhibit_feature_pages_attributes_0_title')
|
54
|
-
field.native.send_keys :tab
|
55
|
-
|
56
|
-
expect(page).to have_css('#exhibit_feature_pages_attributes_0_title[type="hidden"]', visible: false)
|
57
|
-
expect(page).not_to have_css('#exhibit_feature_pages_attributes_0_title[type="text"]')
|
58
|
-
expect(page).to have_css('h3', text: 'My New Feature Page')
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
describe 'Main navigation' do
|
64
|
-
it 'updates the label' do
|
65
|
-
visit spotlight.exhibit_dashboard_path(exhibit)
|
66
|
-
|
67
|
-
within '#sidebar' do
|
68
|
-
click_link 'Appearance'
|
69
|
-
end
|
70
|
-
|
71
|
-
click_link 'Main menu'
|
72
|
-
|
73
|
-
within('#nested-navigation') do
|
74
|
-
expect(page).to have_css("#exhibit_main_navigations_attributes_0_label[type='hidden']", visible: false)
|
75
|
-
expect(page).not_to have_css("#exhibit_main_navigations_attributes_0_label[type='text']")
|
76
|
-
click_link('Curated features')
|
77
|
-
expect(page).not_to have_css("#exhibit_main_navigations_attributes_0_label[type='hidden']")
|
78
|
-
expect(page).to have_css("#exhibit_main_navigations_attributes_0_label[type='text']")
|
79
|
-
fill_in 'exhibit_main_navigations_attributes_0_label', with: 'My Page Label'
|
80
|
-
end
|
81
|
-
|
82
|
-
click_button 'Save changes'
|
83
|
-
|
84
|
-
expect(page).to have_content('The exhibit was successfully updated.')
|
85
|
-
|
86
|
-
click_link 'Main menu'
|
87
|
-
|
88
|
-
within('#nested-navigation') do
|
89
|
-
expect(page).to have_css('h3', text: 'My Page Label')
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|
@@ -1,140 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Feature Pages Adminstration', js: true do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
6
|
-
let!(:page1) do
|
7
|
-
FactoryBot.create(
|
8
|
-
:feature_page,
|
9
|
-
title: 'FeaturePage1',
|
10
|
-
exhibit: exhibit
|
11
|
-
)
|
12
|
-
end
|
13
|
-
let!(:page2) do
|
14
|
-
FactoryBot.create(
|
15
|
-
:feature_page,
|
16
|
-
title: 'FeaturePage2',
|
17
|
-
exhibit: exhibit,
|
18
|
-
display_sidebar: true
|
19
|
-
)
|
20
|
-
end
|
21
|
-
|
22
|
-
before { login_as exhibit_curator }
|
23
|
-
|
24
|
-
it 'is able to create new pages' do
|
25
|
-
visit spotlight.exhibit_dashboard_path(exhibit)
|
26
|
-
|
27
|
-
click_link 'Feature pages'
|
28
|
-
|
29
|
-
add_new_via_button('My New Page')
|
30
|
-
|
31
|
-
expect(page).to have_content 'The feature page was created.'
|
32
|
-
expect(page).to have_css('li.dd-item')
|
33
|
-
expect(page).to have_css('h3', text: 'My New Page')
|
34
|
-
end
|
35
|
-
|
36
|
-
it 'updates the page titles' do
|
37
|
-
visit spotlight.exhibit_dashboard_path(exhibit)
|
38
|
-
|
39
|
-
click_link 'Feature pages'
|
40
|
-
within("[data-id='#{page1.id}']") do
|
41
|
-
within('h3') do
|
42
|
-
expect(page).to have_content('FeaturePage1')
|
43
|
-
expect(page).to have_css('.title-field', visible: false)
|
44
|
-
click_link('FeaturePage1')
|
45
|
-
expect(page).to have_css('.title-field', visible: true)
|
46
|
-
find('.title-field').set('NewFeaturePage1')
|
47
|
-
end
|
48
|
-
end
|
49
|
-
click_button('Save changes')
|
50
|
-
within("[data-id='#{page1.id}']") do
|
51
|
-
within('h3') do
|
52
|
-
expect(page).to have_content('NewFeaturePage1')
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
it 'stays in curation mode if a user has unsaved data' do
|
58
|
-
visit spotlight.edit_exhibit_feature_page_path(page1.exhibit, page1)
|
59
|
-
|
60
|
-
fill_in('Title', with: 'Some Fancy Title')
|
61
|
-
page.dismiss_confirm do
|
62
|
-
click_link 'Cancel'
|
63
|
-
end
|
64
|
-
expect(page).not_to have_selector 'a', text: 'Edit'
|
65
|
-
end
|
66
|
-
|
67
|
-
it 'stays in curation mode if a user has unsaved contenteditable data' do
|
68
|
-
visit spotlight.edit_exhibit_feature_page_path(page1.exhibit, page1)
|
69
|
-
|
70
|
-
add_widget 'solr_documents'
|
71
|
-
content_editable = find('.st-text-block')
|
72
|
-
content_editable.set('Some Fancy Text.')
|
73
|
-
|
74
|
-
page.accept_confirm do
|
75
|
-
click_link 'Cancel'
|
76
|
-
end
|
77
|
-
expect(page).not_to have_selector 'a', text: 'Edit'
|
78
|
-
end
|
79
|
-
|
80
|
-
it 'does not update the pages list when the user has unsaved changes' do
|
81
|
-
visit spotlight.exhibit_dashboard_path(exhibit)
|
82
|
-
|
83
|
-
click_link 'Feature pages'
|
84
|
-
|
85
|
-
within("[data-id='#{page1.id}']") do
|
86
|
-
within('h3') do
|
87
|
-
expect(page).to have_content('FeaturePage1')
|
88
|
-
expect(page).to have_css('.title-field', visible: false)
|
89
|
-
click_link('FeaturePage1')
|
90
|
-
expect(page).to have_css('.title-field', visible: true)
|
91
|
-
find('.title-field').set('NewFancyTitle')
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
within '#exhibit-navbar' do
|
96
|
-
page.accept_alert do
|
97
|
-
click_link 'Home'
|
98
|
-
end
|
99
|
-
end
|
100
|
-
expect(page).not_to have_content('Feature pages were successfully updated.')
|
101
|
-
# NOTE: get flash message about unsaved changes
|
102
|
-
expect(page).to have_content('Welcome to your new exhibit')
|
103
|
-
|
104
|
-
# ensure page title not changed
|
105
|
-
click_link exhibit_curator.email
|
106
|
-
within '#user-util-collapse .dropdown' do
|
107
|
-
click_link 'Exhibit dashboard'
|
108
|
-
end
|
109
|
-
click_link 'Feature pages'
|
110
|
-
within("[data-id='#{page1.id}']") do
|
111
|
-
within('h3') do
|
112
|
-
expect(page).to have_content('FeaturePage1') # old title
|
113
|
-
end
|
114
|
-
end
|
115
|
-
end
|
116
|
-
|
117
|
-
it 'is able to update home page titles' do
|
118
|
-
visit spotlight.exhibit_dashboard_path(exhibit)
|
119
|
-
|
120
|
-
click_link 'Feature pages'
|
121
|
-
|
122
|
-
within('.home_page') do
|
123
|
-
within('h3.card-title') do
|
124
|
-
expect(page).to have_content(exhibit.home_page.title)
|
125
|
-
expect(page).to have_css('.title-field', visible: false)
|
126
|
-
click_link(exhibit.home_page.title)
|
127
|
-
expect(page).to have_css('.title-field', visible: true)
|
128
|
-
find('.title-field').set('New Home Page Title')
|
129
|
-
end
|
130
|
-
end
|
131
|
-
|
132
|
-
click_button('Save changes')
|
133
|
-
|
134
|
-
within('.home_page') do
|
135
|
-
within('h3.card-title') do
|
136
|
-
expect(page).to have_content('New Home Page Title')
|
137
|
-
end
|
138
|
-
end
|
139
|
-
end
|
140
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Editing the Home Page', js: true, versioning: true do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
let(:admin) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
|
6
|
-
|
7
|
-
before { login_as admin }
|
8
|
-
|
9
|
-
it 'does not have a search results widget' do
|
10
|
-
visit spotlight.edit_exhibit_home_page_path(exhibit)
|
11
|
-
click_add_widget
|
12
|
-
expect(page).to have_css("[data-type='solr_documents']", visible: true)
|
13
|
-
expect(page).not_to have_css("[data-type='search_results']", visible: true)
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'correctly saves a list widget' do
|
17
|
-
visit spotlight.edit_exhibit_home_page_path(exhibit)
|
18
|
-
click_add_widget
|
19
|
-
expect(page).to have_css('button.st-block-controls__button')
|
20
|
-
|
21
|
-
find("button[data-type='list']").click
|
22
|
-
expect(page).to have_css('ul.st-list-block__list')
|
23
|
-
expect(page).to have_css('li.st-list-block__item')
|
24
|
-
expect(page).to have_css('*[contenteditable=true]')
|
25
|
-
expect(page).to have_css('div.st-list-block__editor[contenteditable=true]', count: 1)
|
26
|
-
|
27
|
-
first_element = page.all('div.st-list-block__editor[contenteditable=true]').first
|
28
|
-
first_element.set('one')
|
29
|
-
|
30
|
-
click_button 'Save changes'
|
31
|
-
expect(page).to have_css('div.st__content-block--list ul li', count: 1)
|
32
|
-
expect(page).to have_css('div.st__content-block--list ul li', text: 'on')
|
33
|
-
end
|
34
|
-
end
|