blacklight-spotlight 3.0.0.alpha.2 → 3.0.0.alpha.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (350) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +4 -4
  3. data/app/assets/javascripts/spotlight/admin/appearance.js +3 -3
  4. data/app/assets/javascripts/spotlight/admin/blocks/resources_block.js +18 -16
  5. data/app/assets/javascripts/spotlight/admin/blocks/uploaded_items_block.js +19 -20
  6. data/app/assets/javascripts/spotlight/admin/exhibits.js +6 -1
  7. data/app/assets/javascripts/spotlight/admin/multi_image_selector.js +1 -1
  8. data/app/assets/javascripts/spotlight/admin/search_typeahead.js +1 -1
  9. data/app/assets/javascripts/spotlight/admin/sir-trevor/locales.js +1 -1
  10. data/app/assets/javascripts/spotlight/admin/spotlight_nestable.js +6 -1
  11. data/app/assets/javascripts/spotlight/admin/tabs.js +2 -2
  12. data/app/assets/stylesheets/spotlight/_blacklight_configuration.scss +1 -35
  13. data/app/assets/stylesheets/spotlight/_bootstrap_overrides.scss +17 -10
  14. data/app/assets/stylesheets/spotlight/_browse.scss +11 -18
  15. data/app/assets/stylesheets/spotlight/_catalog.scss +13 -4
  16. data/app/assets/stylesheets/spotlight/_curation.scss +21 -14
  17. data/app/assets/stylesheets/spotlight/_exhibit_navbar.scss +10 -0
  18. data/app/assets/stylesheets/spotlight/_exhibits_index.scss +4 -48
  19. data/app/assets/stylesheets/spotlight/_header.scss +3 -1
  20. data/app/assets/stylesheets/spotlight/_item_text_block.scss +3 -3
  21. data/app/assets/stylesheets/spotlight/_multi_image_selector.scss +6 -7
  22. data/app/assets/stylesheets/spotlight/_nestable.scss +12 -1
  23. data/app/assets/stylesheets/spotlight/_pages.scss +7 -19
  24. data/app/assets/stylesheets/spotlight/_spotlight.scss +1 -0
  25. data/app/assets/stylesheets/spotlight/_translations.scss +5 -0
  26. data/app/controllers/concerns/spotlight/base.rb +2 -2
  27. data/app/controllers/concerns/spotlight/controller.rb +2 -2
  28. data/app/controllers/concerns/spotlight/search_helper.rb +2 -0
  29. data/app/controllers/spotlight/about_pages_controller.rb +1 -1
  30. data/app/controllers/spotlight/appearances_controller.rb +9 -9
  31. data/app/controllers/spotlight/browse_controller.rb +1 -1
  32. data/app/controllers/spotlight/catalog_controller.rb +5 -9
  33. data/app/controllers/spotlight/concerns/application_controller.rb +3 -3
  34. data/app/controllers/spotlight/contacts_controller.rb +1 -1
  35. data/app/controllers/spotlight/custom_fields_controller.rb +1 -1
  36. data/app/controllers/spotlight/custom_search_fields_controller.rb +1 -1
  37. data/app/controllers/spotlight/exhibits_controller.rb +4 -4
  38. data/app/controllers/spotlight/feature_pages_controller.rb +3 -5
  39. data/app/controllers/spotlight/filters_controller.rb +1 -3
  40. data/app/controllers/spotlight/home_pages_controller.rb +1 -1
  41. data/app/controllers/spotlight/metadata_configurations_controller.rb +1 -1
  42. data/app/controllers/spotlight/pages_controller.rb +7 -7
  43. data/app/controllers/spotlight/resources/upload_controller.rb +1 -1
  44. data/app/controllers/spotlight/resources_controller.rb +1 -1
  45. data/app/controllers/spotlight/roles_controller.rb +1 -1
  46. data/app/controllers/spotlight/search_configurations_controller.rb +3 -3
  47. data/app/controllers/spotlight/searches_controller.rb +12 -12
  48. data/app/controllers/spotlight/sites_controller.rb +5 -5
  49. data/app/controllers/spotlight/translations_controller.rb +1 -1
  50. data/app/helpers/spotlight/application_helper.rb +3 -3
  51. data/app/helpers/spotlight/main_app_helpers.rb +6 -6
  52. data/app/helpers/spotlight/masthead_helper.rb +19 -0
  53. data/app/helpers/spotlight/search_configurations_helper.rb +9 -7
  54. data/app/helpers/spotlight/searches_helper.rb +1 -1
  55. data/app/jobs/spotlight/add_uploads_from_csv.rb +0 -1
  56. data/app/jobs/spotlight/reindex_job.rb +4 -4
  57. data/app/models/concerns/spotlight/access_controls_enforcement_search_builder.rb +1 -1
  58. data/app/models/concerns/spotlight/exhibit_analytics.rb +2 -2
  59. data/app/models/concerns/spotlight/solr_document.rb +5 -1
  60. data/app/models/concerns/spotlight/solr_document/uploaded_resource.rb +2 -2
  61. data/app/models/spotlight/ability.rb +2 -2
  62. data/app/models/spotlight/about_page.rb +1 -1
  63. data/app/models/spotlight/analytics/ga.rb +1 -1
  64. data/app/models/spotlight/blacklight_configuration.rb +20 -18
  65. data/app/models/spotlight/contact.rb +1 -1
  66. data/app/models/spotlight/custom_field.rb +7 -7
  67. data/app/models/spotlight/exhibit.rb +11 -2
  68. data/app/models/spotlight/feature_page.rb +1 -1
  69. data/app/models/spotlight/featured_image.rb +1 -4
  70. data/app/models/spotlight/home_page.rb +1 -1
  71. data/app/models/spotlight/page.rb +2 -2
  72. data/app/models/spotlight/reindexing_log_entry.rb +3 -3
  73. data/app/models/spotlight/resource.rb +3 -5
  74. data/app/models/spotlight/resources/iiif_manifest.rb +1 -1
  75. data/app/models/spotlight/resources/upload.rb +0 -1
  76. data/app/models/spotlight/role.rb +1 -1
  77. data/app/models/spotlight/search.rb +3 -3
  78. data/app/serializers/spotlight/exhibit_export_serializer.rb +10 -10
  79. data/app/serializers/spotlight/featured_image_representer.rb +1 -1
  80. data/app/serializers/spotlight/main_navigation_representer.rb +1 -1
  81. data/app/serializers/spotlight/page_representer.rb +1 -1
  82. data/app/uploaders/spotlight/attachment_uploader.rb +0 -1
  83. data/app/views/catalog/_image_default.html.erb +3 -3
  84. data/app/views/catalog/_save_search.html.erb +2 -2
  85. data/app/views/layouts/spotlight/spotlight.html.erb +2 -2
  86. data/app/views/shared/_breadcrumbs.html.erb +1 -1
  87. data/app/views/shared/_exhibit_navbar.html.erb +3 -3
  88. data/app/views/shared/_header_navbar.html.erb +1 -1
  89. data/app/views/shared/_masthead.html.erb +12 -15
  90. data/app/views/spotlight/about_pages/_contact.html.erb +12 -12
  91. data/app/views/spotlight/about_pages/_contact_properties.html.erb +16 -12
  92. data/app/views/spotlight/about_pages/_contacts.html.erb +1 -1
  93. data/app/views/spotlight/about_pages/_contacts_form.html.erb +2 -2
  94. data/app/views/spotlight/about_pages/_sidebar.html.erb +1 -1
  95. data/app/views/spotlight/appearances/edit.html.erb +27 -31
  96. data/app/views/spotlight/browse/_search.html.erb +1 -1
  97. data/app/views/spotlight/browse/_search_box.html.erb +2 -2
  98. data/app/views/spotlight/browse/_sort_and_per_page.html.erb +1 -1
  99. data/app/views/spotlight/browse/index.html.erb +3 -2
  100. data/app/views/spotlight/catalog/_admin_thumbnail_default.html.erb +1 -1
  101. data/app/views/spotlight/catalog/_document_admin_table.html.erb +1 -1
  102. data/app/views/spotlight/contacts/_form.html.erb +2 -2
  103. data/app/views/spotlight/custom_fields/form_group/_text.html.erb +15 -6
  104. data/app/views/spotlight/custom_fields/form_group/_vocab.html.erb +15 -6
  105. data/app/views/spotlight/custom_search_fields/edit.html.erb +5 -5
  106. data/app/views/spotlight/custom_search_fields/new.html.erb +5 -5
  107. data/app/views/spotlight/dashboards/_analytics.html.erb +1 -1
  108. data/app/views/spotlight/dashboards/_page_activity.html.erb +1 -1
  109. data/app/views/spotlight/dashboards/_reindexing_activity.html.erb +1 -1
  110. data/app/views/spotlight/dashboards/_solr_document_activity.html.erb +1 -1
  111. data/app/views/spotlight/exhibits/_contact.html.erb +1 -1
  112. data/app/views/spotlight/exhibits/_delete.html.erb +2 -2
  113. data/app/views/spotlight/exhibits/_exhibit_card.html.erb +2 -2
  114. data/app/views/spotlight/exhibits/_exhibit_card_back.html.erb +21 -19
  115. data/app/views/spotlight/exhibits/_exhibit_card_front.html.erb +5 -3
  116. data/app/views/spotlight/exhibits/_exhibits.html.erb +3 -5
  117. data/app/views/spotlight/exhibits/_form.html.erb +3 -3
  118. data/app/views/spotlight/exhibits/_languages.html.erb +6 -4
  119. data/app/views/spotlight/feature_pages/_header.html.erb +5 -5
  120. data/app/views/spotlight/feature_pages/_sidebar.html.erb +1 -1
  121. data/app/views/spotlight/featured_images/_form.html.erb +2 -2
  122. data/app/views/spotlight/featured_images/_upload_form.html.erb +2 -2
  123. data/app/views/spotlight/home_pages/_edit_page_link.html.erb +1 -1
  124. data/app/views/spotlight/metadata_configurations/edit.html.erb +2 -2
  125. data/app/views/spotlight/pages/_order_pages.html.erb +1 -1
  126. data/app/views/spotlight/pages/_page.html.erb +23 -23
  127. data/app/views/spotlight/pages/_view_type_group.html.erb +1 -1
  128. data/app/views/spotlight/resources/_external_resources_form.html.erb +10 -2
  129. data/app/views/spotlight/resources/new.html.erb +2 -2
  130. data/app/views/spotlight/resources/upload/_form.html.erb +1 -1
  131. data/app/views/spotlight/roles/index.html.erb +2 -6
  132. data/app/views/spotlight/search_configurations/_default_per_page.html.erb +1 -1
  133. data/app/views/spotlight/search_configurations/_document_index_view_types.html.erb +1 -1
  134. data/app/views/spotlight/search_configurations/_facets.html.erb +22 -22
  135. data/app/views/spotlight/search_configurations/_search_fields.html.erb +11 -15
  136. data/app/views/spotlight/search_configurations/_sort.html.erb +19 -19
  137. data/app/views/spotlight/searches/_form.html.erb +3 -3
  138. data/app/views/spotlight/searches/_search.html.erb +24 -24
  139. data/app/views/spotlight/searches/index.html.erb +1 -1
  140. data/app/views/spotlight/shared/_configuration_sidebar.html.erb +2 -1
  141. data/app/views/spotlight/shared/_curation_sidebar.html.erb +1 -1
  142. data/app/views/spotlight/shared/_exhibit_sidebar.html.erb +1 -0
  143. data/app/views/spotlight/sir_trevor/blocks/_oembed_block.html.erb +3 -3
  144. data/app/views/spotlight/sir_trevor/blocks/_search_results_block.html.erb +1 -2
  145. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb +6 -6
  146. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb +3 -3
  147. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb +15 -7
  148. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb +3 -3
  149. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb +7 -6
  150. data/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb +4 -4
  151. data/config/locales/spotlight.en.yml +13 -5
  152. data/config/locales/spotlight.es.yml +40 -0
  153. data/config/locales/spotlight.pt-BR.yml +25 -0
  154. data/config/routes.rb +14 -14
  155. data/lib/generators/spotlight/install_generator.rb +1 -1
  156. data/lib/generators/spotlight/scaffold_resource_generator.rb +1 -1
  157. data/lib/generators/spotlight/templates/config/initializers/translation.rb +5 -5
  158. data/lib/spotlight/engine.rb +12 -11
  159. data/lib/spotlight/version.rb +1 -1
  160. data/lib/tasks/spotlight_tasks.rake +2 -2
  161. data/spec/controllers/application_controller_spec.rb +1 -0
  162. data/spec/controllers/spotlight/about_pages_controller_spec.rb +10 -0
  163. data/spec/controllers/spotlight/admin_users_controller_spec.rb +4 -0
  164. data/spec/controllers/spotlight/appearances_controller_spec.rb +2 -0
  165. data/spec/controllers/spotlight/application_controller_spec.rb +1 -0
  166. data/spec/controllers/spotlight/attachments_controller_spec.rb +2 -0
  167. data/spec/controllers/spotlight/browse_controller_spec.rb +5 -4
  168. data/spec/controllers/spotlight/catalog_controller_spec.rb +18 -4
  169. data/spec/controllers/spotlight/confirmations_controller_spec.rb +1 -0
  170. data/spec/controllers/spotlight/contact_forms_controller_spec.rb +2 -0
  171. data/spec/controllers/spotlight/contacts_controller_spec.rb +3 -0
  172. data/spec/controllers/spotlight/custom_fields_controller_spec.rb +2 -0
  173. data/spec/controllers/spotlight/custom_search_fields_controller_spec.rb +2 -0
  174. data/spec/controllers/spotlight/dashboards_controller_spec.rb +1 -0
  175. data/spec/controllers/spotlight/exhibits_controller_spec.rb +4 -2
  176. data/spec/controllers/spotlight/feature_pages_controller_spec.rb +13 -1
  177. data/spec/controllers/spotlight/featured_images_controller_spec.rb +1 -0
  178. data/spec/controllers/spotlight/home_pages_controller_spec.rb +5 -2
  179. data/spec/controllers/spotlight/metadata_configurations_controller_spec.rb +2 -1
  180. data/spec/controllers/spotlight/pages_controller_spec.rb +2 -0
  181. data/spec/controllers/spotlight/resources/csv_upload_controller_spec.rb +4 -0
  182. data/spec/controllers/spotlight/resources/upload_controller_spec.rb +1 -0
  183. data/spec/controllers/spotlight/resources_controller_spec.rb +2 -0
  184. data/spec/controllers/spotlight/roles_controller_spec.rb +1 -0
  185. data/spec/controllers/spotlight/search_configurations_controller_spec.rb +2 -1
  186. data/spec/controllers/spotlight/searches_controller_spec.rb +4 -0
  187. data/spec/controllers/spotlight/sites_controller_spec.rb +1 -0
  188. data/spec/controllers/spotlight/tags_controller_spec.rb +1 -0
  189. data/spec/controllers/spotlight/translations_controller_spec.rb +2 -0
  190. data/spec/controllers/spotlight/versions_controller_spec.rb +2 -0
  191. data/spec/controllers/spotlight/view_configurations_controller_spec.rb +2 -1
  192. data/spec/examples.txt +1382 -50
  193. data/spec/factories/contact_emails.rb +1 -1
  194. data/spec/factories/contact_images.rb +1 -1
  195. data/spec/factories/contacts.rb +1 -1
  196. data/spec/factories/custom_fields.rb +1 -1
  197. data/spec/factories/custom_search_fields.rb +1 -1
  198. data/spec/factories/exhibit_thumbnails.rb +1 -1
  199. data/spec/factories/exhibits.rb +1 -1
  200. data/spec/factories/featured_images.rb +2 -2
  201. data/spec/factories/language.rb +1 -1
  202. data/spec/factories/main_navigation.rb +1 -1
  203. data/spec/factories/reindexing_log_entries.rb +6 -6
  204. data/spec/factories/resources.rb +2 -2
  205. data/spec/factories/roles.rb +1 -1
  206. data/spec/factories/searches.rb +2 -2
  207. data/spec/factories/tags.rb +2 -2
  208. data/spec/features/about_page_spec.rb +1 -0
  209. data/spec/features/add_contacts_spec.rb +2 -1
  210. data/spec/features/add_custom_field_metadata_spec.rb +3 -0
  211. data/spec/features/add_iiif_manifest_spec.rb +1 -0
  212. data/spec/features/add_items_spec.rb +1 -0
  213. data/spec/features/browse_category_admin_spec.rb +3 -1
  214. data/spec/features/browse_category_spec.rb +4 -1
  215. data/spec/features/catalog_spec.rb +1 -0
  216. data/spec/features/create_exhibit_spec.rb +1 -0
  217. data/spec/features/create_page_spec.rb +1 -0
  218. data/spec/features/edit_contact_spec.rb +1 -0
  219. data/spec/features/edit_search_fields_spec.rb +4 -3
  220. data/spec/features/exhibit_masthead_spec.rb +4 -4
  221. data/spec/features/exhibits/administration_spec.rb +11 -2
  222. data/spec/features/exhibits/edit_metadata_fields_spec.rb +3 -2
  223. data/spec/features/exhibits/language_create_edit_spec.rb +1 -0
  224. data/spec/features/exhibits/translation_editing_spec.rb +5 -3
  225. data/spec/features/exhibits_index_spec.rb +2 -2
  226. data/spec/features/feature_page_spec.rb +6 -2
  227. data/spec/features/home_page_spec.rb +3 -1
  228. data/spec/features/import_exhibit_spec.rb +1 -0
  229. data/spec/features/item_admin_spec.rb +4 -2
  230. data/spec/features/javascript/about_page_admin_spec.rb +2 -1
  231. data/spec/features/javascript/block_controls_spec.rb +3 -2
  232. data/spec/features/javascript/blocks/rule_block_spec.rb +1 -0
  233. data/spec/features/javascript/blocks/solr_documents_block_spec.rb +11 -11
  234. data/spec/features/javascript/blocks/uploaded_items_block_spec.rb +5 -7
  235. data/spec/features/javascript/edit_in_place_spec.rb +2 -1
  236. data/spec/features/javascript/feature_page_admin_spec.rb +1 -1
  237. data/spec/features/javascript/home_page_edit_spec.rb +1 -1
  238. data/spec/features/javascript/metadata_admin_spec.rb +3 -1
  239. data/spec/features/javascript/multi_image_select_spec.rb +3 -2
  240. data/spec/features/javascript/reindex_monitor_spec.rb +1 -1
  241. data/spec/features/javascript/roles_admin_spec.rb +1 -0
  242. data/spec/features/javascript/search_config_admin_spec.rb +3 -1
  243. data/spec/features/javascript/search_context_spec.rb +5 -4
  244. data/spec/features/main_navigation_spec.rb +46 -2
  245. data/spec/features/metadata_admin_spec.rb +1 -0
  246. data/spec/features/report_a_problem_spec.rb +1 -1
  247. data/spec/features/site_masthead_spec.rb +3 -3
  248. data/spec/features/slideshow_spec.rb +1 -1
  249. data/spec/helpers/spotlight/application_helper_spec.rb +10 -5
  250. data/spec/helpers/spotlight/crud_link_helpers_spec.rb +3 -0
  251. data/spec/helpers/spotlight/languages_helper_spec.rb +2 -0
  252. data/spec/helpers/spotlight/main_app_helpers_spec.rb +10 -6
  253. data/spec/helpers/spotlight/masthead_helper_spec.rb +51 -0
  254. data/spec/helpers/spotlight/meta_helper_spec.rb +1 -0
  255. data/spec/helpers/spotlight/navbar_helper_spec.rb +5 -3
  256. data/spec/helpers/spotlight/pages_helper_spec.rb +10 -3
  257. data/spec/helpers/spotlight/title_helper_spec.rb +1 -0
  258. data/spec/jobs/spotlight/add_uploads_from_csv_spec.rb +1 -0
  259. data/spec/jobs/spotlight/default_thumbnail_job_spec.rb +2 -1
  260. data/spec/lib/migration/iiif_spec.rb +1 -1
  261. data/spec/lib/migration/page_language_spec.rb +1 -0
  262. data/spec/lib/spotlight/controller_spec.rb +4 -4
  263. data/spec/mailers/spotlight/indexing_complete_mailer_spec.rb +2 -1
  264. data/spec/models/sir_trevor_rails/blocks/browse_block_spec.rb +2 -1
  265. data/spec/models/sir_trevor_rails/blocks/featured_pages_block_spec.rb +2 -1
  266. data/spec/models/sir_trevor_rails/blocks/search_results_block_spec.rb +2 -1
  267. data/spec/models/sir_trevor_rails/blocks/solr_documents_block_spec.rb +2 -1
  268. data/spec/models/sir_trevor_rails/blocks/textable_spec.rb +5 -2
  269. data/spec/models/solr_document_spec.rb +19 -10
  270. data/spec/models/spotlight/ability_spec.rb +3 -1
  271. data/spec/models/spotlight/about_page_spec.rb +6 -3
  272. data/spec/models/spotlight/access_controls_enforcement_search_builder_spec.rb +2 -1
  273. data/spec/models/spotlight/analytics/ga_spec.rb +1 -1
  274. data/spec/models/spotlight/blacklight_configuration_spec.rb +36 -31
  275. data/spec/models/spotlight/contact_email_spec.rb +4 -3
  276. data/spec/models/spotlight/contact_form_spec.rb +3 -2
  277. data/spec/models/spotlight/contact_spec.rb +4 -3
  278. data/spec/models/spotlight/custom_field_spec.rb +17 -8
  279. data/spec/models/spotlight/custom_search_field_spec.rb +2 -0
  280. data/spec/models/spotlight/custom_translation_extension_spec.rb +2 -1
  281. data/spec/models/spotlight/exhibit_spec.rb +34 -3
  282. data/spec/models/spotlight/feature_page_spec.rb +21 -9
  283. data/spec/models/spotlight/field_metadata_spec.rb +4 -4
  284. data/spec/models/spotlight/home_page_spec.rb +8 -4
  285. data/spec/models/spotlight/language_spec.rb +1 -0
  286. data/spec/models/spotlight/masthead_spec.rb +2 -1
  287. data/spec/models/spotlight/page_configurations_spec.rb +2 -1
  288. data/spec/models/spotlight/page_spec.rb +14 -8
  289. data/spec/models/spotlight/reindexing_log_entry_spec.rb +4 -4
  290. data/spec/models/spotlight/resources/iiif_harvester_spec.rb +5 -3
  291. data/spec/models/spotlight/resources/iiif_manifest_spec.rb +6 -2
  292. data/spec/models/spotlight/resources/iiif_service_spec.rb +4 -1
  293. data/spec/models/spotlight/resources/open_graph_spec.rb +3 -2
  294. data/spec/models/spotlight/resources/upload_spec.rb +7 -2
  295. data/spec/models/spotlight/role_spec.rb +5 -0
  296. data/spec/models/spotlight/search_spec.rb +4 -1
  297. data/spec/models/spotlight/sitemap_spec.rb +2 -2
  298. data/spec/models/spotlight/solr_document/atomic_updates_spec.rb +2 -1
  299. data/spec/models/spotlight/solr_document/uploaded_resource_spec.rb +3 -1
  300. data/spec/models/spotlight/solr_document_sidecar_spec.rb +8 -7
  301. data/spec/models/spotlight/user_spec.rb +1 -0
  302. data/spec/models/translation_spec.rb +3 -2
  303. data/spec/serializers/spotlight/exhibit_export_serializer_spec.rb +24 -23
  304. data/spec/services/spotlight/clone_translated_page_from_locale_spec.rb +2 -1
  305. data/spec/services/spotlight/iiif_resource_resolver_spec.rb +3 -2
  306. data/spec/services/spotlight/solr_document_builder_spec.rb +2 -1
  307. data/spec/spec_helper.rb +4 -4
  308. data/spec/support/features/test_features_helpers.rb +1 -1
  309. data/spec/test_app_templates/Gemfile.extra +1 -1
  310. data/spec/test_app_templates/catalog_controller.rb +1 -1
  311. data/spec/test_app_templates/spotlight_test.rake +1 -1
  312. data/spec/uploaders/spotlight/attachment_uploader_spec.rb +2 -1
  313. data/spec/uploaders/spotlight/featured_image_uploader_spec.rb +2 -1
  314. data/spec/views/shared/_analytics.html.erb_spec.rb +1 -0
  315. data/spec/views/shared/_exhibit_navbar.html.erb_spec.rb +5 -5
  316. data/spec/views/shared/_masthead.html.erb_spec.rb +4 -1
  317. data/spec/views/shared/_user_util_links.html.erb_spec.rb +9 -2
  318. data/spec/views/spotlight/about_pages/_empty.html.erb_spec.rb +4 -1
  319. data/spec/views/spotlight/about_pages/index.html.erb_spec.rb +2 -0
  320. data/spec/views/spotlight/browse/_search.html.erb_spec.rb +1 -0
  321. data/spec/views/spotlight/browse/index.html.erb_spec.rb +3 -1
  322. data/spec/views/spotlight/browse/show.html.erb_spec.rb +2 -2
  323. data/spec/views/spotlight/catalog/_edit_default.html.erb_spec.rb +6 -5
  324. data/spec/views/spotlight/catalog/admin.html.erb_spec.rb +1 -0
  325. data/spec/views/spotlight/contacts/edit.html.erb_spec.rb +1 -1
  326. data/spec/views/spotlight/dashboards/_analytics.html.erb_spec.rb +1 -0
  327. data/spec/views/spotlight/dashboards/_reindexing_activity.html.erb_spec.rb +1 -1
  328. data/spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb +1 -1
  329. data/spec/views/spotlight/exhibits/_form.html.erb_spec.rb +1 -0
  330. data/spec/views/spotlight/exhibits/edit.html.erb_spec.rb +2 -1
  331. data/spec/views/spotlight/feature_pages/_empty.html.erb_spec.rb +2 -1
  332. data/spec/views/spotlight/featured_images/_form.html.erb_spec.rb +1 -1
  333. data/spec/views/spotlight/featured_images/_upload_form.html.erb_spec.rb +1 -1
  334. data/spec/views/spotlight/home_pages/_empty.html.erb_spec.rb +2 -1
  335. data/spec/views/spotlight/metadata_configurations/edit.html.erb_spec.rb +1 -0
  336. data/spec/views/spotlight/pages/_form.html.erb_spec.rb +1 -0
  337. data/spec/views/spotlight/pages/edit.html.erb_spec.rb +1 -0
  338. data/spec/views/spotlight/pages/index.html.erb_spec.rb +1 -0
  339. data/spec/views/spotlight/pages/new.html.erb_spec.rb +1 -0
  340. data/spec/views/spotlight/pages/show.html.erb_spec.rb +4 -3
  341. data/spec/views/spotlight/resources/_external_resources_form.html.erb_spec.rb +1 -1
  342. data/spec/views/spotlight/resources/new.html.erb_spec.rb +2 -2
  343. data/spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb +2 -2
  344. data/spec/views/spotlight/search_configurations/_facets.html.erb_spec.rb +1 -1
  345. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb_spec.rb +2 -1
  346. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb +17 -3
  347. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb_spec.rb +8 -1
  348. data/spec/views/spotlight/tags/index.html.erb_spec.rb +1 -0
  349. data/spec/views/spotlight/translations/_page.html.erb_spec.rb +1 -0
  350. metadata +158 -152
@@ -7,6 +7,7 @@ RSpec.describe Spotlight::AdminUsersController, type: :controller do
7
7
 
8
8
  context 'by a non-admin' do
9
9
  let(:user) { FactoryBot.create(:exhibit_visitor) }
10
+
10
11
  it 'redirects with an error message' do
11
12
  get :index
12
13
  expect(response).to redirect_to '/'
@@ -18,6 +19,7 @@ RSpec.describe Spotlight::AdminUsersController, type: :controller do
18
19
  before { request.env['HTTP_REFERER'] = 'http://example.com' }
19
20
 
20
21
  let(:user) { FactoryBot.create(:site_admin) }
22
+
21
23
  describe 'GET index' do
22
24
  it 'is successful' do
23
25
  get :index
@@ -28,6 +30,7 @@ RSpec.describe Spotlight::AdminUsersController, type: :controller do
28
30
  describe 'DELETE destroy' do
29
31
  let(:user) { FactoryBot.create(:user) }
30
32
  let!(:admin_role) { FactoryBot.create(:role, role: 'admin', user: user, resource: Spotlight::Site.instance) }
33
+
31
34
  it 'removes the site admin role from the given user' do
32
35
  delete :destroy, params: { id: user.id }
33
36
  expect(response).to redirect_to(admin_users_path)
@@ -38,6 +41,7 @@ RSpec.describe Spotlight::AdminUsersController, type: :controller do
38
41
 
39
42
  describe 'PATCH update' do
40
43
  let(:non_admin) { FactoryBot.create(:exhibit_visitor) }
44
+
41
45
  it 'adds the site admin role to the given user' do
42
46
  patch :update, params: { id: non_admin.id }
43
47
  expect(response).to redirect_to(admin_users_path)
@@ -29,6 +29,7 @@ describe Spotlight::AppearancesController, type: :controller do
29
29
 
30
30
  describe 'when signed in' do
31
31
  let(:user) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
32
+
32
33
  before { sign_in user }
33
34
 
34
35
  describe 'GET edit' do
@@ -67,6 +68,7 @@ describe Spotlight::AppearancesController, type: :controller do
67
68
  1 => { id: last_nav.id, display: false }
68
69
  }
69
70
  end
71
+
70
72
  it 'updates the navigation' do
71
73
  patch :update, params: submitted
72
74
  expect(flash[:notice]).to eq 'The exhibit was successfully updated.'
@@ -3,6 +3,7 @@
3
3
  describe Spotlight::ApplicationController, type: :controller do
4
4
  routes { Spotlight::Engine.routes }
5
5
  let(:exhibit) { FactoryBot.create(:exhibit) }
6
+
6
7
  it 'provides a search_action_url override' do
7
8
  allow(controller).to receive_messages(current_exhibit: exhibit)
8
9
  expect(controller.search_action_url(q: 'query')).to eq search_exhibit_catalog_url(exhibit, q: 'query')
@@ -3,6 +3,7 @@
3
3
  describe Spotlight::AttachmentsController, type: :controller do
4
4
  routes { Spotlight::Engine.routes }
5
5
  let(:exhibit) { FactoryBot.create(:exhibit) }
6
+
6
7
  describe 'when not logged in' do
7
8
  describe 'GET edit' do
8
9
  it 'is successful' do
@@ -14,6 +15,7 @@ describe Spotlight::AttachmentsController, type: :controller do
14
15
 
15
16
  describe 'when signed in as a curator' do
16
17
  let(:user) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
18
+
17
19
  before { sign_in user }
18
20
 
19
21
  describe 'POST create' do
@@ -49,7 +49,7 @@ describe Spotlight::BrowseController, type: :controller do
49
49
  get :index, params: { exhibit_id: exhibit }
50
50
  expect(response).to be_successful
51
51
  expect(assigns[:searches]).to eq [search]
52
- expect(assigns[:searches]).to_not include unpublished
52
+ expect(assigns[:searches]).not_to include unpublished
53
53
  expect(assigns[:exhibit]).to eq exhibit
54
54
  expect(response).to render_template 'spotlight/browse/index'
55
55
  end
@@ -64,7 +64,7 @@ describe Spotlight::BrowseController, type: :controller do
64
64
  get :index, params: { exhibit_id: exhibit }
65
65
  expect(response).to be_successful
66
66
  expect(assigns[:searches]).to eq [search]
67
- expect(assigns[:searches]).to_not include unpublished
67
+ expect(assigns[:searches]).not_to include unpublished
68
68
  expect(assigns[:exhibit]).to eq exhibit
69
69
  expect(response).to render_template 'spotlight/browse/index'
70
70
  end
@@ -73,6 +73,7 @@ describe Spotlight::BrowseController, type: :controller do
73
73
  describe 'GET show' do
74
74
  let(:mock_response) { double aggregations: {} }
75
75
  let(:document_list) { double }
76
+
76
77
  before do
77
78
  allow(controller).to receive_messages(search_service: double(search_results: [mock_response, document_list]))
78
79
  end
@@ -96,13 +97,13 @@ describe Spotlight::BrowseController, type: :controller do
96
97
 
97
98
  it 'uses the blacklight.browse configuration for the document actions' do
98
99
  config = Blacklight::Configuration.new do |c|
99
- c.browse.document_actions = [:a, :b, :c]
100
+ c.browse.document_actions = %i[a b c]
100
101
  end
101
102
 
102
103
  allow(controller). to receive(:blacklight_config).and_return(config)
103
104
 
104
105
  get :show, params: { id: search, exhibit_id: exhibit }
105
- expect(controller.blacklight_config.index.document_actions).to match_array [:a, :b, :c]
106
+ expect(controller.blacklight_config.index.document_actions).to match_array %i[a b c]
106
107
  end
107
108
 
108
109
  it 'has a json response' do
@@ -7,7 +7,7 @@ describe Spotlight::CatalogController, type: :controller do
7
7
 
8
8
  it { is_expected.to be_a_kind_of ::CatalogController }
9
9
  it { is_expected.to be_a_kind_of Spotlight::Concerns::ApplicationController }
10
- its(:view_context) { should be_a_kind_of Spotlight::ApplicationHelper }
10
+ its(:view_context) { is_expected.to be_a_kind_of Spotlight::ApplicationHelper }
11
11
 
12
12
  describe 'when the user is not authenticated' do
13
13
  describe 'GET admin' do
@@ -27,6 +27,7 @@ describe Spotlight::CatalogController, type: :controller do
27
27
  describe 'GET show' do
28
28
  let(:document) { SolrDocument.new(id: 'dq287tq6352') }
29
29
  let(:search) { FactoryBot.create(:search, exhibit: exhibit) }
30
+
30
31
  it 'shows the item' do
31
32
  expect(controller).to receive(:add_breadcrumb).with('Home', exhibit_path(exhibit, q: ''))
32
33
  expect(controller).to receive(:add_breadcrumb).with('L'AMERIQUE', exhibit_solr_document_path(exhibit, document))
@@ -84,6 +85,7 @@ describe Spotlight::CatalogController, type: :controller do
84
85
  get :index, params: { exhibit_id: exhibit, q: 'map' }
85
86
  expect(response).to be_successful
86
87
  end
88
+
87
89
  it 'redirects to the exhibit home page when there are no parameters' do
88
90
  get :index, params: { exhibit_id: exhibit }
89
91
  expect(response).to redirect_to(exhibit_root_path(exhibit))
@@ -105,6 +107,7 @@ describe Spotlight::CatalogController, type: :controller do
105
107
  expect(doc['thumbnail']).to eq assigns[:document_list].first.first(:thumbnail_url_ssm)
106
108
  expect(doc['url']).to eq exhibit_solr_document_path(exhibit, id: 'ps921pn8250')
107
109
  end
110
+
108
111
  it 'has partial matches for id' do
109
112
  get :autocomplete, params: { exhibit_id: exhibit, q: 'dx157', format: 'json' }
110
113
  expect(assigns[:document_list].first.id).to eq 'dx157dh4345'
@@ -244,11 +247,13 @@ describe Spotlight::CatalogController, type: :controller do
244
247
  patch :update, params: { exhibit_id: exhibit, id: 'dq287tq6352', solr_document: { exhibit_tag_list: 'one, two' } }
245
248
  end.to change { exhibit.owned_taggings.count }.by(2)
246
249
  end
250
+
247
251
  it 'can update non-readonly fields' do
248
252
  field = FactoryBot.create(:custom_field, exhibit: exhibit)
249
253
  patch :update, params: { exhibit_id: exhibit, id: 'dq287tq6352', solr_document: { sidecar: { data: { field.field => 'no' } } } }
250
254
  expect(assigns[:document].sidecar(exhibit).data).to eq(field.field => 'no')
251
255
  end
256
+
252
257
  it "can't update readonly fields" do
253
258
  field = FactoryBot.create(:custom_field, exhibit: exhibit, readonly_field: true)
254
259
  patch :update, params: { exhibit_id: exhibit, id: 'dq287tq6352', solr_document: { sidecar: { data: { field.field => 'no' } } } }
@@ -422,6 +427,7 @@ describe Spotlight::CatalogController, type: :controller do
422
427
 
423
428
  describe '#field_enabled?' do
424
429
  let(:field) { FactoryBot.create(:custom_field) }
430
+
425
431
  before do
426
432
  controller.extend(Blacklight::Catalog)
427
433
  allow(controller).to receive(:document_index_view_type).and_return(nil)
@@ -430,6 +436,7 @@ describe Spotlight::CatalogController, type: :controller do
430
436
 
431
437
  context 'for sort fields' do
432
438
  let(:field) { Blacklight::Configuration::SortField.new enabled: true }
439
+
433
440
  it 'uses the enabled property for sort fields' do
434
441
  expect(controller.field_enabled?(field)).to eq true
435
442
  end
@@ -437,6 +444,7 @@ describe Spotlight::CatalogController, type: :controller do
437
444
 
438
445
  context 'for search fields' do
439
446
  let(:field) { Blacklight::Configuration::SearchField.new enabled: true }
447
+
440
448
  it 'uses the enabled property for search fields' do
441
449
  expect(controller.field_enabled?(field)).to eq true
442
450
  end
@@ -447,11 +455,13 @@ describe Spotlight::CatalogController, type: :controller do
447
455
  allow(controller).to receive(:action_name).and_return('show')
448
456
  expect(controller.field_enabled?(field)).to eq :value
449
457
  end
458
+
450
459
  it 'returns the value of field#show if the action_name is "edit"' do
451
460
  allow(field).to receive(:show).and_return(:value)
452
461
  allow(controller).to receive(:action_name).and_return('edit')
453
462
  expect(controller.field_enabled?(field)).to eq :value
454
463
  end
464
+
455
465
  it 'returns the value of the original if condition' do
456
466
  allow(field).to receive(:original).and_return false
457
467
  expect(controller.field_enabled?(field)).to eq false
@@ -460,6 +470,7 @@ describe Spotlight::CatalogController, type: :controller do
460
470
 
461
471
  describe '#enabled_in_spotlight_view_type_configuration?' do
462
472
  let(:view) { OpenStruct.new }
473
+
463
474
  before do
464
475
  controller.extend(Blacklight::Catalog)
465
476
  end
@@ -483,22 +494,25 @@ describe Spotlight::CatalogController, type: :controller do
483
494
 
484
495
  describe 'save_search rendering' do
485
496
  let(:current_exhibit) { FactoryBot.create(:exhibit) }
497
+
486
498
  before { allow(controller).to receive_messages(current_exhibit: current_exhibit) }
487
499
 
488
500
  describe 'render_save_this_search?' do
489
501
  it 'returns false if we are on the items admin screen' do
490
502
  allow(controller).to receive(:can?).with(:curate, current_exhibit).and_return(true)
491
503
  allow(controller).to receive(:params).and_return(controller: 'spotlight/catalog', action: 'admin')
492
- expect(controller.render_save_this_search?).to be_falsey
504
+ expect(controller).not_to be_render_save_this_search
493
505
  end
506
+
494
507
  it 'returns true if we are not on the items admin screen' do
495
508
  allow(controller).to receive(:can?).with(:curate, current_exhibit).and_return(true)
496
509
  allow(controller).to receive(:params).and_return(controller: 'spotlight/catalog', action: 'index')
497
- expect(controller.render_save_this_search?).to be_truthy
510
+ expect(controller).to be_render_save_this_search
498
511
  end
512
+
499
513
  it 'returns false if a user cannot curate the object' do
500
514
  allow(controller).to receive(:can?).with(:curate, current_exhibit).and_return(false)
501
- expect(controller.render_save_this_search?).to be_falsey
515
+ expect(controller).not_to be_render_save_this_search
502
516
  end
503
517
  end
504
518
  end
@@ -19,6 +19,7 @@ describe Spotlight::ConfirmationsController, type: :controller do
19
19
  let(:exhibit) { FactoryBot.create(:exhibit) }
20
20
  let(:contact_email) { FactoryBot.create(:contact_email, email: 'justin@example.com', exhibit: exhibit) }
21
21
  let(:raw_token) { contact_email.instance_variable_get(:@raw_confirmation_token) }
22
+
22
23
  describe 'when the token is invalid' do
23
24
  it 'gives reset instructions' do
24
25
  get :show
@@ -24,10 +24,12 @@ describe Spotlight::ContactFormsController, type: :controller do
24
24
  post :create, params: { exhibit_id: exhibit.id, contact_form: { name: 'Joe Doe', email: 'jdoe@example.com', honeypot_field_name => '' } }
25
25
  end.to change { ActionMailer::Base.deliveries.count }.by(1)
26
26
  end
27
+
27
28
  it 'redirects back' do
28
29
  post :create, params: { exhibit_id: exhibit.id, contact_form: { name: 'Joe Doe', email: 'jdoe@example.com', honeypot_field_name => '' } }
29
30
  expect(response).to redirect_to 'http://example.com'
30
31
  end
32
+
31
33
  it 'sets a flash message' do
32
34
  post :create, params: { exhibit_id: exhibit.id, contact_form: { name: 'Joe Doe', email: 'jdoe@example.com', honeypot_field_name => '' } }
33
35
  expect(flash[:notice]).to eq 'Thanks. Your feedback has been sent.'
@@ -5,6 +5,7 @@ describe Spotlight::ContactsController, type: :controller do
5
5
  describe 'when not logged in' do
6
6
  describe 'GET edit' do
7
7
  let(:contact) { FactoryBot.create(:contact) }
8
+
8
9
  it 'is successful' do
9
10
  get :edit, params: { id: contact, exhibit_id: contact.exhibit }
10
11
  expect(response).to redirect_to main_app.new_user_session_path
@@ -16,6 +17,7 @@ describe Spotlight::ContactsController, type: :controller do
16
17
  let(:user) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
17
18
  let(:exhibit) { FactoryBot.create(:exhibit) }
18
19
  let(:contact) { FactoryBot.create(:contact, exhibit: exhibit, name: 'Andrew Carnegie') }
20
+
19
21
  before { sign_in user }
20
22
 
21
23
  describe 'GET edit' do
@@ -87,6 +89,7 @@ describe Spotlight::ContactsController, type: :controller do
87
89
  post :create, params: { exhibit_id: exhibit, contact: { name: 'Chester' } }
88
90
  expect(response).to render_template 'new'
89
91
  end
92
+
90
93
  it 'is successful' do
91
94
  expect do
92
95
  post :create, params: { exhibit_id: exhibit, contact: { name: 'Chester', avatar_attributes: { iiif_tilesource: 'someurl' } } }
@@ -6,6 +6,7 @@ describe Spotlight::CustomFieldsController, type: :controller do
6
6
 
7
7
  describe 'when signed in as an exhibit admin' do
8
8
  let(:user) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
9
+
9
10
  before { sign_in user }
10
11
 
11
12
  describe 'GET new' do
@@ -21,6 +22,7 @@ describe Spotlight::CustomFieldsController, type: :controller do
21
22
 
22
23
  describe 'GET edit' do
23
24
  let(:field) { FactoryBot.create(:custom_field, exhibit: exhibit) }
25
+
24
26
  it 'assigns the requested custom_field' do
25
27
  expect(controller).to receive(:add_breadcrumb).with('Home', exhibit)
26
28
  expect(controller).to receive(:add_breadcrumb).with('Configuration', exhibit_dashboard_path(exhibit))
@@ -6,6 +6,7 @@ describe Spotlight::CustomSearchFieldsController, type: :controller do
6
6
 
7
7
  describe 'when signed in as an exhibit admin' do
8
8
  let(:user) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
9
+
9
10
  before { sign_in user }
10
11
 
11
12
  describe 'GET new' do
@@ -21,6 +22,7 @@ describe Spotlight::CustomSearchFieldsController, type: :controller do
21
22
 
22
23
  describe 'GET edit' do
23
24
  let(:field) { FactoryBot.create(:custom_search_field, exhibit: exhibit) }
25
+
24
26
  it 'assigns the requested custom_field' do
25
27
  expect(controller).to receive(:add_breadcrumb).with('Home', exhibit)
26
28
  expect(controller).to receive(:add_breadcrumb).with('Configuration', exhibit_dashboard_path(exhibit))
@@ -11,6 +11,7 @@ describe Spotlight::DashboardsController, type: :controller do
11
11
 
12
12
  describe 'when logged in' do
13
13
  let(:curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
14
+
14
15
  before { sign_in curator }
15
16
 
16
17
  describe 'GET show' do
@@ -87,6 +87,7 @@ describe Spotlight::ExhibitsController, type: :controller do
87
87
 
88
88
  describe 'when signed in as a site admin' do
89
89
  let(:user) { FactoryBot.create(:site_admin) }
90
+
90
91
  before { sign_in user }
91
92
 
92
93
  describe 'GET new' do
@@ -121,12 +122,13 @@ describe Spotlight::ExhibitsController, type: :controller do
121
122
 
122
123
  describe 'when signed in as an exhibit admin' do
123
124
  let(:user) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
125
+
124
126
  before { sign_in user }
125
127
 
126
128
  describe 'GET new' do
127
129
  it 'is not allowed' do
128
130
  get :new
129
- expect(response).to_not be_successful
131
+ expect(response).not_to be_successful
130
132
  end
131
133
  end
132
134
 
@@ -205,7 +207,7 @@ describe Spotlight::ExhibitsController, type: :controller do
205
207
  describe '#destroy' do
206
208
  it 'is successful' do
207
209
  delete :destroy, params: { id: exhibit }
208
- expect(Spotlight::Exhibit.exists?(exhibit.id)).to be_falsey
210
+ expect(Spotlight::Exhibit).not_to exist(exhibit.id)
209
211
  expect(flash[:notice]).to eq 'The exhibit was deleted.'
210
212
  expect(response).to redirect_to main_app.root_path
211
213
  end
@@ -3,8 +3,11 @@
3
3
  describe Spotlight::FeaturePagesController, type: :controller, versioning: true do
4
4
  routes { Spotlight::Engine.routes }
5
5
 
6
+ let(:valid_attributes) { { 'title' => 'MyString', thumbnail_attributes: { iiif_url: '' } } }
7
+
6
8
  describe 'when not logged in' do
7
9
  let(:exhibit) { FactoryBot.create(:exhibit) }
10
+
8
11
  describe 'GET clone' do
9
12
  let(:page) { FactoryBot.create(:feature_page, exhibit: exhibit) }
10
13
 
@@ -19,14 +22,16 @@ describe Spotlight::FeaturePagesController, type: :controller, versioning: true
19
22
  # This should return the minimal set of attributes required to create a valid
20
23
  # Page. As you add validations to Page, be sure to
21
24
  # adjust the attributes here as well.
22
- let(:valid_attributes) { { 'title' => 'MyString', thumbnail_attributes: { iiif_url: '' } } }
25
+
23
26
  describe 'when signed in as a curator' do
24
27
  let(:exhibit) { FactoryBot.create(:exhibit) }
25
28
  let(:user) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
29
+
26
30
  before { sign_in user }
27
31
 
28
32
  describe 'GET index' do
29
33
  let!(:page) { FactoryBot.create(:feature_page, exhibit: exhibit) }
34
+
30
35
  it 'assigns all feature pages as @pages' do
31
36
  expect(controller).to receive(:add_breadcrumb).with('Home', exhibit_root_path(exhibit))
32
37
  expect(controller).to receive(:add_breadcrumb).with('Curation', exhibit_dashboard_path(exhibit))
@@ -40,6 +45,7 @@ describe Spotlight::FeaturePagesController, type: :controller, versioning: true
40
45
  describe 'GET show' do
41
46
  describe 'on a top level page' do
42
47
  let(:page) { FactoryBot.create(:feature_page, exhibit: exhibit) }
48
+
43
49
  it 'assigns the requested page as @page' do
44
50
  expect(controller).to receive(:add_breadcrumb).with('Home', exhibit_root_path(exhibit))
45
51
  expect(controller).to receive(:add_breadcrumb).with(page.title, [a_kind_of(ActionDispatch::Routing::RoutesProxy), exhibit, page])
@@ -50,6 +56,7 @@ describe Spotlight::FeaturePagesController, type: :controller, versioning: true
50
56
 
51
57
  describe 'on a sub-page' do
52
58
  let(:page) { FactoryBot.create(:feature_subpage, exhibit: exhibit) }
59
+
53
60
  it 'assigns the requested page as @page' do
54
61
  expect(controller).to receive(:add_breadcrumb).with('Home', exhibit_root_path(exhibit))
55
62
  expect(controller).to receive(:add_breadcrumb).with(
@@ -97,6 +104,7 @@ describe Spotlight::FeaturePagesController, type: :controller, versioning: true
97
104
 
98
105
  describe 'GET edit' do
99
106
  let(:page) { FactoryBot.create(:feature_subpage, exhibit: exhibit) }
107
+
100
108
  it 'assigns the requested page as @page' do
101
109
  expect(controller).to receive(:add_breadcrumb).with('Home', exhibit_root_path(exhibit))
102
110
  expect(controller).to receive(:add_breadcrumb).with('Feature pages', exhibit_feature_pages_path(exhibit))
@@ -122,6 +130,7 @@ describe Spotlight::FeaturePagesController, type: :controller, versioning: true
122
130
  expect(assigns(:page)).to be_a(Spotlight::FeaturePage)
123
131
  expect(assigns(:page)).to be_persisted
124
132
  end
133
+
125
134
  it 'redirects to the feature page index' do
126
135
  post :create, params: { feature_page: { title: 'MyString' }, exhibit_id: exhibit }
127
136
  expect(response).to redirect_to(exhibit_feature_pages_path(Spotlight::FeaturePage.last.exhibit))
@@ -147,6 +156,7 @@ describe Spotlight::FeaturePagesController, type: :controller, versioning: true
147
156
 
148
157
  describe 'PUT update' do
149
158
  let(:page) { FactoryBot.create(:feature_page, exhibit: exhibit) }
159
+
150
160
  describe 'with valid params' do
151
161
  it 'updates the requested page' do
152
162
  expect_any_instance_of(Spotlight::FeaturePage).to receive(:update)
@@ -187,6 +197,7 @@ describe Spotlight::FeaturePagesController, type: :controller, versioning: true
187
197
  let!(:page1) { FactoryBot.create(:feature_page, exhibit: exhibit) }
188
198
  let!(:page2) { FactoryBot.create(:feature_page, exhibit: page1.exhibit) }
189
199
  let!(:page3) { FactoryBot.create(:feature_page, exhibit: page1.exhibit, parent_page_id: page1.id) }
200
+
190
201
  before { request.env['HTTP_REFERER'] = 'http://example.com' }
191
202
 
192
203
  it 'updates the parent/child relationship' do
@@ -201,6 +212,7 @@ describe Spotlight::FeaturePagesController, type: :controller, versioning: true
201
212
 
202
213
  describe 'DELETE destroy' do
203
214
  let!(:page) { FactoryBot.create(:feature_page, exhibit: exhibit) }
215
+
204
216
  it 'destroys the requested page' do
205
217
  expect do
206
218
  delete :destroy, params: { id: page, exhibit_id: page.exhibit.id }
@@ -26,6 +26,7 @@ describe Spotlight::FeaturedImagesController, type: :controller do
26
26
 
27
27
  describe 'when signed in as a site admin' do
28
28
  let(:user) { FactoryBot.create(:site_admin) }
29
+
29
30
  before { sign_in user }
30
31
 
31
32
  describe 'POST create a thumbnail' do
@@ -8,6 +8,7 @@ describe Spotlight::HomePagesController, type: :controller, versioning: true do
8
8
 
9
9
  describe 'when signed in as a curator' do
10
10
  let(:user) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
11
+
11
12
  before do
12
13
  sign_in user
13
14
  end
@@ -50,16 +51,18 @@ describe Spotlight::HomePagesController, type: :controller, versioning: true do
50
51
  it 'gets search results for display facets' do
51
52
  allow(controller).to receive_messages(search_results: [double, double])
52
53
  get :show, params: { exhibit_id: exhibit }
53
- expect(assigns[:response]).to_not be_blank
54
- expect(assigns[:document_list]).to_not be_blank
54
+ expect(assigns[:response]).not_to be_blank
55
+ expect(assigns[:document_list]).not_to be_blank
55
56
  expect(assigns[:page]).to eq exhibit.home_page
56
57
  end
58
+
57
59
  it 'does not render breadcrumbs' do
58
60
  expect(controller).not_to receive(:add_breadcrumb)
59
61
  allow(controller).to receive_messages(search_results: [double, double])
60
62
  get :show, params: { exhibit_id: exhibit }
61
63
  expect(response).to be_successful
62
64
  end
65
+
63
66
  it 'does not do the search when the sidebar is hidden' do
64
67
  page.display_sidebar = false
65
68
  page.save