blacklight-spotlight 3.3.0 → 3.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (303) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/spotlight/pages_controller.rb +1 -1
  3. data/app/controllers/spotlight/roles_controller.rb +1 -1
  4. data/app/helpers/spotlight/pages_helper.rb +12 -0
  5. data/app/helpers/spotlight/title_helper.rb +0 -2
  6. data/app/models/sir_trevor_rails/block.rb +85 -0
  7. data/app/models/sir_trevor_rails/blocks/displayable.rb +1 -1
  8. data/app/models/spotlight/page_content/sir_trevor.rb +13 -4
  9. data/app/models/translation.rb +18 -0
  10. data/app/views/shared/_site_sidebar.html.erb +1 -1
  11. data/app/views/spotlight/sir_trevor/blocks/_video_block.html.erb +5 -0
  12. data/config/i18n-tasks.yml +1 -0
  13. data/config/locales/spotlight.de.yml +40 -0
  14. data/lib/generators/spotlight/install_generator.rb +40 -2
  15. data/lib/generators/spotlight/templates/config/initializers/translation.rb +5 -5
  16. data/lib/generators/spotlight/templates/solr/config/schema.xml +32 -50
  17. data/lib/generators/spotlight/templates/solr/config/solrconfig.xml +14 -12
  18. data/lib/spotlight/engine.rb +1 -1
  19. data/lib/spotlight/version.rb +1 -1
  20. data/lib/tasks/spotlight_tasks.rake +20 -0
  21. metadata +100 -597
  22. data/lib/generators/spotlight/templates/config/initializers/sir_trevor_rails.rb +0 -10
  23. data/spec/controllers/application_controller_spec.rb +0 -30
  24. data/spec/controllers/spotlight/about_pages_controller_spec.rb +0 -241
  25. data/spec/controllers/spotlight/admin_users_controller_spec.rb +0 -53
  26. data/spec/controllers/spotlight/appearances_controller_spec.rb +0 -88
  27. data/spec/controllers/spotlight/application_controller_spec.rb +0 -11
  28. data/spec/controllers/spotlight/attachments_controller_spec.rb +0 -28
  29. data/spec/controllers/spotlight/browse_controller_spec.rb +0 -133
  30. data/spec/controllers/spotlight/bulk_actions_controller_spec.rb +0 -124
  31. data/spec/controllers/spotlight/bulk_updates_controller_spec.rb +0 -77
  32. data/spec/controllers/spotlight/catalog_controller_spec.rb +0 -552
  33. data/spec/controllers/spotlight/confirmations_controller_spec.rb +0 -38
  34. data/spec/controllers/spotlight/contact_email_controller_spec.rb +0 -65
  35. data/spec/controllers/spotlight/contact_forms_controller_spec.rb +0 -38
  36. data/spec/controllers/spotlight/contacts_controller_spec.rb +0 -103
  37. data/spec/controllers/spotlight/custom_fields_controller_spec.rb +0 -62
  38. data/spec/controllers/spotlight/custom_search_fields_controller_spec.rb +0 -62
  39. data/spec/controllers/spotlight/dashboards_controller_spec.rb +0 -68
  40. data/spec/controllers/spotlight/exhibits_controller_spec.rb +0 -216
  41. data/spec/controllers/spotlight/feature_pages_controller_spec.rb +0 -251
  42. data/spec/controllers/spotlight/featured_images_controller_spec.rb +0 -77
  43. data/spec/controllers/spotlight/filters_controller_spec.rb +0 -72
  44. data/spec/controllers/spotlight/groups_controller_spec.rb +0 -103
  45. data/spec/controllers/spotlight/home_pages_controller_spec.rb +0 -126
  46. data/spec/controllers/spotlight/job_trackers_controller_spec.rb +0 -37
  47. data/spec/controllers/spotlight/languages_controller_spec.rb +0 -70
  48. data/spec/controllers/spotlight/metadata_configurations_controller_spec.rb +0 -93
  49. data/spec/controllers/spotlight/pages_controller_spec.rb +0 -50
  50. data/spec/controllers/spotlight/resources/csv_upload_controller_spec.rb +0 -71
  51. data/spec/controllers/spotlight/resources/upload_controller_spec.rb +0 -55
  52. data/spec/controllers/spotlight/resources_controller_spec.rb +0 -85
  53. data/spec/controllers/spotlight/roles_controller_spec.rb +0 -141
  54. data/spec/controllers/spotlight/search_configurations_controller_spec.rb +0 -141
  55. data/spec/controllers/spotlight/searches_controller_spec.rb +0 -195
  56. data/spec/controllers/spotlight/sites_controller_spec.rb +0 -67
  57. data/spec/controllers/spotlight/solr_controller_spec.rb +0 -116
  58. data/spec/controllers/spotlight/tags_controller_spec.rb +0 -56
  59. data/spec/controllers/spotlight/translations_controller_spec.rb +0 -132
  60. data/spec/controllers/spotlight/versions_controller_spec.rb +0 -56
  61. data/spec/controllers/spotlight/view_configurations_controller_spec.rb +0 -35
  62. data/spec/examples.txt +0 -1515
  63. data/spec/features/about_page_spec.rb +0 -46
  64. data/spec/features/add_contacts_spec.rb +0 -63
  65. data/spec/features/add_custom_field_metadata_spec.rb +0 -88
  66. data/spec/features/add_iiif_manifest_spec.rb +0 -46
  67. data/spec/features/add_items_spec.rb +0 -135
  68. data/spec/features/autocomplete_typeahead_spec.rb +0 -88
  69. data/spec/features/browse_category_admin_spec.rb +0 -163
  70. data/spec/features/browse_category_navigation_spec.rb +0 -44
  71. data/spec/features/browse_category_spec.rb +0 -158
  72. data/spec/features/bulk_actions_spec.rb +0 -72
  73. data/spec/features/catalog_spec.rb +0 -57
  74. data/spec/features/confirm_email_spec.rb +0 -21
  75. data/spec/features/create_exhibit_spec.rb +0 -65
  76. data/spec/features/create_page_spec.rb +0 -21
  77. data/spec/features/dashboard_spec.rb +0 -34
  78. data/spec/features/edit_contact_spec.rb +0 -21
  79. data/spec/features/edit_search_fields_spec.rb +0 -79
  80. data/spec/features/exhibit_masthead_spec.rb +0 -112
  81. data/spec/features/exhibit_themes_spec.rb +0 -28
  82. data/spec/features/exhibits/add_tags_spec.rb +0 -35
  83. data/spec/features/exhibits/administration_spec.rb +0 -141
  84. data/spec/features/exhibits/custom_metadata_fields_spec.rb +0 -97
  85. data/spec/features/exhibits/custom_search_fields_spec.rb +0 -55
  86. data/spec/features/exhibits/edit_metadata_fields_spec.rb +0 -49
  87. data/spec/features/exhibits/language_create_edit_spec.rb +0 -59
  88. data/spec/features/exhibits/translation_editing_spec.rb +0 -463
  89. data/spec/features/exhibits_index_spec.rb +0 -55
  90. data/spec/features/feature_page_spec.rb +0 -155
  91. data/spec/features/home_page_spec.rb +0 -102
  92. data/spec/features/import_exhibit_spec.rb +0 -58
  93. data/spec/features/item_admin_spec.rb +0 -59
  94. data/spec/features/javascript/about_page_admin_spec.rb +0 -21
  95. data/spec/features/javascript/block_controls_spec.rb +0 -42
  96. data/spec/features/javascript/blocks/browse_group_categories_block_spec.rb +0 -64
  97. data/spec/features/javascript/blocks/featured_browse_categories_block_spec.rb +0 -46
  98. data/spec/features/javascript/blocks/featured_pages_block_spec.rb +0 -61
  99. data/spec/features/javascript/blocks/link_to_search_block_spec.rb +0 -46
  100. data/spec/features/javascript/blocks/rule_block_spec.rb +0 -23
  101. data/spec/features/javascript/blocks/search_result_block_spec.rb +0 -47
  102. data/spec/features/javascript/blocks/solr_documents_block_spec.rb +0 -232
  103. data/spec/features/javascript/blocks/solr_documents_carousel_block_spec.rb +0 -29
  104. data/spec/features/javascript/blocks/uploaded_items_block_spec.rb +0 -94
  105. data/spec/features/javascript/browse_group_admin_spec.rb +0 -45
  106. data/spec/features/javascript/edit_in_place_spec.rb +0 -93
  107. data/spec/features/javascript/feature_page_admin_spec.rb +0 -140
  108. data/spec/features/javascript/home_page_edit_spec.rb +0 -34
  109. data/spec/features/javascript/locale_selector_spec.rb +0 -66
  110. data/spec/features/javascript/metadata_admin_spec.rb +0 -41
  111. data/spec/features/javascript/multi_image_select_spec.rb +0 -50
  112. data/spec/features/javascript/reindex_monitor_spec.rb +0 -23
  113. data/spec/features/javascript/roles_admin_spec.rb +0 -38
  114. data/spec/features/javascript/search_config_admin_spec.rb +0 -140
  115. data/spec/features/javascript/search_context_spec.rb +0 -88
  116. data/spec/features/main_navigation_spec.rb +0 -96
  117. data/spec/features/metadata_admin_spec.rb +0 -18
  118. data/spec/features/report_a_problem_spec.rb +0 -62
  119. data/spec/features/site_masthead_spec.rb +0 -91
  120. data/spec/features/site_users_management_spec.rb +0 -74
  121. data/spec/features/slideshow_spec.rb +0 -21
  122. data/spec/features/translation_scope_spec.rb +0 -27
  123. data/spec/fixtures/800x600.png +0 -0
  124. data/spec/fixtures/avatar.png +0 -0
  125. data/spec/fixtures/bulk-update-template.csv +0 -57
  126. data/spec/fixtures/csv-upload-fixture.csv +0 -4
  127. data/spec/fixtures/gk446cj2442-manifest.json +0 -58
  128. data/spec/fixtures/iiif_responses.rb +0 -312
  129. data/spec/fixtures/json-upload-fixture.json +0 -3
  130. data/spec/fixtures/sample_solr_documents.yml +0 -9385
  131. data/spec/fixtures/updated-bulk-update-template-no-cols.csv +0 -4
  132. data/spec/fixtures/updated-bulk-update-template-w-tags.csv +0 -4
  133. data/spec/fixtures/updated-bulk-update-template.csv +0 -4
  134. data/spec/helpers/spotlight/application_helper_spec.rb +0 -196
  135. data/spec/helpers/spotlight/browse_helper_spec.rb +0 -13
  136. data/spec/helpers/spotlight/crop_helper_spec.rb +0 -11
  137. data/spec/helpers/spotlight/crud_link_helpers_spec.rb +0 -163
  138. data/spec/helpers/spotlight/languages_helper_spec.rb +0 -79
  139. data/spec/helpers/spotlight/main_app_helpers_spec.rb +0 -101
  140. data/spec/helpers/spotlight/masthead_helper_spec.rb +0 -51
  141. data/spec/helpers/spotlight/meta_helper_spec.rb +0 -33
  142. data/spec/helpers/spotlight/navbar_helper_spec.rb +0 -24
  143. data/spec/helpers/spotlight/pages_helper_spec.rb +0 -123
  144. data/spec/helpers/spotlight/roles_helper_spec.rb +0 -7
  145. data/spec/helpers/spotlight/search_configurations_helper_spec.rb +0 -23
  146. data/spec/helpers/spotlight/title_helper_spec.rb +0 -64
  147. data/spec/helpers/spotlight/translations_helper_spec.rb +0 -16
  148. data/spec/i18n_spec.rb +0 -28
  149. data/spec/jobs/spotlight/add_tags_job_spec.rb +0 -34
  150. data/spec/jobs/spotlight/add_uploads_from_csv_spec.rb +0 -58
  151. data/spec/jobs/spotlight/change_visibility_job_spec.rb +0 -30
  152. data/spec/jobs/spotlight/default_thumbnail_job_spec.rb +0 -14
  153. data/spec/jobs/spotlight/process_bulk_updates_csv_job_spec.rb +0 -86
  154. data/spec/jobs/spotlight/reindex_exhibit_job_spec.rb +0 -43
  155. data/spec/jobs/spotlight/reindex_job_spec.rb +0 -79
  156. data/spec/jobs/spotlight/remove_tags_job_spec.rb +0 -39
  157. data/spec/jobs/spotlight/rename_sidecar_field_job_spec.rb +0 -33
  158. data/spec/lib/migration/iiif_spec.rb +0 -91
  159. data/spec/lib/migration/page_language_spec.rb +0 -25
  160. data/spec/lib/spotlight/catalog_spec.rb +0 -0
  161. data/spec/lib/spotlight/controller_spec.rb +0 -102
  162. data/spec/lib/spotlight/upload_field_config_spec.rb +0 -40
  163. data/spec/mailers/spotlight/indexing_complete_mailer_spec.rb +0 -42
  164. data/spec/models/sir_trevor_rails/blocks/browse_block_spec.rb +0 -42
  165. data/spec/models/sir_trevor_rails/blocks/browse_group_categories_block_spec.rb +0 -41
  166. data/spec/models/sir_trevor_rails/blocks/featured_pages_block_spec.rb +0 -50
  167. data/spec/models/sir_trevor_rails/blocks/search_results_block_spec.rb +0 -23
  168. data/spec/models/sir_trevor_rails/blocks/solr_documents_block_spec.rb +0 -59
  169. data/spec/models/sir_trevor_rails/blocks/textable_spec.rb +0 -42
  170. data/spec/models/solr_document_spec.rb +0 -214
  171. data/spec/models/spotlight/ability_spec.rb +0 -118
  172. data/spec/models/spotlight/about_page_spec.rb +0 -19
  173. data/spec/models/spotlight/access_controls_enforcement_search_builder_spec.rb +0 -82
  174. data/spec/models/spotlight/analytics/ga_spec.rb +0 -22
  175. data/spec/models/spotlight/background_job_progress_spec.rb +0 -137
  176. data/spec/models/spotlight/blacklight_configuration_spec.rb +0 -649
  177. data/spec/models/spotlight/browse_category_search_builder_spec.rb +0 -49
  178. data/spec/models/spotlight/contact_email_spec.rb +0 -48
  179. data/spec/models/spotlight/contact_form_spec.rb +0 -94
  180. data/spec/models/spotlight/contact_image_spec.rb +0 -11
  181. data/spec/models/spotlight/contact_spec.rb +0 -38
  182. data/spec/models/spotlight/custom_field_spec.rb +0 -204
  183. data/spec/models/spotlight/custom_search_field_spec.rb +0 -56
  184. data/spec/models/spotlight/custom_translation_extension_spec.rb +0 -24
  185. data/spec/models/spotlight/exhibit_spec.rb +0 -383
  186. data/spec/models/spotlight/exhibit_thumbnail_spec.rb +0 -10
  187. data/spec/models/spotlight/feature_page_spec.rb +0 -87
  188. data/spec/models/spotlight/featured_image_spec.rb +0 -110
  189. data/spec/models/spotlight/field_metadata_spec.rb +0 -58
  190. data/spec/models/spotlight/filter_spec.rb +0 -19
  191. data/spec/models/spotlight/group_spec.rb +0 -19
  192. data/spec/models/spotlight/home_page_spec.rb +0 -38
  193. data/spec/models/spotlight/language_spec.rb +0 -42
  194. data/spec/models/spotlight/main_navigation_spec.rb +0 -19
  195. data/spec/models/spotlight/masthead_spec.rb +0 -45
  196. data/spec/models/spotlight/page_configurations_spec.rb +0 -45
  197. data/spec/models/spotlight/page_spec.rb +0 -303
  198. data/spec/models/spotlight/resource_spec.rb +0 -137
  199. data/spec/models/spotlight/resources/iiif_harvester_spec.rb +0 -52
  200. data/spec/models/spotlight/resources/iiif_manifest_spec.rb +0 -178
  201. data/spec/models/spotlight/resources/iiif_service_spec.rb +0 -57
  202. data/spec/models/spotlight/resources/upload_spec.rb +0 -71
  203. data/spec/models/spotlight/resources/web_spec.rb +0 -25
  204. data/spec/models/spotlight/role_spec.rb +0 -51
  205. data/spec/models/spotlight/search_spec.rb +0 -125
  206. data/spec/models/spotlight/site_spec.rb +0 -9
  207. data/spec/models/spotlight/sitemap_spec.rb +0 -113
  208. data/spec/models/spotlight/solr_document/atomic_updates_spec.rb +0 -56
  209. data/spec/models/spotlight/solr_document/uploaded_resource_spec.rb +0 -38
  210. data/spec/models/spotlight/solr_document_sidecar_spec.rb +0 -48
  211. data/spec/models/spotlight/user_spec.rb +0 -26
  212. data/spec/models/translation_spec.rb +0 -14
  213. data/spec/presenters/spotlight/iiif_manifest_presenter_spec.rb +0 -132
  214. data/spec/routing/spotlight/exhibit_catalog_spec.rb +0 -34
  215. data/spec/routing/spotlight/featured_images_spec.rb +0 -23
  216. data/spec/routing/spotlight/pages_routing_spec.rb +0 -42
  217. data/spec/services/spotlight/bulk_updates_csv_template_service_spec.rb +0 -26
  218. data/spec/services/spotlight/carrierwave_file_resolver_spec.rb +0 -16
  219. data/spec/services/spotlight/clone_translated_page_from_locale_spec.rb +0 -30
  220. data/spec/services/spotlight/etl/context_spec.rb +0 -66
  221. data/spec/services/spotlight/etl/executor_spec.rb +0 -149
  222. data/spec/services/spotlight/etl/pipeline_spec.rb +0 -22
  223. data/spec/services/spotlight/etl/solr_loader_spec.rb +0 -76
  224. data/spec/services/spotlight/etl/step_spec.rb +0 -70
  225. data/spec/services/spotlight/exhibit_import_export_service_spec.rb +0 -569
  226. data/spec/services/spotlight/iiif_resource_resolver_spec.rb +0 -94
  227. data/spec/services/spotlight/invite_users_service_spec.rb +0 -47
  228. data/spec/spec_helper.rb +0 -147
  229. data/spec/support/controllers/engine_helpers.rb +0 -9
  230. data/spec/support/disable_friendly_id_deprecation_warnings.rb +0 -11
  231. data/spec/support/features/capybara_default_max_wait_metadata_helper.rb +0 -20
  232. data/spec/support/features/test_features_helpers.rb +0 -92
  233. data/spec/support/helpers/controller_level_helpers.rb +0 -25
  234. data/spec/support/stub_iiif_response.rb +0 -26
  235. data/spec/support/views/test_view_helpers.rb +0 -20
  236. data/spec/test_app_templates/Gemfile.extra +0 -2
  237. data/spec/test_app_templates/carrierwave.rb +0 -8
  238. data/spec/test_app_templates/catalog_controller.rb +0 -108
  239. data/spec/test_app_templates/fixture.css +0 -0
  240. data/spec/test_app_templates/fixture.png +0 -0
  241. data/spec/test_app_templates/lib/generators/test_app_generator.rb +0 -69
  242. data/spec/test_app_templates/spotlight_test.rake +0 -14
  243. data/spec/uploaders/spotlight/attachment_uploader_spec.rb +0 -27
  244. data/spec/uploaders/spotlight/featured_image_uploader_spec.rb +0 -33
  245. data/spec/views/shared/_analytics.html.erb_spec.rb +0 -17
  246. data/spec/views/shared/_exhibit_navbar.html.erb_spec.rb +0 -127
  247. data/spec/views/shared/_header_navbar.html.erb_spec.rb +0 -12
  248. data/spec/views/shared/_masthead.html.erb_spec.rb +0 -91
  249. data/spec/views/shared/_user_util_links.html.erb_spec.rb +0 -102
  250. data/spec/views/spotlight/about_pages/_empty.html.erb_spec.rb +0 -28
  251. data/spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb +0 -24
  252. data/spec/views/spotlight/about_pages/index.html.erb_spec.rb +0 -69
  253. data/spec/views/spotlight/browse/_search.html.erb_spec.rb +0 -30
  254. data/spec/views/spotlight/browse/index.html.erb_spec.rb +0 -22
  255. data/spec/views/spotlight/browse/show.html.erb_spec.rb +0 -65
  256. data/spec/views/spotlight/catalog/_edit_default.html.erb_spec.rb +0 -63
  257. data/spec/views/spotlight/catalog/admin.html.erb_spec.rb +0 -39
  258. data/spec/views/spotlight/catalog/edit.html.erb_spec.rb +0 -20
  259. data/spec/views/spotlight/contacts/edit.html.erb_spec.rb +0 -43
  260. data/spec/views/spotlight/dashboards/_analytics.html.erb_spec.rb +0 -45
  261. data/spec/views/spotlight/dashboards/_reindexing_activity.html.erb_spec.rb +0 -94
  262. data/spec/views/spotlight/dashboards/analytics.html.erb_spec.rb +0 -33
  263. data/spec/views/spotlight/exhibits/_exhibit_card.html.erb_spec.rb +0 -46
  264. data/spec/views/spotlight/exhibits/_form.html.erb_spec.rb +0 -38
  265. data/spec/views/spotlight/exhibits/edit.html.erb_spec.rb +0 -29
  266. data/spec/views/spotlight/exhibits/index.html.erb_spec.rb +0 -140
  267. data/spec/views/spotlight/feature_pages/_empty.html.erb_spec.rb +0 -28
  268. data/spec/views/spotlight/feature_pages/_sidebar.html.erb_spec.rb +0 -45
  269. data/spec/views/spotlight/featured_images/_form.html.erb_spec.rb +0 -32
  270. data/spec/views/spotlight/featured_images/_upload_form.html.erb_spec.rb +0 -32
  271. data/spec/views/spotlight/home_pages/_empty.html.erb_spec.rb +0 -28
  272. data/spec/views/spotlight/home_pages/_sidebar.html.erb_spec.rb +0 -12
  273. data/spec/views/spotlight/job_trackers/show.html.erb_spec.rb +0 -65
  274. data/spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb +0 -30
  275. data/spec/views/spotlight/metadata_configurations/edit.html.erb_spec.rb +0 -23
  276. data/spec/views/spotlight/pages/_form.html.erb_spec.rb +0 -20
  277. data/spec/views/spotlight/pages/edit.html.erb_spec.rb +0 -68
  278. data/spec/views/spotlight/pages/index.html.erb_spec.rb +0 -42
  279. data/spec/views/spotlight/pages/new.html.erb_spec.rb +0 -21
  280. data/spec/views/spotlight/pages/show.html.erb_spec.rb +0 -84
  281. data/spec/views/spotlight/resources/_external_resources_form.html.erb_spec.rb +0 -36
  282. data/spec/views/spotlight/resources/new.html.erb_spec.rb +0 -30
  283. data/spec/views/spotlight/roles/index.html.erb_spec.rb +0 -30
  284. data/spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb +0 -58
  285. data/spec/views/spotlight/search_configurations/_facets.html.erb_spec.rb +0 -54
  286. data/spec/views/spotlight/search_configurations/_search_fields.html.erb_spec.rb +0 -54
  287. data/spec/views/spotlight/search_configurations/_sort.html.erb_spec.rb +0 -40
  288. data/spec/views/spotlight/searches/_search.html.erb_spec.rb +0 -37
  289. data/spec/views/spotlight/searches/edit.html.erb_spec.rb +0 -40
  290. data/spec/views/spotlight/searches/index.html.erb_spec.rb +0 -33
  291. data/spec/views/spotlight/sir_trevor/blocks/_browse_block.html.erb_spec.rb +0 -20
  292. data/spec/views/spotlight/sir_trevor/blocks/_iframe_block.html.erb_spec.rb +0 -20
  293. data/spec/views/spotlight/sir_trevor/blocks/_link_to_search_block.html.erb_spec.rb +0 -20
  294. data/spec/views/spotlight/sir_trevor/blocks/_rule_block.html.erb_spec.rb +0 -10
  295. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb_spec.rb +0 -43
  296. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb_spec.rb +0 -34
  297. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb +0 -53
  298. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb_spec.rb +0 -54
  299. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb_spec.rb +0 -42
  300. data/spec/views/spotlight/sites/edit_exhibits.html.erb_spec.rb +0 -25
  301. data/spec/views/spotlight/tags/index.html.erb_spec.rb +0 -27
  302. data/spec/views/spotlight/translations/_import.html.erb_spec.rb +0 -24
  303. data/spec/views/spotlight/translations/_page.html.erb_spec.rb +0 -76
@@ -1,46 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'About page', type: :feature, versioning: true do
4
- let(:exhibit) { FactoryBot.create(:exhibit) }
5
- let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
6
- let!(:about_page1) { FactoryBot.create(:about_page, title: 'First Page', exhibit: exhibit) }
7
- let!(:about_page2) { FactoryBot.create(:about_page, title: 'Second Page', exhibit: exhibit) }
8
- let(:unpublished_page) { FactoryBot.create(:about_page, title: 'Unpublished Page', published: false, exhibit: exhibit) }
9
-
10
- describe 'sidebar' do
11
- it 'displays' do
12
- visit spotlight.exhibit_about_page_path(about_page1.exhibit, about_page1)
13
- # the sidebar should display
14
- within('#sidebar') do
15
- # within the sidebar navigation
16
- within('ul.sidenav') do
17
- # the current page should be active
18
- expect(page).to have_css('li.active', text: about_page1.title)
19
- # the other page should be linked
20
- expect(page).to have_css('li a', text: about_page2.title)
21
- end
22
- end
23
- end
24
- end
25
-
26
- describe 'page options' do
27
- before { login_as exhibit_curator }
28
-
29
- describe 'publish' do
30
- it 'is updatable from the edit page' do
31
- expect(unpublished_page).not_to be_published
32
-
33
- visit spotlight.edit_exhibit_about_page_path(unpublished_page.exhibit, unpublished_page)
34
- expect(find('#about_page_published')).not_to be_checked
35
-
36
- check 'Publish'
37
- click_button 'Save changes'
38
-
39
- expect(unpublished_page.reload).to be_published
40
-
41
- visit spotlight.edit_exhibit_about_page_path(unpublished_page.exhibit, unpublished_page)
42
- expect(find('#about_page_published')).to be_checked
43
- end
44
- end
45
- end
46
- end
@@ -1,63 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'Add a contact to an exhibit', type: :feature do
4
- let(:curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
5
- let(:exhibit) { FactoryBot.create(:exhibit) }
6
- let!(:about_page) { FactoryBot.create(:about_page, exhibit: exhibit) }
7
-
8
- before { login_as curator }
9
-
10
- it 'displays a newly added contact in the sidebar' do
11
- visit spotlight.exhibit_about_pages_path(exhibit)
12
- click_link 'Add contact'
13
- within '#new_contact' do
14
- fill_in 'Name', with: 'Marcus Aurelius'
15
- fill_in 'Email', with: 'marcus@rome.gov'
16
- fill_in 'Title', with: 'Emperor'
17
- fill_in 'Location', with: 'Rome'
18
- fill_in 'Telephone', with: '(555) 555-5555 ext. 12345 (mobile)'
19
-
20
- find('input[name="commit"]').click
21
- end
22
- expect(page).to have_content 'The contact was created.'
23
-
24
- within '.contacts_admin' do
25
- check 'exhibit_contacts_attributes_0_show_in_sidebar'
26
- end
27
- within '.exhibit-contacts' do
28
- click_button 'Save changes'
29
- end
30
-
31
- expect(page).to have_content 'Contacts were successfully updated.'
32
-
33
- within '#nested-pages' do
34
- click_link 'View'
35
- end
36
-
37
- within '#sidebar .contacts' do
38
- expect(page).to have_selector '.name', text: 'Marcus Aurelius'
39
- expect(page).to have_selector 'div', text: 'marcus@rome.gov'
40
- expect(page).to have_selector 'div', text: 'Emperor'
41
- expect(page).to have_selector 'div', text: 'Rome'
42
- expect(page).to have_selector 'div', text: '(555) 555-5555 ext. 12345 (mobile)'
43
- expect(page).not_to have_selector 'img.contact-photo'
44
- end
45
- end
46
-
47
- it "allows the curator to crop the contact's avatar", js: true do
48
- skip "Capybara doesn't play well with the image cropper..."
49
-
50
- visit spotlight.exhibit_about_pages_path(exhibit)
51
- click_link 'Add contact'
52
-
53
- within '#new_contact' do
54
- fill_in 'Name', with: 'Pictured User'
55
- fill_in 'Email', with: 'marcus@rome.gov'
56
- attach_file('contact_avatar_attributes_file', File.absolute_path(File.join(FIXTURES_PATH, 'avatar.png')))
57
- click_button 'Save'
58
- end
59
- expect(page).to have_content 'The contact was created.'
60
- expect(page).to have_selector 'img.contact-photo'
61
- expect(Spotlight::Contact.last.avatar.iiif_url).to be_present
62
- end
63
- end
@@ -1,88 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'Adding custom metadata field data', type: :feature do
4
- let(:exhibit) { FactoryBot.create(:exhibit) }
5
- let(:admin) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
6
- let(:custom_field) { FactoryBot.create(:custom_field, exhibit: exhibit) }
7
- let(:config) { exhibit.blacklight_configuration }
8
-
9
- before do
10
- login_as(admin)
11
- config.index_fields[custom_field.field] = { enabled: true, show: true, 'label' => 'Some Field' }
12
- config.save!
13
- end
14
-
15
- it 'works' do
16
- visit spotlight.exhibit_solr_document_path(exhibit, 'dq287tq6352')
17
-
18
- expect(page).to have_link 'Edit'
19
-
20
- click_on 'Edit'
21
-
22
- fill_in 'Some Field', with: 'My new custom field value'
23
-
24
- click_on 'Save changes'
25
-
26
- expect(::SolrDocument.new(id: 'dq287tq6352').sidecar(exhibit).data).to include 'some-field' => 'My new custom field value'
27
- sleep(1) # The data isn't commited to solr immediately.
28
-
29
- visit spotlight.exhibit_solr_document_path(exhibit, 'dq287tq6352')
30
- expect(page).to have_content 'Some Field'
31
- expect(page).to have_content 'My new custom field value'
32
- end
33
-
34
- context 'when given a read-only field' do
35
- let(:custom_field) { FactoryBot.create(:custom_field, exhibit: exhibit, readonly_field: true) }
36
-
37
- it 'can not be edited' do
38
- visit spotlight.exhibit_solr_document_path(exhibit, 'dq287tq6352')
39
-
40
- expect(page).to have_link 'Edit'
41
-
42
- click_on 'Edit'
43
-
44
- expect(page).to have_selector 'textarea[readonly]'
45
- end
46
- end
47
-
48
- context 'with a multivalued field', js: true do
49
- let(:custom_field) { FactoryBot.create(:custom_field, exhibit: exhibit, is_multiple: true) }
50
-
51
- it 'can add multiple values' do
52
- visit spotlight.exhibit_solr_document_path(exhibit, 'dq287tq6352')
53
-
54
- expect(page).to have_link 'Edit'
55
-
56
- click_on 'Edit'
57
- fill_in 'Some Field', with: 'value 1'
58
- click_on 'Add another'
59
- fill_in 'solr_document_sidecar_data_some-field_2', with: 'value 2'
60
-
61
- click_on 'Save changes'
62
-
63
- expect(::SolrDocument.new(id: 'dq287tq6352').sidecar(exhibit).data).to include 'some-field' => ['value 1', 'value 2']
64
- end
65
- end
66
-
67
- it 'has a public toggle' do
68
- visit spotlight.exhibit_solr_document_path(exhibit, 'dq287tq6352')
69
-
70
- expect(page).not_to have_selector '.blacklight-private'
71
-
72
- click_on 'Edit'
73
-
74
- uncheck 'Public'
75
-
76
- click_on 'Save changes'
77
-
78
- expect(page).to have_selector '.blacklight-private'
79
-
80
- click_on 'Edit'
81
-
82
- check 'Public'
83
-
84
- click_on 'Save changes'
85
-
86
- expect(page).not_to have_selector '.blacklight-private'
87
- end
88
- end
@@ -1,46 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'spec_helper'
4
-
5
- describe 'adding IIIF Manifest', type: :feature do
6
- let(:exhibit) { FactoryBot.create(:exhibit) }
7
- let(:curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
8
-
9
- before { login_as curator }
10
-
11
- it 'has form to add IIIF Manifests' do
12
- visit spotlight.admin_exhibit_catalog_path(exhibit)
13
- click_link 'Add items'
14
-
15
- expect(page).to have_link('IIIF URL') # tab name
16
- expect(page).to have_css("input[id='resource_url'][type='text']")
17
- expect(page).to have_content 'Add the URL of a IIIF manifest or collection'
18
- expect(page).to have_button 'Add IIIF items'
19
- end
20
-
21
- it 'submits the form to create a new item' do
22
- expect_any_instance_of(Spotlight::Resource).to receive(:reindex_later).and_return(true)
23
- url = 'https://purl.stanford.edu/vw754mr2281/iiif/manifest'
24
- stub_request(:head, url).to_return(status: 200, headers: { 'Content-Type' => 'application/json' })
25
- visit spotlight.admin_exhibit_catalog_path(exhibit)
26
-
27
- click_link 'Add items'
28
- fill_in 'URL', with: url
29
-
30
- click_button 'Add IIIF items'
31
-
32
- expect(Spotlight::Resource.last.url).to eq url
33
- end
34
-
35
- it 'returns an error message if the URL returned in not a IIIF endpoint' do
36
- visit spotlight.admin_exhibit_catalog_path(exhibit)
37
- stub_request(:head, 'http://example.com').to_return(status: 200, headers: { 'Content-Type' => 'text/html' })
38
-
39
- click_link 'Add items'
40
- fill_in 'URL', with: 'http://example.com'
41
-
42
- click_button 'Add IIIF items'
43
-
44
- expect(page).to have_css('.alert', text: 'Invalid IIIF URL')
45
- end
46
- end
@@ -1,135 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'Uploading a non-repository item', type: :feature do
4
- include ActiveJob::TestHelper
5
-
6
- let!(:exhibit) { FactoryBot.create(:exhibit) }
7
- let!(:custom_field) { FactoryBot.create(:custom_field, exhibit: exhibit, field_type: :vocab) }
8
- let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
9
- let(:user) { exhibit_curator }
10
-
11
- before { login_as user }
12
-
13
- describe 'forms' do
14
- it 'displays the single item upload form' do
15
- visit spotlight.new_exhibit_resource_path(exhibit)
16
- expect(page).to have_css('h1', text: /Curation/)
17
- expect(page).to have_css 'h1 small', text: 'Add items'
18
-
19
- click_link 'Upload item'
20
-
21
- within('form#new_resources_upload') do
22
- expect(page).to have_css('#resources_upload_url[type="file"]')
23
- expect(page).to have_css('.form-text', text: 'Valid file types: jpg jpeg png')
24
- expect(page).to have_css('#resources_upload_data_full_title_tesim[type="text"]')
25
- expect(page).to have_css('textarea#resources_upload_data_spotlight_upload_description_tesim')
26
- expect(page).to have_css('#resources_upload_data_spotlight_upload_attribution_tesim[type="text"]')
27
- expect(page).to have_css('#resources_upload_data_spotlight_upload_date_tesim[type="text"]')
28
- expect(page).to have_css("#f0_resources_upload_data_#{custom_field.slug}[type='text']")
29
- end
30
- end
31
-
32
- it 'creates a new item' do
33
- visit spotlight.new_exhibit_resource_path(exhibit)
34
-
35
- click_link 'Upload item'
36
-
37
- attach_file('resources_upload_url', File.join(FIXTURES_PATH, '800x600.png'))
38
- fill_in 'Title', with: '800x600'
39
-
40
- within '#new_resources_upload' do
41
- click_button 'Add item'
42
- end
43
- expect(page).to have_content 'Object uploaded successfully.'
44
-
45
- expect(Spotlight::Resource.last.upload.image.file.path).to end_with '800x600.png'
46
- ensure
47
- Blacklight.default_index.connection.delete_by_query 'spotlight_resource_type_ssim:spotlight/resources/uploads'
48
- Blacklight.default_index.connection.commit
49
- end
50
-
51
- it 'creates a new item event without an attached file' do
52
- visit spotlight.new_exhibit_resource_path(exhibit)
53
-
54
- click_link 'Upload item'
55
-
56
- fill_in 'Title', with: 'no-image'
57
-
58
- within '#new_resources_upload' do
59
- click_button 'Add item'
60
- end
61
- expect(page).to have_content 'Object uploaded successfully.'
62
- expect(Spotlight::Resource.last.data['full_title_tesim']).to eq 'no-image'
63
- ensure
64
- Blacklight.default_index.connection.delete_by_query 'spotlight_resource_type_ssim:spotlight/resources/uploads'
65
- Blacklight.default_index.connection.commit
66
- end
67
-
68
- it 'displays the multi-item CSV upload form' do
69
- visit spotlight.new_exhibit_resource_path(exhibit)
70
- expect(page).to have_css('h1', text: /Curation/)
71
- expect(page).to have_css 'h1 small', text: 'Add items'
72
-
73
- click_link 'Upload multiple items'
74
-
75
- within('form#new_resources_csv_upload') do
76
- expect(page).to have_css('#resources_csv_upload_url[type="file"]')
77
- expect(page).to have_css('.form-text a', text: 'Download template')
78
- end
79
- end
80
-
81
- it 'does not display the raw documents upload form' do
82
- visit spotlight.new_exhibit_resource_path(exhibit)
83
- click_link 'Upload raw documents'
84
- expect(page).not_to have_css('form#new_resources_json_upload')
85
- end
86
-
87
- context 'as an site administrator' do
88
- let(:user) { FactoryBot.create(:site_admin) }
89
-
90
- it 'displays the JSON upload form' do
91
- visit spotlight.new_exhibit_resource_path(exhibit)
92
-
93
- click_link 'Upload raw documents'
94
-
95
- within('form#new_resources_json_upload') do
96
- expect(page).to have_css('#resources_json_upload_json[type="file"]')
97
- end
98
- end
99
- end
100
- end
101
-
102
- describe 'upload' do
103
- it 'is editable' do
104
- visit spotlight.new_exhibit_resource_path(exhibit)
105
-
106
- click_link 'Upload item'
107
-
108
- attach_file('resources_upload_url', File.join(FIXTURES_PATH, '800x600.png'))
109
- fill_in 'Title', with: '800x600'
110
-
111
- perform_enqueued_jobs do
112
- within '#new_resources_upload' do
113
- click_button 'Add item'
114
- end
115
- end
116
-
117
- Blacklight.default_index.connection.commit
118
- visit current_path
119
-
120
- click_link '800x600'
121
- click_link 'Edit'
122
- fill_in 'Title', with: 'This is a now an avatar'
123
-
124
- attach_file('File', File.join(FIXTURES_PATH, 'avatar.png'))
125
-
126
- click_button 'Save'
127
-
128
- expect(page).to have_content 'This is a now an avatar'
129
- expect(Spotlight::Resource.last.upload.image.path).to end_with 'avatar.png'
130
- ensure
131
- Blacklight.default_index.connection.delete_by_query 'spotlight_resource_type_ssim:spotlight/resources/uploads'
132
- Blacklight.default_index.connection.commit
133
- end
134
- end
135
- end
@@ -1,88 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'Autocomplete typeahead', type: :feature, js: true do
4
- let(:exhibit) { FactoryBot.create(:exhibit) }
5
- let(:admin) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
6
-
7
- before { login_as admin }
8
-
9
- describe 'IIIF Integration' do
10
- context 'for items that include a IIIF manifest' do
11
- it 'instantiates a cropper and persists all levels of the IIIF manifest' do
12
- visit spotlight.edit_exhibit_appearance_path(exhibit)
13
- click_link 'Exhibit masthead'
14
-
15
- expect(page).not_to have_css('.leaflet-container')
16
-
17
- check 'Show background image in masthead'
18
-
19
- fill_in_typeahead_field(with: 'gk446cj2442', type: 'featured-image')
20
-
21
- expect(page).to have_css('.leaflet-container', visible: true)
22
-
23
- click_button 'Save changes'
24
-
25
- featured_image = Spotlight::FeaturedImage.last
26
-
27
- expect(featured_image.iiif_manifest_url).to eq 'https://purl.stanford.edu/gk446cj2442/iiif/manifest.json'
28
- expect(featured_image.iiif_canvas_id).to eq 'https://purl.stanford.edu/gk446cj2442/iiif/canvas/gk446cj2442_1'
29
- expect(featured_image.iiif_image_id).to eq 'https://purl.stanford.edu/gk446cj2442/iiif/annotation/gk446cj2442_1'
30
- expect(featured_image.iiif_tilesource).to eq 'https://stacks.stanford.edu/image/iiif/gk446cj2442%2Fgk446cj2442_05_0001/info.json'
31
- end
32
-
33
- it 'instantiates the multi-image selector when an multi-image item is chosen in the typeahead (and again on edit)' do
34
- allow(Spotlight::Engine.config).to receive(:exhibit_themes).and_return(['default'])
35
-
36
- visit spotlight.edit_exhibit_appearance_path(exhibit)
37
-
38
- check 'Show background image in masthead'
39
-
40
- fill_in_typeahead_field(with: 'xd327cm9378', type: 'featured-image')
41
- sleep 1 # HACK: that seems to mysteriously work.
42
-
43
- expect(page).to have_css('[data-panel-image-pagination]', text: /Image 1 of 2/, visible: true)
44
-
45
- # Open the multi-image selector and choose the last one
46
- click_link('Change')
47
- find('.thumbs-list li:last-child').click
48
- expect(page).to have_css('.leaflet-container', visible: true)
49
-
50
- click_button 'Save changes'
51
-
52
- expect(page).to have_content('The exhibit was successfully updated.')
53
-
54
- expect(page).to have_css('[data-panel-image-pagination]', text: /Image 2 of 2/, visible: true)
55
- end
56
-
57
- it 'removes the multi-image selector when a non multi-image item is selected' do
58
- visit spotlight.edit_exhibit_appearance_path(exhibit)
59
- click_link 'Exhibit masthead'
60
-
61
- fill_in_typeahead_field(with: 'xd327cm9378', type: 'featured-image')
62
-
63
- expect(page).to have_css('[data-panel-image-pagination]', text: /Image 1 of 2/, visible: true)
64
-
65
- fill_in_typeahead_field(with: 'gk446cj2442', type: 'featured-image')
66
-
67
- expect(page).not_to have_css('[data-panel-image-pagination]', text: /Image 1 of 2/)
68
- end
69
- end
70
-
71
- context 'for items that do not include a IIIF manifest' do
72
- before do
73
- allow(Spotlight::Engine.config).to receive(:iiif_manifest_field).and_return('not_a_real_field')
74
- end
75
-
76
- it 'provides an alert informing the user that they cannot crop from that item' do
77
- visit spotlight.edit_exhibit_appearance_path(exhibit)
78
- click_link 'Exhibit masthead'
79
-
80
- expect(page).not_to have_css('[data-behavior="non-iiif-alert"]', visible: true)
81
-
82
- fill_in_typeahead_field(with: 'gk446cj2442', type: 'featured-image')
83
-
84
- expect(page).to have_css('[data-behavior="non-iiif-alert"]', visible: true)
85
- end
86
- end
87
- end
88
- end
@@ -1,163 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'Browse Category Administration', type: :feature do
4
- let(:exhibit) { FactoryBot.create(:exhibit) }
5
- let(:curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
6
- let!(:search) { FactoryBot.create(:search, exhibit: exhibit, query_params: { f: { 'genre_ssim' => ['Value'] } }) }
7
-
8
- before { login_as curator }
9
-
10
- describe 'index' do
11
- it 'has searches' do
12
- visit spotlight.exhibit_searches_path(exhibit)
13
- expect(page).to have_css('.card-title', text: search.title)
14
- end
15
- end
16
-
17
- describe 'create' do
18
- it 'creates a new browse category with the current search parameters', js: true do
19
- visit spotlight.search_exhibit_catalog_path(exhibit, q: 'xyz')
20
- click_button 'Save this search'
21
- expect(page).to have_css('#save-modal')
22
- fill_in 'search_title', with: 'Some search'
23
- expect do
24
- find('input[name="commit"]').click
25
- exhibit.searches.reload
26
- end.to change { exhibit.searches.count }.by 1
27
- expect(exhibit.searches.last.query_params).to eq 'q' => 'xyz'
28
- end
29
-
30
- it 'updates an existing browse category with the current search parameters', js: true do
31
- visit spotlight.search_exhibit_catalog_path(exhibit, q: 'xyz')
32
- click_button 'Save this search'
33
- expect(page).to have_css('#save-modal')
34
- select search.title, from: 'id'
35
- find('input[name="commit"]').click
36
- expect(search.reload.query_params).to eq 'q' => 'xyz'
37
- end
38
- end
39
-
40
- describe 'edit' do
41
- it 'displays an edit form' do
42
- visit spotlight.edit_exhibit_search_path(exhibit, search)
43
- expect(page).to have_css('h1 small', text: 'Edit browse category')
44
- expect(find_field('search_title').value).to eq search.title
45
- within '.appliedParams' do
46
- expect(page).to have_content 'Genre'
47
- expect(page).to have_content 'Value'
48
- end
49
- end
50
-
51
- describe 'with a group present' do
52
- let!(:group) { FactoryBot.create(:group, exhibit: exhibit, title: 'Good group') }
53
-
54
- it 'enables group selection' do
55
- visit spotlight.edit_exhibit_search_path(exhibit, search)
56
- click_link 'Group'
57
- expect(page).to have_content 'You can add this browse category'
58
-
59
- within '#search-group' do
60
- expect(find('input[type="checkbox"]')).not_to be_checked
61
- check 'Good group'
62
- end
63
-
64
- click_button 'Save changes'
65
- expect(page).to have_content('The browse category was successfully updated.')
66
- visit spotlight.edit_exhibit_search_path(exhibit, search)
67
- click_link 'Group'
68
-
69
- within '#search-group' do
70
- expect(find('input[type="checkbox"]')).to be_checked
71
- end
72
- end
73
- end
74
-
75
- describe 'without a group present' do
76
- it 'displays no group help text' do
77
- visit spotlight.edit_exhibit_search_path(exhibit, search)
78
- click_link 'Group'
79
- expect(page).to have_content 'You cannot add this browse category'
80
- end
81
- end
82
-
83
- it 'attaches a masthead image' do
84
- visit spotlight.edit_exhibit_search_path exhibit, search
85
-
86
- click_link 'Masthead'
87
-
88
- within '#search-masthead' do
89
- choose 'Upload an image'
90
- # attach_file('search_masthead_attributes_file', File.absolute_path(File.join(FIXTURES_PATH, 'avatar.png')))
91
- # The JS fills in these fields:
92
- find('#search_masthead_attributes_iiif_tilesource', visible: false).set 'http://test.host/images/7'
93
- find('#search_masthead_attributes_iiif_region', visible: false).set '0,0,100,200'
94
- end
95
-
96
- click_button 'Save changes'
97
-
98
- expect(page).to have_content('The browse category was successfully updated.')
99
-
100
- search.reload
101
-
102
- expect(search.masthead).not_to be nil
103
- expect(search.masthead.iiif_url).to eq 'http://test.host/images/7/0,0,100,200/1800,180/0/default.jpg'
104
- end
105
-
106
- it 'attaches a thumbnail image' do
107
- visit spotlight.edit_exhibit_search_path exhibit, search
108
-
109
- click_link 'Thumbnail'
110
-
111
- within '#search-thumbnail' do
112
- choose 'Upload an image'
113
- attach_file('search_thumbnail_attributes_file', File.absolute_path(File.join(FIXTURES_PATH, 'avatar.png')))
114
- end
115
-
116
- click_button 'Save changes'
117
-
118
- expect(page).to have_content('The browse category was successfully updated.')
119
-
120
- search.reload
121
-
122
- expect(search.thumbnail).not_to be nil
123
- end
124
-
125
- it 'can configure a search box' do
126
- visit spotlight.edit_exhibit_search_path exhibit, search
127
- expect(search.search_box).to eq false
128
-
129
- check 'Search box'
130
-
131
- click_button 'Save changes'
132
- expect(page).to have_content('The browse category was successfully updated.')
133
- search.reload
134
-
135
- expect(search.search_box).to eq true
136
- end
137
-
138
- it 'can select a default index view type' do
139
- visit spotlight.edit_exhibit_search_path exhibit, search
140
- choose 'List'
141
-
142
- click_button 'Save changes'
143
-
144
- expect(page).to have_content('The browse category was successfully updated.')
145
-
146
- search.reload
147
-
148
- expect(search.default_index_view_type).to eq 'list'
149
- end
150
- end
151
-
152
- describe 'destroy' do
153
- it 'destroys a tag' do
154
- skip('TODO: Allow searches to be destroyed without javascript')
155
- visit spotlight.exhibit_searches_path(exhibit)
156
- within('.card .search') do
157
- click_link('Delete')
158
- end
159
- expect(page).to have_content('Search was deleted')
160
- expect(page).not_to have_content(search.title)
161
- end
162
- end
163
- end
@@ -1,44 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'Browse pages' do
4
- let(:exhibit) { FactoryBot.create(:exhibit) }
5
- let!(:search) { FactoryBot.create(:search, title: 'Some Saved Search', exhibit: exhibit, published: true) }
6
- let!(:search_2) { FactoryBot.create(:search, title: 'Some Other Saved Search', exhibit: exhibit, published: true) }
7
- let!(:group) { FactoryBot.create(:group, title: 'Awesome group', exhibit: exhibit, published: true, searches: [search]) }
8
-
9
- describe 'landing page' do
10
- before do
11
- visit spotlight.exhibit_browse_index_path(exhibit)
12
- end
13
-
14
- it 'displays all categories and tabs for each group' do
15
- within '.browse-group-navigation' do
16
- expect(page).to have_css 'li.nav-item a.nav-link.active', text: 'All'
17
- expect(page).to have_css 'li.nav-item a.nav-link', count: exhibit.groups.count + 1
18
- end
19
- within '.browse-landing' do
20
- expect(page).to have_css '.category', count: 2
21
- end
22
- end
23
-
24
- it 'filters browse categories when navigated' do
25
- within '.browse-group-navigation' do
26
- click_link group.title
27
- expect(page).to have_css 'li.nav-item a.nav-link.active', text: group.title
28
- end
29
- within '.browse-landing' do
30
- expect(page).to have_css '.category', count: 1
31
- end
32
- end
33
-
34
- it 'clicking through from the context of a category provides the breadcrums' do
35
- within '.browse-group-navigation' do
36
- click_link group.title
37
- expect(page).to have_css 'li.nav-item a.nav-link.active', text: group.title
38
- end
39
- click_link 'Some Saved Search'
40
- expect(page).to have_css 'ul.breadcrumb li.breadcrumb-item', count: 4
41
- expect(page).to have_css 'li.breadcrumb-item', text: 'Awesome group'
42
- end
43
- end
44
- end