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,463 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Translation editing', type: :feature do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit, title: 'Sample', subtitle: 'SubSample') }
|
5
|
-
let(:admin) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
|
6
|
-
|
7
|
-
before(:all) do
|
8
|
-
# mimics setting config.i18n.fallbacks = [I18n.default_locale] in the rails environment
|
9
|
-
I18n.fallbacks[:fr] = [:fr, I18n.default_locale]
|
10
|
-
end
|
11
|
-
|
12
|
-
before do
|
13
|
-
FactoryBot.create(:language, exhibit: exhibit, locale: 'sq')
|
14
|
-
FactoryBot.create(:language, exhibit: exhibit, locale: 'fr')
|
15
|
-
login_as admin
|
16
|
-
end
|
17
|
-
|
18
|
-
describe 'general' do
|
19
|
-
before do
|
20
|
-
visit spotlight.edit_exhibit_translations_path(exhibit, language: 'fr')
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'selects the correct language' do
|
24
|
-
expect(page).to have_css '.nav-pills .nav-link.active', text: 'French'
|
25
|
-
end
|
26
|
-
|
27
|
-
describe 'basic settings' do
|
28
|
-
it 'successfully adds translations' do
|
29
|
-
within '.translation-edit-form #general' do
|
30
|
-
expect(page).to have_css '.form-text', text: 'Sample'
|
31
|
-
expect(page).to have_css '.form-text', text: 'SubSample'
|
32
|
-
fill_in 'Title', id: 'exhibit_translations_attributes_0_value', with: 'Titre français'
|
33
|
-
fill_in 'Subtitle', with: 'Sous-titre français'
|
34
|
-
click_button 'Save changes'
|
35
|
-
end
|
36
|
-
expect(page).to have_css '.flash_messages', text: 'The exhibit was successfully updated.'
|
37
|
-
within '.translation-basic-settings-title' do
|
38
|
-
expect(page).to have_css 'input[value="Titre français"]'
|
39
|
-
expect(page).to have_css '.translation-complete'
|
40
|
-
end
|
41
|
-
within '.translation-basic-settings-subtitle' do
|
42
|
-
expect(page).to have_css 'input[value="Sous-titre français"]'
|
43
|
-
expect(page).to have_css '.translation-complete'
|
44
|
-
end
|
45
|
-
within '.translation-basic-settings-description' do
|
46
|
-
expect(page).not_to have_css '.translation-complete'
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
describe 'main menu' do
|
52
|
-
before do
|
53
|
-
exhibit.searches.first.update(published: true)
|
54
|
-
within '.translation-edit-form #general' do
|
55
|
-
fill_in 'Home', with: 'Maison'
|
56
|
-
fill_in 'Browse', with: 'parcourir ceci!'
|
57
|
-
click_button 'Save changes'
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
it 'adds translations to exhibit navbar' do
|
62
|
-
within '.translation-edit-form #general' do
|
63
|
-
expect(page).to have_css '.form-text', text: 'Home'
|
64
|
-
fill_in 'Home', with: 'Maison'
|
65
|
-
fill_in 'Browse', with: 'parcourir ceci!'
|
66
|
-
click_button 'Save changes'
|
67
|
-
end
|
68
|
-
expect(page).to have_css '.flash_messages', text: 'The exhibit was successfully updated.'
|
69
|
-
within '.translation-main-menu-home' do
|
70
|
-
expect(page).to have_css 'input[value="Maison"]'
|
71
|
-
expect(page).to have_css '.translation-complete'
|
72
|
-
end
|
73
|
-
within '.translation-main-menu-browse' do
|
74
|
-
expect(page).to have_css 'input[value="parcourir ceci!"]'
|
75
|
-
expect(page).to have_css '.translation-complete'
|
76
|
-
end
|
77
|
-
within '.translation-main-menu-curated_features' do
|
78
|
-
expect(page).not_to have_css '.translation-complete'
|
79
|
-
end
|
80
|
-
within '.translation-main-menu-about' do
|
81
|
-
expect(page).not_to have_css '.translation-complete'
|
82
|
-
end
|
83
|
-
I18n.locale = :fr
|
84
|
-
expect(exhibit.main_navigations.browse.label).to eq 'parcourir ceci!'
|
85
|
-
expect(I18n.t(:'spotlight.curation.nav.home')).to eq 'Maison'
|
86
|
-
I18n.locale = I18n.default_locale
|
87
|
-
end
|
88
|
-
|
89
|
-
it 'adds translations to user-facing breadcrumbs' do
|
90
|
-
expect(page).to have_css '.flash_messages', text: 'The exhibit was successfully updated.'
|
91
|
-
visit spotlight.exhibit_browse_index_path(exhibit, locale: 'fr')
|
92
|
-
expect(page).to have_breadcrumbs 'Maison', 'parcourir ceci!'
|
93
|
-
end
|
94
|
-
|
95
|
-
it 'does not translate admin breadcrumbs' do
|
96
|
-
expect(page).to have_css '.flash_messages', text: 'The exhibit was successfully updated.'
|
97
|
-
visit spotlight.exhibit_searches_path(exhibit, locale: 'fr')
|
98
|
-
expect(page).to have_breadcrumbs 'Home', 'Curation', 'Browse'
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
describe 'breadcrumbs' do
|
103
|
-
describe 'browse categories' do
|
104
|
-
before do
|
105
|
-
exhibit.searches.first.update(published: true)
|
106
|
-
within '.translation-edit-form #general' do
|
107
|
-
fill_in 'Home', with: 'Maison'
|
108
|
-
fill_in 'Browse', with: 'parcourir ceci!'
|
109
|
-
click_button 'Save changes'
|
110
|
-
end
|
111
|
-
end
|
112
|
-
|
113
|
-
it 'adds translations to user-facing breadcrumbs' do
|
114
|
-
visit spotlight.exhibit_browse_index_path(exhibit, locale: 'fr')
|
115
|
-
expect(page).to have_breadcrumbs 'Maison', 'parcourir ceci!'
|
116
|
-
end
|
117
|
-
|
118
|
-
it 'does not translate admin breadcrumbs' do
|
119
|
-
visit spotlight.exhibit_searches_path(exhibit, locale: 'fr')
|
120
|
-
expect(page).to have_breadcrumbs 'Home', 'Curation', 'Browse'
|
121
|
-
end
|
122
|
-
end
|
123
|
-
|
124
|
-
describe 'pages' do
|
125
|
-
let!(:about_page1) { FactoryBot.create(:about_page, title: 'First Page', exhibit: exhibit, locale: 'fr') }
|
126
|
-
let(:about_page2) { FactoryBot.create(:about_page, title: 'Second Page', exhibit: exhibit, locale: 'fr') }
|
127
|
-
|
128
|
-
before do
|
129
|
-
within '.translation-edit-form #general' do
|
130
|
-
fill_in 'Home', with: 'Maison'
|
131
|
-
fill_in 'About', with: 'Sur'
|
132
|
-
click_button 'Save changes'
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
it 'adds breadcrumbs to pages' do
|
137
|
-
visit spotlight.exhibit_about_page_path(about_page2.exhibit, about_page2, locale: 'fr')
|
138
|
-
expect(page).to have_breadcrumbs 'Maison', 'Sur', about_page2.title
|
139
|
-
end
|
140
|
-
|
141
|
-
it 'does not translate admin breadcrumbs' do
|
142
|
-
visit spotlight.exhibit_about_pages_path(exhibit, locale: 'fr')
|
143
|
-
expect(page).to have_breadcrumbs 'Home', 'Curation', 'About'
|
144
|
-
end
|
145
|
-
end
|
146
|
-
|
147
|
-
describe 'Catalog' do
|
148
|
-
before do
|
149
|
-
within '.translation-edit-form #general' do
|
150
|
-
fill_in 'Home', with: 'Maison'
|
151
|
-
fill_in 'Search results', with: 'Résultats de la recherche'
|
152
|
-
click_button 'Save changes'
|
153
|
-
end
|
154
|
-
end
|
155
|
-
|
156
|
-
it 'adds breadcrumbs user facing catalog' do
|
157
|
-
visit spotlight.search_exhibit_catalog_path(exhibit, q: '*', locale: 'fr')
|
158
|
-
expect(page).to have_breadcrumbs 'Maison', 'Résultats de la recherche'
|
159
|
-
end
|
160
|
-
|
161
|
-
it 'does not translate admin catalog' do
|
162
|
-
visit spotlight.admin_exhibit_catalog_path(exhibit, locale: 'fr')
|
163
|
-
expect(page).to have_breadcrumbs 'Home', 'Curation', 'Items'
|
164
|
-
end
|
165
|
-
end
|
166
|
-
end
|
167
|
-
end
|
168
|
-
|
169
|
-
describe 'Metadata field labels' do
|
170
|
-
before { visit spotlight.edit_exhibit_translations_path(exhibit, language: 'fr') }
|
171
|
-
|
172
|
-
it 'redirects to the same form tab' do
|
173
|
-
click_link 'Metadata field labels'
|
174
|
-
within('#metadata', visible: true) do
|
175
|
-
fill_in 'Everything', with: 'Tout'
|
176
|
-
click_button 'Save changes'
|
177
|
-
end
|
178
|
-
|
179
|
-
expect(page).to have_css '.nav-pills .nav-link.active', text: 'French'
|
180
|
-
expect(page).to have_css '.nav-tabs .nav-link.active', text: 'Metadata field labels'
|
181
|
-
end
|
182
|
-
|
183
|
-
describe 'configured fields' do
|
184
|
-
it 'has a text input for each metadata field' do
|
185
|
-
within '#metadata' do
|
186
|
-
expect(page).to have_css('input[type="text"]', count: 17)
|
187
|
-
end
|
188
|
-
end
|
189
|
-
|
190
|
-
it 'allows users to translate both index and show metadata field labels', js: true do
|
191
|
-
click_link 'Metadata field labels'
|
192
|
-
|
193
|
-
within('#metadata', visible: true) do
|
194
|
-
language_label = find('label', text: 'Language', visible: true)
|
195
|
-
language_input = find("##{language_label['for']}", visible: true)
|
196
|
-
language_input.set('Langue')
|
197
|
-
click_button 'Save changes'
|
198
|
-
end
|
199
|
-
|
200
|
-
visit spotlight.search_exhibit_catalog_path(exhibit, f: { language_ssim: ['Latin'] }, locale: 'fr')
|
201
|
-
|
202
|
-
expect(page).to have_css('dt.blacklight-language_ssm', text: 'Langue')
|
203
|
-
|
204
|
-
click_link 'Orbis terrarum tabula recens emendata et in lucem edita'
|
205
|
-
|
206
|
-
expect(page).to have_css('dt.blacklight-language_ssm', text: 'Langue')
|
207
|
-
end
|
208
|
-
end
|
209
|
-
|
210
|
-
describe 'Exhibit-specific fields' do
|
211
|
-
let!(:custom_field) { FactoryBot.create(:custom_field, exhibit: exhibit) }
|
212
|
-
|
213
|
-
before do
|
214
|
-
visit spotlight.edit_exhibit_translations_path(exhibit, language: 'fr')
|
215
|
-
end
|
216
|
-
|
217
|
-
it 'has text inputs for the exhibit-specific fields' do
|
218
|
-
within '#metadata' do
|
219
|
-
expect(page).to have_css('input[type="text"]', count: 18)
|
220
|
-
|
221
|
-
within '.translation-exhibit-specific-fields' do
|
222
|
-
expect(page).to have_css('input[type="text"]', count: 1)
|
223
|
-
end
|
224
|
-
end
|
225
|
-
end
|
226
|
-
|
227
|
-
it 'allows users to translate exhibit-specific metadata fields' do
|
228
|
-
within '#metadata' do
|
229
|
-
fill_in custom_field.configuration['label'], with: 'French Custom Field Label'
|
230
|
-
click_button 'Save changes'
|
231
|
-
end
|
232
|
-
|
233
|
-
# Adding some data to our custom field
|
234
|
-
visit spotlight.exhibit_solr_document_path(exhibit, 'dq287tq6352', locale: :fr)
|
235
|
-
expect(page).to have_link 'Edit'
|
236
|
-
click_on 'Edit'
|
237
|
-
fill_in custom_field.configuration['label'], with: 'Custom Field Data'
|
238
|
-
click_on 'Save changes'
|
239
|
-
|
240
|
-
expect(page).to have_css('dt', text: 'French Custom Field Label')
|
241
|
-
expect(page).to have_css('dd', text: 'Custom Field Data')
|
242
|
-
end
|
243
|
-
end
|
244
|
-
end
|
245
|
-
|
246
|
-
describe 'Search field labels' do
|
247
|
-
before { visit spotlight.edit_exhibit_translations_path(exhibit, language: 'fr') }
|
248
|
-
|
249
|
-
it 'redirects to the same form tab' do
|
250
|
-
click_link 'Search field labels'
|
251
|
-
within('#search_fields', visible: true) do
|
252
|
-
fill_in 'Everything', with: 'Tout'
|
253
|
-
click_button 'Save changes'
|
254
|
-
end
|
255
|
-
|
256
|
-
expect(page).to have_css '.nav-pills .nav-link.active', text: 'French'
|
257
|
-
expect(page).to have_css '.nav-tabs .nav-link.active', text: 'Search field labels'
|
258
|
-
end
|
259
|
-
|
260
|
-
describe 'field-based search fields' do
|
261
|
-
it 'has a text input for each enabled search field' do
|
262
|
-
within '#search_fields .translation-field-based-search-fields' do
|
263
|
-
expect(page).to have_css('input[type="text"]', count: 3)
|
264
|
-
end
|
265
|
-
end
|
266
|
-
|
267
|
-
it 'allows users to translate field-based search fields', js: true do
|
268
|
-
click_link 'Search field labels'
|
269
|
-
|
270
|
-
within('#search_fields', visible: true) do
|
271
|
-
fill_in 'Everything', with: 'Tout'
|
272
|
-
click_button 'Save changes'
|
273
|
-
end
|
274
|
-
|
275
|
-
visit spotlight.exhibit_path(exhibit, locale: 'fr')
|
276
|
-
|
277
|
-
expect(page).to have_css('select#search_field option', text: 'Tout')
|
278
|
-
end
|
279
|
-
end
|
280
|
-
|
281
|
-
describe 'facet fields' do
|
282
|
-
it 'has a text input for each facet field' do
|
283
|
-
within '#search_fields .translation-facet-fields' do
|
284
|
-
expect(page).to have_css('input[type="text"]', count: 7)
|
285
|
-
end
|
286
|
-
end
|
287
|
-
|
288
|
-
it 'allows users to translate facet fields', js: true do
|
289
|
-
click_link 'Search field labels'
|
290
|
-
|
291
|
-
within('#search_fields', visible: true) do
|
292
|
-
fill_in 'Geographic', with: 'Géographique'
|
293
|
-
click_button 'Save changes'
|
294
|
-
end
|
295
|
-
|
296
|
-
visit spotlight.search_exhibit_catalog_path(exhibit, q: '*', locale: 'fr')
|
297
|
-
|
298
|
-
expect(page).to have_css('h3.facet-field-heading', text: 'Géographique')
|
299
|
-
end
|
300
|
-
end
|
301
|
-
|
302
|
-
describe 'sort fields' do
|
303
|
-
it 'has a text input for each sort field' do
|
304
|
-
within '#search_fields .translation-sort-fields' do
|
305
|
-
expect(page).to have_css('input[type="text"]', count: 6)
|
306
|
-
end
|
307
|
-
end
|
308
|
-
|
309
|
-
it 'allows users to translation sort fields', js: true do
|
310
|
-
click_link 'Search field labels'
|
311
|
-
|
312
|
-
within('#search_fields', visible: true) do
|
313
|
-
fill_in 'relevance', with: 'French Relevance'
|
314
|
-
click_button 'Save changes'
|
315
|
-
end
|
316
|
-
|
317
|
-
visit spotlight.search_exhibit_catalog_path(exhibit, q: '*', locale: 'fr')
|
318
|
-
|
319
|
-
expect(page).to have_css('#sort-dropdown', text: 'Trier par French Relevance', visible: true)
|
320
|
-
end
|
321
|
-
end
|
322
|
-
end
|
323
|
-
|
324
|
-
describe 'Browse categories' do
|
325
|
-
before do
|
326
|
-
FactoryBot.create(:search, exhibit: exhibit, title: 'Browse Category 1')
|
327
|
-
|
328
|
-
visit spotlight.edit_exhibit_translations_path(exhibit, language: 'fr')
|
329
|
-
end
|
330
|
-
|
331
|
-
it 'has a title and description for every browse category' do
|
332
|
-
within '#browse' do
|
333
|
-
expect(page).to have_css('input[type="text"]', count: 4)
|
334
|
-
expect(page).to have_css('textarea', count: 2)
|
335
|
-
|
336
|
-
expect(page).to have_field 'All exhibit items'
|
337
|
-
expect(page).to have_field 'Browse Category 1'
|
338
|
-
expect(page).to have_css('.form-text', text: 'All items in this exhibit.')
|
339
|
-
end
|
340
|
-
end
|
341
|
-
|
342
|
-
it 'redirects to the same form tab' do
|
343
|
-
click_link 'Browse categories'
|
344
|
-
within('#browse', visible: true) do
|
345
|
-
fill_in 'All exhibit items', with: "Tous les objets d'exposition"
|
346
|
-
click_button 'Save changes'
|
347
|
-
end
|
348
|
-
|
349
|
-
expect(page).to have_css '.nav-pills .nav-link.active', text: 'French'
|
350
|
-
expect(page).to have_css '.nav-tabs .nav-link.active', text: 'Browse categories'
|
351
|
-
end
|
352
|
-
|
353
|
-
it 'persists changes', js: true do
|
354
|
-
click_link 'Browse categories'
|
355
|
-
|
356
|
-
within('#browse', visible: true) do
|
357
|
-
fill_in 'All exhibit items', with: "Tous les objets d'exposition"
|
358
|
-
|
359
|
-
first('.translation-description-toggle').click
|
360
|
-
|
361
|
-
textarea = page.find('textarea')
|
362
|
-
textarea.set('Tous les articles de cette exposition.')
|
363
|
-
|
364
|
-
click_button 'Save changes'
|
365
|
-
end
|
366
|
-
|
367
|
-
expect(page).to have_css('.flash_messages', text: 'The exhibit was successfully updated.')
|
368
|
-
|
369
|
-
expect(exhibit.searches.first.title).to eq 'All exhibit items'
|
370
|
-
expect(exhibit.searches.first.long_description).to eq 'All items in this exhibit.'
|
371
|
-
|
372
|
-
I18n.locale = :fr
|
373
|
-
Translation.current_exhibit = exhibit
|
374
|
-
expect(exhibit.searches.first.title).to eq "Tous les objets d'exposition"
|
375
|
-
expect(exhibit.searches.first.long_description).to eq 'Tous les articles de cette exposition.'
|
376
|
-
I18n.locale = I18n.default_locale
|
377
|
-
Translation.current_exhibit = nil
|
378
|
-
end
|
379
|
-
end
|
380
|
-
|
381
|
-
describe 'Browse groups' do
|
382
|
-
before do
|
383
|
-
FactoryBot.create(:group, exhibit: exhibit, title: 'Browse Group 1')
|
384
|
-
FactoryBot.create(:group, exhibit: exhibit, title: 'Browse Group 2')
|
385
|
-
|
386
|
-
visit spotlight.edit_exhibit_translations_path(exhibit, language: 'fr')
|
387
|
-
end
|
388
|
-
|
389
|
-
it 'has a title browse group' do
|
390
|
-
within '#groups' do
|
391
|
-
expect(page).to have_css('input[type="text"]', count: 2)
|
392
|
-
|
393
|
-
expect(page).to have_field 'Browse Group 1'
|
394
|
-
expect(page).to have_field 'Browse Group 2'
|
395
|
-
end
|
396
|
-
end
|
397
|
-
|
398
|
-
it 'redirects to the same form tab' do
|
399
|
-
click_link 'Browse categories'
|
400
|
-
within('#groups', visible: true) do
|
401
|
-
fill_in 'Browse Group 1', with: 'parcourir le groupe 1'
|
402
|
-
click_button 'Save changes'
|
403
|
-
end
|
404
|
-
|
405
|
-
expect(page).to have_css '.nav-pills .nav-link.active', text: 'French'
|
406
|
-
expect(page).to have_css '.nav-tabs .nav-link.active', text: 'Browse groups'
|
407
|
-
end
|
408
|
-
|
409
|
-
it 'persists changes', js: true do
|
410
|
-
click_link 'Browse groups'
|
411
|
-
|
412
|
-
within('#groups', visible: true) do
|
413
|
-
fill_in 'Browse Group 1', with: 'parcourir le groupe 1'
|
414
|
-
|
415
|
-
click_button 'Save changes'
|
416
|
-
end
|
417
|
-
|
418
|
-
expect(page).to have_css('.flash_messages', text: 'The exhibit was successfully updated.')
|
419
|
-
|
420
|
-
expect(exhibit.groups.first.title).to eq 'Browse Group 1'
|
421
|
-
|
422
|
-
I18n.locale = :fr
|
423
|
-
Translation.current_exhibit = exhibit
|
424
|
-
expect(exhibit.groups.first.title).to eq 'parcourir le groupe 1'
|
425
|
-
I18n.locale = I18n.default_locale
|
426
|
-
Translation.current_exhibit = nil
|
427
|
-
end
|
428
|
-
end
|
429
|
-
|
430
|
-
describe 'home page translation table entry' do
|
431
|
-
let(:feature_page) { FactoryBot.create(:feature_page, exhibit: exhibit) }
|
432
|
-
let(:about_page) { FactoryBot.create(:about_page, exhibit: exhibit) }
|
433
|
-
|
434
|
-
before do
|
435
|
-
exhibit.home_page.clone_for_locale('fr').save
|
436
|
-
about_page.clone_for_locale('fr').tap { |p| p.published = true }.save
|
437
|
-
visit spotlight.edit_exhibit_translations_path(exhibit, language: 'fr', tab: 'pages')
|
438
|
-
end
|
439
|
-
|
440
|
-
it 'renders a disabled checkbox in the table' do
|
441
|
-
# home page should have a disabled checkbox
|
442
|
-
expect(page).to have_css('.translation-home-page-settings input[type="checkbox"][disabled]')
|
443
|
-
# feature page does not have a translation, so don't use checkbox
|
444
|
-
expect(page).not_to have_css('.translation-feature-page-settings input[type="checkbox"]')
|
445
|
-
# about page should have a checked checkbox
|
446
|
-
expect(page).to have_css('.translation-about-page-settings input[type="checkbox"][checked]')
|
447
|
-
end
|
448
|
-
end
|
449
|
-
|
450
|
-
describe 'translation progress counter', js: true do
|
451
|
-
before do
|
452
|
-
FactoryBot.create(:translation, exhibit: exhibit, locale: 'fr', key: "#{exhibit.slug}.title", value: 'Titre')
|
453
|
-
end
|
454
|
-
|
455
|
-
it 'counts existing and total available translations' do
|
456
|
-
visit spotlight.edit_exhibit_translations_path(exhibit, language: 'fr')
|
457
|
-
expect(page).to have_link('General 1/8')
|
458
|
-
expect(page).to have_link('Search field labels 0/16')
|
459
|
-
expect(page).to have_link('Browse categories 0/3')
|
460
|
-
expect(page).to have_link('Metadata field labels 0/17')
|
461
|
-
end
|
462
|
-
end
|
463
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Exhibits index page', type: :feature do
|
4
|
-
context 'with multiple exhibits' do
|
5
|
-
let!(:exhibit) { FactoryBot.create(:exhibit, title: 'Some Exhibit Title') }
|
6
|
-
let!(:other_exhibit) { FactoryBot.create(:exhibit, title: 'Some Other Title') }
|
7
|
-
|
8
|
-
it 'shows some cards for each published exhibit' do
|
9
|
-
visit spotlight.exhibits_path
|
10
|
-
|
11
|
-
expect(page).to have_selector '.exhibit-card h2', text: 'Some Exhibit Title'
|
12
|
-
end
|
13
|
-
|
14
|
-
context 'with tagged exhibits' do
|
15
|
-
before do
|
16
|
-
exhibit.tag_list = %w[a]
|
17
|
-
other_exhibit.tag_list = %w[a b]
|
18
|
-
|
19
|
-
exhibit.save
|
20
|
-
other_exhibit.save
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'shows controls to filter exhibits by tags' do
|
24
|
-
visit spotlight.exhibits_path
|
25
|
-
|
26
|
-
expect(page).to have_selector '.exhibit-card', count: 2
|
27
|
-
|
28
|
-
within '.tags' do
|
29
|
-
expect(page).to have_selector '.active', text: 'All'
|
30
|
-
|
31
|
-
click_link 'a'
|
32
|
-
end
|
33
|
-
|
34
|
-
expect(page).to have_selector '.exhibit-card', count: 2
|
35
|
-
|
36
|
-
within '.tags' do
|
37
|
-
expect(page).to have_selector '.active', text: 'a'
|
38
|
-
click_link 'b'
|
39
|
-
end
|
40
|
-
|
41
|
-
expect(page).to have_selector '.exhibit-card', count: 1
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
context 'with a single exhibit' do
|
47
|
-
let!(:exhibit) { FactoryBot.create(:exhibit, title: 'Some Exhibit Title') }
|
48
|
-
|
49
|
-
it 'redirects to the exhibit home page' do
|
50
|
-
visit spotlight.exhibits_path
|
51
|
-
|
52
|
-
expect(current_url).to eq spotlight.exhibit_root_url(exhibit)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
@@ -1,155 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'Feature page', type: :feature, versioning: true do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
6
|
-
|
7
|
-
describe 'viewing the page' do
|
8
|
-
let!(:feature_page) do
|
9
|
-
FactoryBot.create(:feature_page, title: 'Parent Page', exhibit: exhibit)
|
10
|
-
end
|
11
|
-
|
12
|
-
it 'has <meta> tags' do
|
13
|
-
TopHat.current['twitter_card'] = nil
|
14
|
-
TopHat.current['opengraph'] = nil
|
15
|
-
|
16
|
-
visit spotlight.exhibit_feature_page_path(feature_page.exhibit, feature_page)
|
17
|
-
|
18
|
-
expect(page).to have_css "meta[name='twitter:title'][value='#{feature_page.title}']", visible: false
|
19
|
-
expect(page).to have_css "meta[property='og:site_name']", visible: false
|
20
|
-
expect(page).to have_css "meta[property='og:type'][content='article']", visible: false
|
21
|
-
expect(page).to have_css "meta[property='og:title'][content='#{feature_page.title}']", visible: false
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe 'sidebar' do
|
26
|
-
let!(:parent_feature_page) do
|
27
|
-
FactoryBot.create(:feature_page, title: 'Parent Page', exhibit: exhibit)
|
28
|
-
end
|
29
|
-
let!(:child_feature_page) do
|
30
|
-
FactoryBot.create(
|
31
|
-
:feature_page,
|
32
|
-
title: 'Child Page',
|
33
|
-
parent_page: parent_feature_page, exhibit: exhibit
|
34
|
-
)
|
35
|
-
end
|
36
|
-
|
37
|
-
describe 'when configured to display' do
|
38
|
-
before { parent_feature_page.update display_sidebar: true }
|
39
|
-
|
40
|
-
after { parent_feature_page.update display_sidebar: false }
|
41
|
-
|
42
|
-
it 'is present' do
|
43
|
-
visit spotlight.exhibit_feature_page_path(parent_feature_page.exhibit, parent_feature_page)
|
44
|
-
# the sidebar should display
|
45
|
-
within('#sidebar') do
|
46
|
-
# the current page should be the sidebar header
|
47
|
-
expect(page).to have_css('li', text: parent_feature_page.title)
|
48
|
-
# within the sidebar navigation
|
49
|
-
within('ol.sidenav') do
|
50
|
-
# there should be a link to the child page
|
51
|
-
expect(page).to have_css('li a', text: child_feature_page.title)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
describe 'when configured to not display' do
|
58
|
-
before { parent_feature_page.update display_sidebar: false }
|
59
|
-
|
60
|
-
context 'with a child page' do
|
61
|
-
it 'is present anyway' do
|
62
|
-
visit spotlight.exhibit_feature_page_path(parent_feature_page.exhibit, parent_feature_page)
|
63
|
-
expect(page).to have_css('#sidebar')
|
64
|
-
expect(page).to have_content(child_feature_page.title)
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
context 'with an unpublished child page' do
|
69
|
-
before { child_feature_page.update published: false }
|
70
|
-
|
71
|
-
it 'does not be present' do
|
72
|
-
visit spotlight.exhibit_feature_page_path(parent_feature_page.exhibit, parent_feature_page)
|
73
|
-
expect(page).not_to have_css('#sidebar')
|
74
|
-
expect(page).not_to have_content(child_feature_page.title)
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
describe 'page options' do
|
81
|
-
before { login_as exhibit_curator }
|
82
|
-
|
83
|
-
describe 'publish' do
|
84
|
-
let!(:unpublished_page) { FactoryBot.create(:feature_page, published: false, exhibit: exhibit) }
|
85
|
-
|
86
|
-
it 'is updatable from the edit page' do
|
87
|
-
expect(unpublished_page).not_to be_published
|
88
|
-
|
89
|
-
visit spotlight.edit_exhibit_feature_page_path(unpublished_page.exhibit, unpublished_page)
|
90
|
-
expect(find('#feature_page_published')).not_to be_checked
|
91
|
-
|
92
|
-
check 'Publish'
|
93
|
-
click_button 'Save changes'
|
94
|
-
|
95
|
-
expect(unpublished_page.reload).to be_published
|
96
|
-
|
97
|
-
visit spotlight.edit_exhibit_feature_page_path(unpublished_page.exhibit, unpublished_page)
|
98
|
-
expect(find('#feature_page_published')).to be_checked
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
describe 'display_sidebar' do
|
103
|
-
let!(:feature_page) { FactoryBot.create(:feature_page, display_sidebar: false, exhibit: exhibit) }
|
104
|
-
|
105
|
-
before { feature_page.update display_sidebar: false }
|
106
|
-
|
107
|
-
it 'is updatable from the edit page' do
|
108
|
-
expect(feature_page).not_to be_display_sidebar
|
109
|
-
|
110
|
-
visit spotlight.edit_exhibit_feature_page_path(feature_page.exhibit, feature_page)
|
111
|
-
expect(find('#feature_page_display_sidebar')).not_to be_checked
|
112
|
-
|
113
|
-
check 'Show sidebar'
|
114
|
-
click_button 'Save changes'
|
115
|
-
|
116
|
-
expect(feature_page.reload).to be_display_sidebar
|
117
|
-
|
118
|
-
visit spotlight.edit_exhibit_feature_page_path(feature_page.exhibit, feature_page)
|
119
|
-
expect(find('#feature_page_display_sidebar')).to be_checked
|
120
|
-
end
|
121
|
-
end
|
122
|
-
end
|
123
|
-
|
124
|
-
describe 'page locking' do
|
125
|
-
before { login_as exhibit_curator }
|
126
|
-
|
127
|
-
let!(:feature_page) { FactoryBot.create(:feature_page, display_sidebar: false, exhibit: exhibit) }
|
128
|
-
|
129
|
-
it 'shows a lock message if someone is currently editing the page' do
|
130
|
-
# open the edit page
|
131
|
-
visit spotlight.edit_exhibit_feature_page_path(feature_page.exhibit, feature_page)
|
132
|
-
|
133
|
-
# and then open the edit page again
|
134
|
-
visit spotlight.edit_exhibit_feature_page_path(feature_page.exhibit, feature_page)
|
135
|
-
|
136
|
-
expect(page).to have_css '.alert'
|
137
|
-
within '.alert' do
|
138
|
-
expect(page).to have_content 'This page is currently being edited by ' + exhibit_curator.to_s
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
|
-
it 'releases the lock when the lock holder cancels edits', js: true do
|
143
|
-
# open the edit page
|
144
|
-
visit spotlight.edit_exhibit_feature_page_path(feature_page.exhibit, feature_page)
|
145
|
-
|
146
|
-
click_on 'Cancel'
|
147
|
-
sleep 2
|
148
|
-
|
149
|
-
# and then open the edit page again
|
150
|
-
visit spotlight.edit_exhibit_feature_page_path(feature_page.exhibit, feature_page)
|
151
|
-
|
152
|
-
expect(page).not_to have_css '.alert'
|
153
|
-
end
|
154
|
-
end
|
155
|
-
end
|