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,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'spotlight/searches/_search.html.erb', type: :view do
|
4
|
-
let(:search) do
|
5
|
-
FactoryBot.build_stubbed(:search, exhibit: FactoryBot.create(:exhibit),
|
6
|
-
id: 99,
|
7
|
-
title: 'Title1',
|
8
|
-
query_params: {
|
9
|
-
f: {
|
10
|
-
genre_ssim: ['xyz']
|
11
|
-
}
|
12
|
-
})
|
13
|
-
end
|
14
|
-
let(:thumbnail) { double(id: '7777', iiif_url: '/images/7777/full/400,300/0/default.jpg') }
|
15
|
-
|
16
|
-
before do
|
17
|
-
allow(view).to receive(:edit_search_path).and_return('/edit')
|
18
|
-
allow(view).to receive(:search_path).and_return('/search')
|
19
|
-
allow(search).to receive(:thumbnail).and_return(thumbnail)
|
20
|
-
allow(search).to receive(:count).and_return(15)
|
21
|
-
allow(search).to receive(:params).and_return({})
|
22
|
-
|
23
|
-
form_for(search, url: '/update') do |f|
|
24
|
-
@f = f
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'renders a list of pages' do
|
29
|
-
# rubocop:disable RSpec/InstanceVariable
|
30
|
-
render partial: 'spotlight/searches/search', locals: { f: @f }
|
31
|
-
# rubocop:enable RSpec/InstanceVariable
|
32
|
-
expect(rendered).to have_selector "li[data-id='99']"
|
33
|
-
expect(rendered).to have_selector '.card-title', text: 'Title1'
|
34
|
-
expect(rendered).to have_selector 'img[src="/images/7777/full/400,300/0/default.jpg"]'
|
35
|
-
expect(rendered).to have_selector 'input[type=hidden][data-property=weight]', visible: false
|
36
|
-
end
|
37
|
-
end
|
@@ -1,40 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'spotlight/searches/edit.html.erb', type: :view do
|
4
|
-
let(:blacklight_config) do
|
5
|
-
Blacklight::Configuration.new do |config|
|
6
|
-
config.add_facet_field :some_field
|
7
|
-
end
|
8
|
-
end
|
9
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
10
|
-
let(:search) do
|
11
|
-
stub_model(Spotlight::Search, exhibit: exhibit,
|
12
|
-
id: 99, title: 'Title1', query_params: { f: { 'some_field' => ['xyz'] } })
|
13
|
-
end
|
14
|
-
|
15
|
-
before do
|
16
|
-
allow(view).to receive(:search_action_path).and_return('/search')
|
17
|
-
allow(view).to receive(:mastheads_path).and_return('/mastheads')
|
18
|
-
allow(view).to receive(:featured_images_path).and_return('/featured_images')
|
19
|
-
allow(view).to receive(:exhibit_search_path).and_return('/search')
|
20
|
-
allow(view).to receive(:exhibit_searches_path).and_return('/searches')
|
21
|
-
allow(view).to receive(:blacklight_config).and_return(blacklight_config)
|
22
|
-
allow(controller).to receive(:search_state_class).and_return(Blacklight::SearchState)
|
23
|
-
|
24
|
-
assign(:exhibit, exhibit)
|
25
|
-
assign(:search, search)
|
26
|
-
allow(view).to receive(:current_exhibit).and_return(exhibit)
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'renders a form w/ the appropriate autocomplete data attribute' do
|
30
|
-
render
|
31
|
-
expect(rendered).to have_selector 'form[data-autocomplete-exhibit-catalog-path]'
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'renders active search constraints' do
|
35
|
-
render
|
36
|
-
expect(rendered).to have_selector '.appliedParams .constraint-value'
|
37
|
-
expect(rendered).to have_selector '.appliedParams .constraint-value .filter-name', text: 'Some Field'
|
38
|
-
expect(rendered).to have_selector '.appliedParams .constraint-value .filter-value', text: 'xyz'
|
39
|
-
end
|
40
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'spotlight/searches/index.html.erb', type: :view do
|
4
|
-
let(:exhibit) { stub_model(Spotlight::Exhibit) }
|
5
|
-
|
6
|
-
before do
|
7
|
-
allow(view).to receive_messages(update_all_exhibit_searches_path: '/')
|
8
|
-
allow(view).to receive(:current_exhibit).and_return(exhibit)
|
9
|
-
assign(:exhibit, exhibit)
|
10
|
-
end
|
11
|
-
|
12
|
-
describe 'Without searches' do
|
13
|
-
it 'disables the update button' do
|
14
|
-
assign(:searches, [])
|
15
|
-
expect(exhibit).to receive(:searchable?).and_return(true)
|
16
|
-
render
|
17
|
-
expect(rendered).to have_content 'You can save search results'
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
describe 'When the exhibit is not searchable' do
|
22
|
-
it 'displays a warning' do
|
23
|
-
assign(:searches, [])
|
24
|
-
expect(exhibit).to receive(:searchable?).and_return(false)
|
25
|
-
render
|
26
|
-
expect(rendered).to have_css '.alert-warning', text: %(\
|
27
|
-
This exhibit is not currently searchable. To perform searches that can \
|
28
|
-
be saved as additional browse categories, \
|
29
|
-
temporarily turn on the Display search box option in the Options section \
|
30
|
-
of the Configuration > Search page.)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'spotlight/sir_trevor/blocks/_browse_block.html.erb', type: :view do
|
4
|
-
let(:p) { 'spotlight/sir_trevor/blocks/browse_block' }
|
5
|
-
let(:page) { double('Page', display_sidebar?: true) }
|
6
|
-
let(:search) { FactoryBot.create(:search) }
|
7
|
-
let(:block) do
|
8
|
-
assign(:page, page)
|
9
|
-
SirTrevorRails::Blocks::BrowseBlock.new({ type: 'block', data: {} }, page)
|
10
|
-
end
|
11
|
-
|
12
|
-
before do
|
13
|
-
allow(block).to receive(:searches).and_return([search])
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'links to the search' do
|
17
|
-
render partial: p, locals: { browse_block: block }
|
18
|
-
expect(rendered).to have_link search.title, href: spotlight.exhibit_browse_path(search.exhibit, search)
|
19
|
-
end
|
20
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'spotlight/sir_trevor/blocks/_iframe_block.html.erb', type: :view do
|
4
|
-
let(:p) { 'spotlight/sir_trevor/blocks/iframe_block' }
|
5
|
-
let(:block) do
|
6
|
-
OpenStruct.new
|
7
|
-
end
|
8
|
-
|
9
|
-
it 'renders iframes' do
|
10
|
-
block.code = "<iframe src='xyz'></iframe>"
|
11
|
-
render partial: p, locals: { iframe_block: block }
|
12
|
-
expect(rendered).to have_selector 'iframe[src="xyz"]'
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'strips extra markup from the code' do
|
16
|
-
block.code = '<a><b></b></a>'
|
17
|
-
render partial: p, locals: { iframe_block: block }
|
18
|
-
expect(rendered).to be_blank
|
19
|
-
end
|
20
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'spotlight/sir_trevor/blocks/_link_to_search_block.html.erb', type: :view do
|
4
|
-
let(:p) { 'spotlight/sir_trevor/blocks/link_to_search_block' }
|
5
|
-
let(:page) { double('Page', display_sidebar?: true) }
|
6
|
-
let(:search) { FactoryBot.create(:search, query_params: { a: 1 }) }
|
7
|
-
let(:block) do
|
8
|
-
assign(:page, page)
|
9
|
-
SirTrevorRails::Blocks::LinkToSearchBlock.new({ type: 'block', data: {} }, page)
|
10
|
-
end
|
11
|
-
|
12
|
-
before do
|
13
|
-
allow(block).to receive(:searches).and_return([search])
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'links to the search' do
|
17
|
-
render partial: p, locals: { link_to_search_block: block }
|
18
|
-
expect(rendered).to have_link search.title, href: spotlight.search_exhibit_catalog_path(search.exhibit, a: 1)
|
19
|
-
end
|
20
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'spotlight/sir_trevor/blocks/_solr_documents_block.html.erb', type: :view do
|
4
|
-
let(:p) { 'spotlight/sir_trevor/blocks/solr_documents_block' }
|
5
|
-
let(:page) { double('Page') }
|
6
|
-
let(:block) do
|
7
|
-
SirTrevorRails::Blocks::SolrDocumentsBlock.new({ type: 'block', data: { title: 'Some title', text: 'Some text', 'text-align' => 'right' } }, page)
|
8
|
-
end
|
9
|
-
let(:doc) { blacklight_config.document_model.new(id: 1) }
|
10
|
-
let(:blacklight_config) do
|
11
|
-
Blacklight::Configuration.new do |config|
|
12
|
-
config.view.embed(partials: %w[a b c], locals: { a: 1 })
|
13
|
-
end
|
14
|
-
end
|
15
|
-
let(:stub_presenter) do
|
16
|
-
instance_double(Blacklight::DocumentPresenter, heading: 'blah', thumbnail: thumbnail_presenter)
|
17
|
-
end
|
18
|
-
|
19
|
-
let(:thumbnail_presenter) { instance_double(Blacklight::ThumbnailPresenter, exists?: true, thumbnail_tag: 'thumb') }
|
20
|
-
|
21
|
-
before do
|
22
|
-
allow(block).to receive(:each_document).and_yield({}, doc)
|
23
|
-
allow(block).to receive(:documents?).and_return(true)
|
24
|
-
end
|
25
|
-
|
26
|
-
before do
|
27
|
-
allow(view).to receive(:blacklight_config).and_return(blacklight_config)
|
28
|
-
allow(view).to receive_messages(document_presenter: stub_presenter, document_link_params: {})
|
29
|
-
end
|
30
|
-
|
31
|
-
context 'with a multi-image object' do
|
32
|
-
let(:block_options) { { thumbnail_image_url: 'http://example.com' } }
|
33
|
-
|
34
|
-
before do
|
35
|
-
allow(block).to receive(:each_document).and_yield(block_options, doc)
|
36
|
-
end
|
37
|
-
|
38
|
-
it 'uses the provided thumbnail url' do
|
39
|
-
render partial: p, locals: { solr_documents_block: block }
|
40
|
-
expect(rendered).to have_selector 'img[src="http://example.com"]'
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb', type: :view do
|
4
|
-
let(:p) { 'spotlight/sir_trevor/blocks/solr_documents_carousel_block' }
|
5
|
-
let(:block) do
|
6
|
-
SirTrevorRails::Blocks::SolrDocumentsCarouselBlock.new({ type: 'block', data: {} }, page)
|
7
|
-
end
|
8
|
-
let(:stub_presenter) do
|
9
|
-
instance_double(Blacklight::DocumentPresenter, heading: 'blah', thumbnail: thumbnail_presenter)
|
10
|
-
end
|
11
|
-
|
12
|
-
let(:thumbnail_presenter) { instance_double(Blacklight::ThumbnailPresenter, exists?: true, thumbnail_tag: 'thumb') }
|
13
|
-
|
14
|
-
before do
|
15
|
-
allow(block).to receive(:each_document).and_return([
|
16
|
-
[{}, SolrDocument.new(id: 1)],
|
17
|
-
[{}, SolrDocument.new(id: 2)],
|
18
|
-
[{}, SolrDocument.new(id: 3)]
|
19
|
-
])
|
20
|
-
allow(block).to receive_messages(documents?: true)
|
21
|
-
allow(view).to receive_messages(solr_documents_carousel_block: block)
|
22
|
-
allow(view).to receive_messages(document_presenter: stub_presenter, blacklight_config: Blacklight::Configuration.new)
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'has a slideshow block' do
|
26
|
-
render partial: p, locals: { item_carousel_block: block }
|
27
|
-
expect(rendered).to have_selector '.carousel-block'
|
28
|
-
expect(rendered).to have_selector '.carousel-control-prev.left'
|
29
|
-
expect(rendered).to have_selector '.carousel-control-next.right'
|
30
|
-
expect(rendered).to have_selector '.carousel-item', text: 'thumb', count: 3
|
31
|
-
expect(rendered).to have_selector '.carousel-indicators'
|
32
|
-
expect(rendered).to have_selector '.carousel-indicators li', count: 3
|
33
|
-
end
|
34
|
-
end
|
@@ -1,53 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb', type: :view do
|
4
|
-
let(:p) { 'spotlight/sir_trevor/blocks/solr_documents_embed_block' }
|
5
|
-
let(:page) { double('Page') }
|
6
|
-
let(:block) do
|
7
|
-
SirTrevorRails::Blocks::SolrDocumentsEmbedBlock.new({ type: 'block', data: { title: 'Some title', text: 'Some text', 'text-align' => 'right' } }, page)
|
8
|
-
end
|
9
|
-
let(:doc) { blacklight_config.document_model.new(id: 1) }
|
10
|
-
let(:blacklight_config) do
|
11
|
-
Blacklight::Configuration.new do |config|
|
12
|
-
config.view.embed(partials: %w[a b c], locals: { a: 1 })
|
13
|
-
end
|
14
|
-
end
|
15
|
-
let(:stub_presenter) do
|
16
|
-
instance_double(Blacklight::DocumentPresenter, heading: 'blah', thumbnail: thumbnail_presenter)
|
17
|
-
end
|
18
|
-
|
19
|
-
let(:thumbnail_presenter) { instance_double(Blacklight::ThumbnailPresenter, exists?: true, thumbnail_tag: 'thumb') }
|
20
|
-
|
21
|
-
before do
|
22
|
-
allow(block).to receive(:each_document).and_yield({}, doc)
|
23
|
-
allow(block).to receive(:documents?).and_return(true)
|
24
|
-
end
|
25
|
-
|
26
|
-
before do
|
27
|
-
allow(view).to receive_messages(blacklight_config: blacklight_config, document_presenter: stub_presenter)
|
28
|
-
end
|
29
|
-
|
30
|
-
it 'has a embed block' do
|
31
|
-
expect(view).to receive(:render_document_partials).with(doc, %w[a b c], hash_including(a: 1, block: block)).and_return('OSD')
|
32
|
-
render partial: p, locals: { solr_documents_embed_block: block }
|
33
|
-
expect(rendered).to have_selector 'h3', text: 'Some title'
|
34
|
-
expect(rendered).to have_content 'Some text'
|
35
|
-
expect(rendered).to have_selector '.box', text: 'OSD'
|
36
|
-
expect(rendered).to have_selector '.items-col'
|
37
|
-
expect(rendered).to have_selector '.text-col'
|
38
|
-
expect(rendered).not_to have_selector '.col-md-12'
|
39
|
-
end
|
40
|
-
|
41
|
-
context 'with a block with no text' do
|
42
|
-
let(:block) do
|
43
|
-
SirTrevorRails::Blocks::SolrDocumentsEmbedBlock.new({ type: 'block', data: { title: 'Some title', 'text-align' => 'right' } }, page)
|
44
|
-
end
|
45
|
-
|
46
|
-
it 'does not have a two column layout' do
|
47
|
-
expect(view).to receive(:render_document_partials).with(doc, %w[a b c], hash_including(a: 1, block: block)).and_return('OSD')
|
48
|
-
render partial: p, locals: { solr_documents_embed_block: block }
|
49
|
-
expect(rendered).to have_selector '.col-md-12'
|
50
|
-
expect(rendered).to have_selector '.items-col h3', text: 'Some title'
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
@@ -1,54 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb', type: :view do
|
4
|
-
let(:p) { 'spotlight/sir_trevor/blocks/solr_documents_features_block' }
|
5
|
-
let(:block) do
|
6
|
-
SirTrevorRails::Blocks::SolrDocumentsFeaturesBlock.new({ type: 'block', data: { 'show-primary-caption' => true, 'primary-caption-field' => 'x' } }, page)
|
7
|
-
end
|
8
|
-
|
9
|
-
let(:blacklight_config) do
|
10
|
-
Blacklight::Configuration.new do |config|
|
11
|
-
config.index.title_field = 'full_title_tesim'
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
before do
|
16
|
-
doc1 = [{}, SolrDocument.new(id: 1, x: 'a' * 100)]
|
17
|
-
doc2 = [{}, SolrDocument.new(id: 2, full_title_tesim: 'full_title')]
|
18
|
-
doc3 = [{}, SolrDocument.new(id: 3)]
|
19
|
-
allow(block).to receive(:each_document).and_return([doc1, doc2, doc3])
|
20
|
-
allow(block).to receive_messages(documents?: true)
|
21
|
-
allow(view).to receive_messages(solr_documents_features_block: block)
|
22
|
-
allow(view).to receive_messages(blacklight_config: blacklight_config)
|
23
|
-
allow_any_instance_of(Blacklight::ThumbnailPresenter).to receive_messages(exists?: true, thumbnail_tag: 'thumb')
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'has a slideshow block' do
|
27
|
-
render partial: p, locals: { item_carousel_block: block }
|
28
|
-
expect(rendered).to have_selector '.item-features'
|
29
|
-
expect(rendered).to have_selector '.carousel-item', text: 'thumb', count: 3
|
30
|
-
expect(rendered).to have_selector '.carousel-indicators'
|
31
|
-
expect(rendered).to have_selector '.carousel-indicators li', count: 3
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'truncates long titles' do
|
35
|
-
render partial: p, locals: { item_carousel_block: block }
|
36
|
-
expect(rendered).to have_selector '.item-features'
|
37
|
-
expect(rendered).to have_selector '.carousel-item', text: 'thumb', count: 3
|
38
|
-
expect(rendered).to have_selector '.carousel-indicators'
|
39
|
-
expect(rendered).to have_selector '.carousel-indicators li', count: 3
|
40
|
-
expect(rendered).to have_selector '.carousel-indicators li', text: 'a' * 92 + '...'
|
41
|
-
end
|
42
|
-
|
43
|
-
describe 'without a primary caption' do
|
44
|
-
let(:block) do
|
45
|
-
SirTrevorRails::Blocks::SolrDocumentsFeaturesBlock.new({ type: 'block', data: { 'show-primary-caption' => false } }, page)
|
46
|
-
end
|
47
|
-
|
48
|
-
it 'falls back to the regular document title for the caption' do
|
49
|
-
render partial: p, locals: { item_carousel_block: block }
|
50
|
-
expect(rendered).to have_selector '.item-features'
|
51
|
-
expect(rendered).to have_selector '.carousel-indicators li', text: 'full_title'
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'spotlight/sir_trevor/blocks/_solr_documents_grid_block', type: :view do
|
4
|
-
let(:p) { 'spotlight/sir_trevor/blocks/solr_documents_grid_block' }
|
5
|
-
let(:page) { double('Page') }
|
6
|
-
let(:block) do
|
7
|
-
SirTrevorRails::Blocks::SolrDocumentsGridBlock.new({ type: 'block', data: { title: 'Some title', text: 'Some text', 'text-align' => 'right' } }, page)
|
8
|
-
end
|
9
|
-
let(:blacklight_config) do
|
10
|
-
Blacklight::Configuration.new
|
11
|
-
end
|
12
|
-
|
13
|
-
let(:stub_presenter) do
|
14
|
-
instance_double(Blacklight::DocumentPresenter, heading: 'blah', thumbnail: thumbnail_presenter)
|
15
|
-
end
|
16
|
-
|
17
|
-
let(:thumbnail_presenter) { instance_double(Blacklight::ThumbnailPresenter, exists?: true, thumbnail_tag: 'thumb') }
|
18
|
-
|
19
|
-
before do
|
20
|
-
allow(block).to receive(:each_document).and_return([
|
21
|
-
[{}, SolrDocument.new(id: 1)],
|
22
|
-
[{}, SolrDocument.new(id: 2)],
|
23
|
-
[{}, SolrDocument.new(id: 3)]
|
24
|
-
])
|
25
|
-
end
|
26
|
-
|
27
|
-
before do
|
28
|
-
allow(view).to receive_messages(
|
29
|
-
blacklight_config: blacklight_config,
|
30
|
-
document_presenter: stub_presenter
|
31
|
-
)
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'has a slideshow block' do
|
35
|
-
render partial: p, locals: { solr_documents_grid_block: block }
|
36
|
-
expect(rendered).to have_selector 'h3', text: 'Some title'
|
37
|
-
expect(rendered).to have_content 'Some text'
|
38
|
-
expect(rendered).to have_selector '.box', text: 'thumb', count: 3
|
39
|
-
expect(rendered).to have_selector '.items-col'
|
40
|
-
expect(rendered).to have_selector '.text-col'
|
41
|
-
end
|
42
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'spotlight/sites/edit_exhibits', type: :view do
|
4
|
-
let!(:exhibit_a) { FactoryBot.create(:exhibit) }
|
5
|
-
let!(:exhibit_b) { FactoryBot.create(:exhibit) }
|
6
|
-
|
7
|
-
before do
|
8
|
-
assign(:site, Spotlight::Site.instance)
|
9
|
-
allow(view).to receive_messages(exhibit_path: nil)
|
10
|
-
end
|
11
|
-
|
12
|
-
it 'has columns for the exhibit data' do
|
13
|
-
render
|
14
|
-
expect(rendered).to have_selector 'th', text: 'Title'
|
15
|
-
expect(rendered).to have_selector 'th', text: 'Published?'
|
16
|
-
expect(rendered).to have_selector 'th', text: 'Requested by'
|
17
|
-
expect(rendered).to have_selector 'th', text: 'Created at'
|
18
|
-
expect(rendered).to have_selector 'th', text: 'Updated at'
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'has draggable rows for each exhibit' do
|
22
|
-
render
|
23
|
-
expect(rendered).to have_selector 'tr .dd-handle', count: 2
|
24
|
-
end
|
25
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'spotlight/tags/index.html.erb', type: :view do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
let!(:tag1) { FactoryBot.create(:tagging, tagger: exhibit, taggable: exhibit) }
|
6
|
-
let!(:tag2) { FactoryBot.create(:tagging, tagger: exhibit, taggable: exhibit) }
|
7
|
-
|
8
|
-
before do
|
9
|
-
assign(:exhibit, exhibit)
|
10
|
-
assign(:tags, exhibit.owned_tags)
|
11
|
-
allow(view).to receive_messages(exhibit_tag_path: '/tags')
|
12
|
-
allow(view).to receive(:current_exhibit).and_return(exhibit)
|
13
|
-
allow(view).to receive(:url_to_tag_facet, &:first)
|
14
|
-
allow(view).to receive_messages(update_all_exhibit_tags_path: '/update_all')
|
15
|
-
allow(view).to receive(:exhibit_path)
|
16
|
-
end
|
17
|
-
|
18
|
-
describe 'Tags' do
|
19
|
-
it 'is displayed' do
|
20
|
-
render
|
21
|
-
[tag1.tag.name, tag2.tag.name].each do |name|
|
22
|
-
expect(rendered).to have_css('h4', text: name)
|
23
|
-
expect(rendered).to have_link(name, href: '#edit-in-place')
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'spotlight/translations/_import.html.erb', type: :view do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
|
6
|
-
before do
|
7
|
-
allow(view).to receive(:can?).and_return(true)
|
8
|
-
allow(view).to receive(:current_exhibit).and_return(exhibit)
|
9
|
-
assign(:language, :es)
|
10
|
-
I18n.default_locale = 'en'
|
11
|
-
end
|
12
|
-
|
13
|
-
it 'has a link to export the translation data' do
|
14
|
-
render
|
15
|
-
expect(rendered).to have_link 'Export English', href: spotlight.exhibit_translations_path(exhibit_id: exhibit, format: 'yaml', locale: 'en')
|
16
|
-
expect(rendered).to have_link 'Export Spanish', href: spotlight.exhibit_translations_path(exhibit_id: exhibit, format: 'yaml', locale: 'es')
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'has a form to import the translation data' do
|
20
|
-
render
|
21
|
-
expect(rendered).to have_selector "form[action='#{spotlight.import_exhibit_translations_path(exhibit_id: exhibit)}']"
|
22
|
-
expect(rendered).to have_selector 'input[name="file"]'
|
23
|
-
end
|
24
|
-
end
|
@@ -1,76 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe 'spotlight/translations/_page.html.erb', type: :view do
|
4
|
-
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
-
let(:page) { FactoryBot.create(:feature_page, exhibit: exhibit) }
|
6
|
-
|
7
|
-
before do
|
8
|
-
allow(view).to receive_messages(
|
9
|
-
clone_exhibit_feature_page_path: '/',
|
10
|
-
clone_exhibit_home_page_path: '/',
|
11
|
-
current_exhibit: exhibit,
|
12
|
-
edit_exhibit_feature_page_path: '/',
|
13
|
-
edit_exhibit_home_page_path: '/',
|
14
|
-
exhibit_feature_page_path: '/',
|
15
|
-
f: instance_double('form', fields_for: {}), # mockform builder
|
16
|
-
page: page
|
17
|
-
)
|
18
|
-
assign(:language, 'es')
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'includes a check icon when the page is published' do
|
22
|
-
page.published = true
|
23
|
-
render
|
24
|
-
|
25
|
-
expect(rendered).to have_css('.translation-complete')
|
26
|
-
end
|
27
|
-
|
28
|
-
context 'when there is a translated page' do
|
29
|
-
let!(:page_es) { FactoryBot.create(:feature_page, exhibit: exhibit, locale: 'es', default_locale_page: page) }
|
30
|
-
|
31
|
-
it 'links to the translated page' do
|
32
|
-
render
|
33
|
-
expect(rendered).to have_link(page_es.title)
|
34
|
-
end
|
35
|
-
|
36
|
-
it 'includes the data attribute used by the progress tracker' do
|
37
|
-
render
|
38
|
-
expect(rendered).to have_css('[data-translation-present="true"]')
|
39
|
-
end
|
40
|
-
|
41
|
-
context 'when the default locale page has been updated more recently than the translation' do
|
42
|
-
before { page_es.update(updated_at: 10.seconds.ago) }
|
43
|
-
|
44
|
-
it 'includes an alert icon' do
|
45
|
-
render
|
46
|
-
|
47
|
-
expect(rendered).to have_css('.translation-warning')
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
context 'when the page is a home page' do
|
52
|
-
let(:page) { exhibit.home_page }
|
53
|
-
|
54
|
-
before { page_es.update(type: 'Spotlight::HomePage') }
|
55
|
-
|
56
|
-
it 'does not render a delete link' do
|
57
|
-
render
|
58
|
-
|
59
|
-
expect(rendered).not_to have_link('Delete')
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
context 'when there is no translated page' do
|
65
|
-
it 'links to create a new one' do
|
66
|
-
render
|
67
|
-
expect(rendered).to have_content 'No translated page.'
|
68
|
-
expect(rendered).to have_link 'Create one now.'
|
69
|
-
end
|
70
|
-
|
71
|
-
it 'does not include the data attribute used by the progress tracker' do
|
72
|
-
render
|
73
|
-
expect(rendered).not_to have_css('[data-translation-present="true"]')
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|