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,66 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
RSpec.describe 'Locale Selector', js: true do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit, published: true) }
|
5
|
-
let!(:language_es) { FactoryBot.create(:language, exhibit: exhibit, locale: 'es', public: true) }
|
6
|
-
let!(:language_zh) { FactoryBot.create(:language, exhibit: exhibit, locale: 'zh') }
|
7
|
-
|
8
|
-
before { login_as user }
|
9
|
-
|
10
|
-
before(:all) do
|
11
|
-
# mimics setting config.i18n.fallbacks = [I18n.default_locale] in the rails environment
|
12
|
-
I18n.fallbacks[:es] = [:es, I18n.default_locale]
|
13
|
-
end
|
14
|
-
|
15
|
-
context 'with an anonymous user' do
|
16
|
-
let(:user) { FactoryBot.create(:exhibit_visitor) }
|
17
|
-
|
18
|
-
it 'only sees public languages' do
|
19
|
-
visit spotlight.exhibit_path(exhibit)
|
20
|
-
|
21
|
-
expect(page).to have_css('li.dropdown', text: 'English')
|
22
|
-
click_link 'English'
|
23
|
-
|
24
|
-
within('.dropdown-menu', visible: true) do
|
25
|
-
expect(page).to have_css('li', count: 1)
|
26
|
-
expect(page).to have_css('li', text: 'Español')
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
context 'with an exhibit curator' do
|
32
|
-
let(:user) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
33
|
-
|
34
|
-
it 'can see any saved languages' do
|
35
|
-
visit spotlight.exhibit_path(exhibit)
|
36
|
-
|
37
|
-
expect(page).to have_css('li.dropdown', text: 'English')
|
38
|
-
click_link 'English'
|
39
|
-
|
40
|
-
within('.dropdown-menu', visible: true) do
|
41
|
-
expect(page).to have_css('li', count: 2)
|
42
|
-
expect(page).to have_css('li', text: '中文')
|
43
|
-
expect(page).to have_css('li', text: 'Español')
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
describe 'switching locales' do
|
49
|
-
let(:user) { FactoryBot.create(:exhibit_visitor) }
|
50
|
-
|
51
|
-
it 'works' do
|
52
|
-
visit spotlight.exhibit_path(exhibit)
|
53
|
-
|
54
|
-
expect(page).to have_css('input[placeholder="Search..."]')
|
55
|
-
|
56
|
-
click_link 'English'
|
57
|
-
|
58
|
-
within('.dropdown-menu', visible: true) do
|
59
|
-
click_link 'Español'
|
60
|
-
end
|
61
|
-
|
62
|
-
expect(page).not_to have_css('input[placeholder="Search..."]')
|
63
|
-
expect(page).to have_css('input[placeholder="Buscar..."]')
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Metadata Administration', 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 'Select/Deselect all button' do
|
10
|
-
it 'deselects all checkboxes when all are selected' do
|
11
|
-
visit spotlight.edit_exhibit_metadata_configuration_path exhibit
|
12
|
-
# No checkboxes should be unchecked
|
13
|
-
expect(page).not_to have_css("tr td:nth-child(2) input[type='checkbox']:not(:checked)")
|
14
|
-
within('tr th:nth-child(2)') do
|
15
|
-
click_button 'Deselect all'
|
16
|
-
expect(page).to have_css('button', text: 'Select all', visible: true)
|
17
|
-
end
|
18
|
-
# No checkboxes should be checked
|
19
|
-
expect(page).not_to have_css("tr td:nth-child(2) input[type='checkbox']:checked")
|
20
|
-
end
|
21
|
-
|
22
|
-
it 'selects all checkboxes when any are unselected' do
|
23
|
-
visit spotlight.edit_exhibit_metadata_configuration_path exhibit
|
24
|
-
# No checkboxes should be unchecked
|
25
|
-
expect(page).not_to have_css("tr td:nth-child(2) input[type='checkbox']:not(:checked)")
|
26
|
-
first_button_area = find('tr th:nth-child(2)')
|
27
|
-
within first_button_area do
|
28
|
-
expect(page).to have_css('button', text: 'Deselect all')
|
29
|
-
end
|
30
|
-
# Uncheck first checkbox
|
31
|
-
find("tr:first-child td:nth-child(2) input[type='checkbox']").set(false)
|
32
|
-
# A checkbox should be checked
|
33
|
-
expect(page).to have_css("tr td:nth-child(2) input[type='checkbox']:checked")
|
34
|
-
within first_button_area do
|
35
|
-
click_button 'Select all'
|
36
|
-
end
|
37
|
-
# No checkboxes should be unchecked
|
38
|
-
expect(page).not_to have_css("tr td:nth-child(2) input[type='checkbox']:not(:checked)")
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Multi image selector', type: :feature, js: true, versioning: true, default_max_wait_time: 5 do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
6
|
-
let(:feature_page) { FactoryBot.create(:feature_page, exhibit: exhibit) }
|
7
|
-
|
8
|
-
before { login_as exhibit_curator }
|
9
|
-
|
10
|
-
it 'allows the user to select which image in a multi image object to display' do
|
11
|
-
visit spotlight.edit_exhibit_feature_page_path(exhibit, feature_page)
|
12
|
-
|
13
|
-
add_widget 'solr_documents' # the "Item Row" widget
|
14
|
-
|
15
|
-
fill_in_typeahead_field with: 'xd327cm9378'
|
16
|
-
|
17
|
-
expect(page).to have_selector '.card'
|
18
|
-
|
19
|
-
within('.card') do
|
20
|
-
expect(page).to have_content(/Image \d of \d/)
|
21
|
-
expect(page).to have_link 'Change'
|
22
|
-
end
|
23
|
-
|
24
|
-
save_page
|
25
|
-
|
26
|
-
visit spotlight.exhibit_feature_page_path(exhibit, feature_page)
|
27
|
-
expect(page).to have_css("[data-id='xd327cm9378']")
|
28
|
-
expect(page).to have_css("img[src='https://stacks.stanford.edu/image/iiif/xd327cm9378%2Fxd327cm9378_05_0001/full/!400,400/0/default.jpg']")
|
29
|
-
expect(page).not_to have_css("img[src='https://stacks.stanford.edu/image/iiif/xd327cm9378%2Fxd327cm9378_05_0002/full/!400,400/0/default.jpg']")
|
30
|
-
|
31
|
-
click_link('Edit')
|
32
|
-
|
33
|
-
within('.card') do
|
34
|
-
expect(page).to have_content(/Image \d of \d/)
|
35
|
-
find('a', text: 'Change').click
|
36
|
-
end
|
37
|
-
|
38
|
-
expect(page).to have_css('.thumbs-list ul', visible: true)
|
39
|
-
|
40
|
-
within('.thumbs-list ul') do
|
41
|
-
all('li')[1].click
|
42
|
-
end
|
43
|
-
|
44
|
-
save_page
|
45
|
-
|
46
|
-
expect(page).to have_css("[data-id='xd327cm9378']")
|
47
|
-
expect(page).not_to have_css("img[src='https://stacks.stanford.edu/image/iiif/xd327cm9378%2Fxd327cm9378_05_0001/full/!400,400/0/default.jpg']")
|
48
|
-
expect(page).to have_css("img[src='https://stacks.stanford.edu/image/iiif/xd327cm9378%2Fxd327cm9378_05_0002/full/!400,400/0/default.jpg']")
|
49
|
-
end
|
50
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Reindex Monitor', js: true, default_max_wait_time: 10 do
|
4
|
-
let(:resources) do
|
5
|
-
[FactoryBot.create(:resource)]
|
6
|
-
end
|
7
|
-
let(:exhibit) { FactoryBot.create(:exhibit, resources: resources) }
|
8
|
-
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
9
|
-
|
10
|
-
before do
|
11
|
-
exhibit.job_trackers.create(resource: exhibit, status: 'completed', job_class: 'Spotlight::ReindexExhibitJob')
|
12
|
-
login_as exhibit_curator
|
13
|
-
visit spotlight.admin_exhibit_catalog_path(exhibit)
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'is rendered on the item admin page' do
|
17
|
-
expect(page).to have_css('.card.index-status', visible: true)
|
18
|
-
within('.card.index-status') do
|
19
|
-
expect(page).to have_css('p', text: /Began reindexing a total of \d+ items/)
|
20
|
-
expect(page).to have_css('p', text: /Reindexed \d+ of \d+ items/)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Roles Admin', type: :feature, js: true do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
let(:exhibit_admin) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
|
6
|
-
|
7
|
-
before do
|
8
|
-
login_as exhibit_admin
|
9
|
-
|
10
|
-
visit spotlight.exhibit_dashboard_path(exhibit)
|
11
|
-
click_link 'Users'
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'has the appropriate status message when an existing user is added' do
|
15
|
-
second_user = FactoryBot.create(:site_admin)
|
16
|
-
|
17
|
-
click_link 'Add a new user'
|
18
|
-
fill_in 'User key', with: second_user.email
|
19
|
-
|
20
|
-
click_button 'Save changes'
|
21
|
-
|
22
|
-
expect(page).to have_css('.alert-info', text: 'User has been updated.')
|
23
|
-
expect(page).to have_css('.table.users td', text: second_user.email)
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'persists invited users to the exhibits user list' do
|
27
|
-
expect(page).not_to have_css('.badge-warning pending-label', text: 'pending', visible: true)
|
28
|
-
|
29
|
-
click_link 'Add a new user'
|
30
|
-
fill_in 'User key', with: 'user@example.com'
|
31
|
-
click_button 'Save changes'
|
32
|
-
|
33
|
-
within('tr.invite-pending') do
|
34
|
-
expect(page).to have_css('td', text: 'user@example.com')
|
35
|
-
expect(page).to have_css('.badge-warning.pending-label', text: 'pending', visible: true)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1,140 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Search Configuration Administration', js: true do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
let(:user) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
|
6
|
-
|
7
|
-
before { login_as user }
|
8
|
-
|
9
|
-
describe 'search fields', default_max_wait_time: 5 do
|
10
|
-
it 'allows the curator to disable all search fields' do
|
11
|
-
visit spotlight.exhibit_home_page_path(exhibit, exhibit.home_page)
|
12
|
-
expect(page).to have_css 'select#search_field'
|
13
|
-
|
14
|
-
visit spotlight.edit_exhibit_search_configuration_path(exhibit)
|
15
|
-
expect(page).to have_css 'input#enable_feature', visible: true
|
16
|
-
uncheck 'Display search box'
|
17
|
-
|
18
|
-
click_button 'Save changes'
|
19
|
-
|
20
|
-
expect(page).to have_css('.alert', text: 'The exhibit was successfully updated.', visible: true)
|
21
|
-
|
22
|
-
expect(page).not_to have_css 'select#search_field'
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'allows the curator to update search field options' do
|
26
|
-
visit spotlight.edit_exhibit_search_configuration_path(exhibit)
|
27
|
-
|
28
|
-
click_link 'Options'
|
29
|
-
|
30
|
-
within('#nested-search-fields') do
|
31
|
-
expect(page).to have_css("#blacklight_configuration_search_fields_title_label[type='hidden']", visible: false)
|
32
|
-
expect(page).not_to have_css("#blacklight_configuration_search_fields_title_label[type='text']")
|
33
|
-
click_link('Title')
|
34
|
-
expect(page).not_to have_css("#blacklight_configuration_search_fields_title_label[type='hidden']")
|
35
|
-
expect(page).to have_css("#blacklight_configuration_search_fields_title_label[type='text']")
|
36
|
-
fill_in 'blacklight_configuration_search_fields_title_label', with: 'My Title Label'
|
37
|
-
end
|
38
|
-
|
39
|
-
click_button 'Save changes'
|
40
|
-
|
41
|
-
expect(page).to have_css('.alert', text: 'The exhibit was successfully updated.', visible: true)
|
42
|
-
expect(page).to have_select 'Search in', with_options: ['My Title Label']
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
describe 'facets' do
|
47
|
-
it 'allows us to update the label with edit-in-place' do
|
48
|
-
input_id = 'blacklight_configuration_facet_fields_genre_ssim_label'
|
49
|
-
visit spotlight.edit_exhibit_search_configuration_path(exhibit)
|
50
|
-
|
51
|
-
click_link 'Facets'
|
52
|
-
|
53
|
-
facet = find('.edit-in-place', text: 'Genre')
|
54
|
-
expect(page).not_to have_content('Topic')
|
55
|
-
expect(page).to have_css("input##{input_id}", visible: false)
|
56
|
-
|
57
|
-
facet.click
|
58
|
-
|
59
|
-
expect(page).to have_css("input##{input_id}", visible: true)
|
60
|
-
|
61
|
-
fill_in(input_id, with: 'Topic')
|
62
|
-
|
63
|
-
click_button 'Save changes'
|
64
|
-
click_link 'Facets'
|
65
|
-
|
66
|
-
expect(page).to have_css('.alert', text: 'The exhibit was successfully updated.', visible: true)
|
67
|
-
|
68
|
-
expect(page).not_to have_content('Genre')
|
69
|
-
expect(page).to have_content('Topic')
|
70
|
-
end
|
71
|
-
|
72
|
-
it 'allows the curator to select a different facet sort order' do
|
73
|
-
visit spotlight.edit_exhibit_search_configuration_path(exhibit)
|
74
|
-
click_link 'Facets'
|
75
|
-
|
76
|
-
within '.facet-config-genre_ssim' do
|
77
|
-
click_button 'Options'
|
78
|
-
expect(find(:css, '#blacklight_configuration_facet_fields_genre_ssim_sort_count')).to be_checked
|
79
|
-
|
80
|
-
choose 'Value'
|
81
|
-
end
|
82
|
-
|
83
|
-
click_button 'Save changes'
|
84
|
-
|
85
|
-
expect(page).to have_css('.alert', text: 'The exhibit was successfully updated.', visible: true)
|
86
|
-
|
87
|
-
exhibit.reload
|
88
|
-
expect(exhibit.blacklight_config.facet_fields['genre_ssim'].sort).to eq 'index'
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
describe 'results' do
|
93
|
-
it 'updates search result options' do
|
94
|
-
visit spotlight.edit_exhibit_search_configuration_path(exhibit)
|
95
|
-
|
96
|
-
click_link 'Results'
|
97
|
-
|
98
|
-
uncheck 'List'
|
99
|
-
|
100
|
-
choose '20'
|
101
|
-
|
102
|
-
click_button 'Save changes'
|
103
|
-
|
104
|
-
expect(page).to have_css('.alert', text: 'The exhibit was successfully updated.', visible: true)
|
105
|
-
|
106
|
-
click_link 'Results'
|
107
|
-
|
108
|
-
expect(page).to have_unchecked_field 'List'
|
109
|
-
expect(page).to have_checked_field 'Gallery'
|
110
|
-
|
111
|
-
expect(page).to have_checked_field '20'
|
112
|
-
expect(page).to have_unchecked_field '10'
|
113
|
-
end
|
114
|
-
|
115
|
-
it 'updates Sort field result options' do
|
116
|
-
visit spotlight.edit_exhibit_search_configuration_path(exhibit)
|
117
|
-
|
118
|
-
click_link 'Results'
|
119
|
-
|
120
|
-
within('#nested-sort-fields') do
|
121
|
-
expect(page).to have_css("#blacklight_configuration_sort_fields_title_label[type='hidden']", visible: false)
|
122
|
-
expect(page).not_to have_css("#blacklight_configuration_sort_fields_title_label[type='text']")
|
123
|
-
click_link('title')
|
124
|
-
expect(page).not_to have_css("#blacklight_configuration_sort_fields_title_label[type='hidden']")
|
125
|
-
expect(page).to have_css("#blacklight_configuration_sort_fields_title_label[type='text']")
|
126
|
-
fill_in 'blacklight_configuration_sort_fields_title_label', with: 'My Title Label'
|
127
|
-
end
|
128
|
-
|
129
|
-
click_button 'Save changes'
|
130
|
-
|
131
|
-
expect(page).to have_css('.alert', text: 'The exhibit was successfully updated.', visible: true)
|
132
|
-
|
133
|
-
click_link 'Results'
|
134
|
-
|
135
|
-
within('#nested-sort-fields') do
|
136
|
-
expect(page).to have_css('h3', text: 'My Title Label')
|
137
|
-
end
|
138
|
-
end # Sort field
|
139
|
-
end # results tab
|
140
|
-
end
|
@@ -1,88 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Search contexts' 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 { login_as exhibit_curator }
|
15
|
-
|
16
|
-
it 'adds context breadcrumbs back to the home page when navigating to an item from the home page', js: true do
|
17
|
-
exhibit.home_page.content = [
|
18
|
-
{
|
19
|
-
type: 'solr_documents',
|
20
|
-
data: {
|
21
|
-
item: {
|
22
|
-
dq287tq6352: {
|
23
|
-
id: 'dq287tq6352',
|
24
|
-
display: 'true'
|
25
|
-
}
|
26
|
-
}
|
27
|
-
}
|
28
|
-
}
|
29
|
-
].to_json
|
30
|
-
exhibit.home_page.save
|
31
|
-
|
32
|
-
visit spotlight.exhibit_home_page_path(exhibit, exhibit.home_page)
|
33
|
-
|
34
|
-
# verify that the item + image widget is displaying an image from the document.
|
35
|
-
within(:css, '.items-block') do
|
36
|
-
expect(page).to have_css('.img-thumbnail')
|
37
|
-
expect(page).not_to have_css('.title')
|
38
|
-
end
|
39
|
-
|
40
|
-
find('.items-block a').click
|
41
|
-
|
42
|
-
expect(page).to have_selector '.breadcrumb a', text: 'Home'
|
43
|
-
end
|
44
|
-
|
45
|
-
it 'adds context breadcrumb back to the feature page when navigating to an item from a feature page', js: true do
|
46
|
-
feature_page.content = [
|
47
|
-
{
|
48
|
-
type: 'solr_documents',
|
49
|
-
data: {
|
50
|
-
item: {
|
51
|
-
dq287tq6352: {
|
52
|
-
id: 'dq287tq6352',
|
53
|
-
display: 'true'
|
54
|
-
}
|
55
|
-
}
|
56
|
-
}
|
57
|
-
}
|
58
|
-
].to_json
|
59
|
-
feature_page.save
|
60
|
-
|
61
|
-
visit spotlight.exhibit_feature_page_path(exhibit, feature_page)
|
62
|
-
|
63
|
-
# verify that the item + image widget is displaying an image from the document.
|
64
|
-
within(:css, '.items-block') do
|
65
|
-
expect(page).to have_css('.img-thumbnail')
|
66
|
-
expect(page).not_to have_css('.title')
|
67
|
-
end
|
68
|
-
|
69
|
-
find('.items-block a').click
|
70
|
-
|
71
|
-
expect(page).to have_selector '.breadcrumb a', text: 'Home'
|
72
|
-
expect(page).to have_link 'FeaturePage1', href: spotlight.exhibit_feature_page_path(exhibit, feature_page)
|
73
|
-
end
|
74
|
-
|
75
|
-
context 'from a browse page' do
|
76
|
-
let!(:search) { FactoryBot.create(:search, title: 'Some Saved Search', exhibit: exhibit, published: true) }
|
77
|
-
|
78
|
-
it 'adds context breadcrumbs back to the browse page when navigating to an item', js: true do
|
79
|
-
visit spotlight.exhibit_home_page_path(exhibit, exhibit.home_page)
|
80
|
-
click_link 'Browse'
|
81
|
-
click_link 'Some Saved Search'
|
82
|
-
click_link 'A MAP of AMERICA from the latest and best Observations'
|
83
|
-
expect(page).to have_link 'Home'
|
84
|
-
expect(page).to have_link 'Browse'
|
85
|
-
expect(page).to have_link 'Some Saved Search', href: spotlight.exhibit_browse_path(exhibit, search)
|
86
|
-
end
|
87
|
-
end
|
88
|
-
end
|
@@ -1,96 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Main navigation labels are settable', type: :feature do
|
4
|
-
let!(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
let!(:about) { FactoryBot.create(:about_page, exhibit: exhibit, published: true) }
|
6
|
-
|
7
|
-
before do
|
8
|
-
about_nav = exhibit.main_navigations.about
|
9
|
-
about_nav.label = 'New About Label'
|
10
|
-
about_nav.save
|
11
|
-
browse_nav = exhibit.main_navigations.browse
|
12
|
-
browse_nav.label = 'New Browse Label'
|
13
|
-
browse_nav.save
|
14
|
-
search = exhibit.searches.first
|
15
|
-
search.published = true
|
16
|
-
search.save
|
17
|
-
exhibit.reload
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'has the configured about and browse navigation labels' do
|
21
|
-
visit spotlight.exhibit_path(exhibit)
|
22
|
-
expect(page).to have_css('.navbar-nav li', text: 'New About Label')
|
23
|
-
expect(page).to have_css('.navbar-nav li', text: 'New Browse Label')
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'has the configured about page label in the sidebar' do
|
27
|
-
visit spotlight.exhibit_about_page_path(exhibit, about)
|
28
|
-
expect(page).to have_css('#sidebar h2', text: 'New About Label')
|
29
|
-
end
|
30
|
-
|
31
|
-
it 'has the configured about page label visible in the breadcrumb' do
|
32
|
-
visit spotlight.exhibit_about_page_path(exhibit, about)
|
33
|
-
expect(page).to have_css('.breadcrumb li', text: 'New About Label')
|
34
|
-
end
|
35
|
-
|
36
|
-
it 'has the configured browse page label visible in the breadcrumb of the browse index page' do
|
37
|
-
visit spotlight.exhibit_browse_index_path(exhibit, exhibit.searches.first)
|
38
|
-
expect(page).to have_content('New Browse Label')
|
39
|
-
expect(page).to have_css('.breadcrumb li', text: 'New Browse Label')
|
40
|
-
end
|
41
|
-
|
42
|
-
it 'has the configured browse page label visible in the breadcrumb of the browse show page' do
|
43
|
-
visit spotlight.exhibit_browse_path(exhibit, exhibit.searches.first)
|
44
|
-
expect(page).to have_content('New Browse Label')
|
45
|
-
expect(page).to have_css('.breadcrumb li', text: 'New Browse Label')
|
46
|
-
end
|
47
|
-
|
48
|
-
it 'does not display any main navigation menu items that are configured to not display' do
|
49
|
-
about_nav = exhibit.main_navigations.about
|
50
|
-
about_nav.display = false
|
51
|
-
about_nav.save
|
52
|
-
visit spotlight.exhibit_path(exhibit)
|
53
|
-
expect(page).not_to have_css('.navbar-nav li', text: 'New About Label')
|
54
|
-
about_nav = exhibit.main_navigations.about
|
55
|
-
about_nav.display = true
|
56
|
-
about_nav.save
|
57
|
-
end
|
58
|
-
|
59
|
-
describe 'Restore default button functionality', js: true do
|
60
|
-
let(:user) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
|
61
|
-
|
62
|
-
before { login_as user }
|
63
|
-
|
64
|
-
it 'is present when the navigation label is not the default value' do
|
65
|
-
visit spotlight.edit_exhibit_appearance_path(exhibit)
|
66
|
-
|
67
|
-
click_link 'Main menu'
|
68
|
-
|
69
|
-
within '.main_navigation_admin' do
|
70
|
-
within all('li').first do
|
71
|
-
expect(page).not_to have_css('button.restore-default', visible: true)
|
72
|
-
end
|
73
|
-
|
74
|
-
within all('li').last do
|
75
|
-
expect(page).to have_css('button.restore-default', visible: true)
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
context 'when the navigation label is not the default value' do
|
81
|
-
it 'restores the default value' do
|
82
|
-
visit spotlight.edit_exhibit_appearance_path(exhibit)
|
83
|
-
|
84
|
-
click_link 'Main menu'
|
85
|
-
|
86
|
-
within '.main_navigation_admin' do
|
87
|
-
within all('li').last do
|
88
|
-
expect(page).to have_css('a', text: 'New About Label')
|
89
|
-
click_button 'Restore default'
|
90
|
-
expect(page).to have_css('a', text: 'About')
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Metadata Administration', 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
|
-
describe 'edit' do
|
10
|
-
it 'displays the metadata edit page' do
|
11
|
-
visit spotlight.edit_exhibit_metadata_configuration_path(exhibit)
|
12
|
-
expect(page).to have_css('h1 small', text: 'Metadata')
|
13
|
-
within("[data-id='language_ssm']") do
|
14
|
-
expect(page).to have_css('td', text: 'Language')
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,62 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Report a Problem', type: :feature do
|
4
|
-
let!(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
let(:honeypot_field_name) { Spotlight::Engine.config.spambot_honeypot_email_field }
|
6
|
-
|
7
|
-
it 'does not have a header link' do
|
8
|
-
visit root_path
|
9
|
-
expect(page).not_to have_content 'Feedback'
|
10
|
-
end
|
11
|
-
|
12
|
-
describe 'when emails are setup' do
|
13
|
-
before do
|
14
|
-
exhibit.contact_emails_attributes = [{ 'email' => 'test@example.com' }, { 'email' => 'test2@example.com' }]
|
15
|
-
exhibit.save!
|
16
|
-
exhibit.contact_emails.first.tap do |e|
|
17
|
-
if e.respond_to? :confirm
|
18
|
-
e.confirm
|
19
|
-
else
|
20
|
-
e.confirm!
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'allows the link to be opened w/o javascript (or in a new tab/window)' do
|
26
|
-
visit spotlight.exhibit_solr_document_path(exhibit, id: 'dq287tq6352')
|
27
|
-
|
28
|
-
click_on 'Feedback'
|
29
|
-
|
30
|
-
expect(page).to have_css('h2', text: 'Contact us', visible: true)
|
31
|
-
expect(page).to have_css('#contact_form_name', count: 1)
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'accepts a problem report', js: true do
|
35
|
-
visit spotlight.exhibit_solr_document_path(exhibit, id: 'dq287tq6352')
|
36
|
-
click_on 'Feedback'
|
37
|
-
expect(page).to have_css('.alert-primary', text: '/dq287tq6352')
|
38
|
-
expect(find('#contact_form_current_url', visible: false).value).to end_with spotlight.exhibit_solr_document_path(exhibit, id: 'dq287tq6352')
|
39
|
-
fill_in 'Your name', with: 'Some Body'
|
40
|
-
fill_in 'Your email', with: 'test@example.com'
|
41
|
-
fill_in 'Message', with: 'This is my problem report'
|
42
|
-
|
43
|
-
expect do
|
44
|
-
click_on 'Send'
|
45
|
-
end.to change { ActionMailer::Base.deliveries.count }.by(1)
|
46
|
-
end
|
47
|
-
|
48
|
-
it 'rejects a spammy looking problem report', js: true do
|
49
|
-
visit spotlight.exhibit_solr_document_path(exhibit, id: 'dq287tq6352')
|
50
|
-
click_on 'Feedback'
|
51
|
-
expect(find('#contact_form_current_url', visible: false).value).to end_with spotlight.exhibit_solr_document_path(exhibit, id: 'dq287tq6352')
|
52
|
-
fill_in 'Your name', with: 'Some Body'
|
53
|
-
fill_in 'Your email', with: 'test@example.com'
|
54
|
-
page.evaluate_script("$('#contact_form_#{honeypot_field_name}').val('possible_spam@spam.com')")
|
55
|
-
fill_in 'Message', with: 'This is my problem report'
|
56
|
-
|
57
|
-
expect do
|
58
|
-
click_on 'Send'
|
59
|
-
end.not_to change { ActionMailer::Base.deliveries.count }
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|