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
@@ -2,6 +2,7 @@
2
2
 
3
3
  describe Spotlight::SolrDocumentSidecar, type: :model do
4
4
  let(:exhibit) { FactoryBot.create(:exhibit) }
5
+
5
6
  before do
6
7
  allow(subject).to receive_messages exhibit: exhibit
7
8
  allow(subject).to receive_messages document: SolrDocument.new(id: 'doc_id')
@@ -12,9 +13,9 @@ describe Spotlight::SolrDocumentSidecar, type: :model do
12
13
  subject.data = { 'a_tesim' => 1, 'b_tesim' => 2, 'c_tesim' => 3 }
13
14
  end
14
15
 
15
- its(:to_solr) { should include id: 'doc_id' }
16
- its(:to_solr) { should include "exhibit_#{exhibit.slug}_public_bsi".to_sym => true }
17
- its(:to_solr) { should include 'a_tesim', 'b_tesim', 'c_tesim' }
16
+ its(:to_solr) { is_expected.to include id: 'doc_id' }
17
+ its(:to_solr) { is_expected.to include "exhibit_#{exhibit.slug}_public_bsi".to_sym => true }
18
+ its(:to_solr) { is_expected.to include 'a_tesim', 'b_tesim', 'c_tesim' }
18
19
 
19
20
  context 'with an uploaded item' do
20
21
  before do
@@ -26,7 +27,7 @@ describe Spotlight::SolrDocumentSidecar, type: :model do
26
27
  Spotlight::UploadFieldConfig.new(field_name: 'some_configured_field', solr_fields: ['the_solr_field'])
27
28
  end
28
29
 
29
- its(:to_solr) { should include 'the_solr_field' => 'some value' }
30
+ its(:to_solr) { is_expected.to include 'the_solr_field' => 'some value' }
30
31
  end
31
32
 
32
33
  context 'with blank fields' do
@@ -38,9 +39,9 @@ describe Spotlight::SolrDocumentSidecar, type: :model do
38
39
  }
39
40
  end
40
41
 
41
- its(:to_solr) { should include 'a_blank_field' => nil }
42
- its(:to_solr) { should include 'a_blank_multivalued_field' => [] }
43
- its(:to_solr) { should include 'a_multivalued_field_with_some_blanks' => ['a'] }
42
+ its(:to_solr) { is_expected.to include 'a_blank_field' => nil }
43
+ its(:to_solr) { is_expected.to include 'a_blank_multivalued_field' => [] }
44
+ its(:to_solr) { is_expected.to include 'a_multivalued_field_with_some_blanks' => ['a'] }
44
45
  end
45
46
  end
46
47
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  describe Spotlight::User do
4
4
  subject { Class.new }
5
+
5
6
  before { subject.extend described_class }
6
7
 
7
8
  describe '#invite_pending?' do
@@ -2,11 +2,12 @@
2
2
 
3
3
  describe Translation, type: :model do
4
4
  let(:exhibit) { FactoryBot.create(:exhibit) }
5
+
5
6
  describe 'is unique by key, locale, and exhibit' do
6
7
  it 'fails validation' do
7
- Translation.create(exhibit_id: exhibit.id, key: 'abc', locale: 'fr', value: 'yo')
8
+ described_class.create(exhibit_id: exhibit.id, key: 'abc', locale: 'fr', value: 'yo')
8
9
  expect do
9
- Translation.create(exhibit_id: exhibit.id, key: 'abc', locale: 'fr', value: 'lo')
10
+ described_class.create(exhibit_id: exhibit.id, key: 'abc', locale: 'fr', value: 'lo')
10
11
  end.to raise_error(ActiveRecord::RecordNotUnique)
11
12
  end
12
13
  end
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  describe Spotlight::ExhibitExportSerializer do
4
+ subject { JSON.parse(described_class.new(source_exhibit).to_json) }
5
+
4
6
  let!(:source_exhibit) { FactoryBot.create(:exhibit) }
5
7
 
6
8
  before do
@@ -9,15 +11,13 @@ describe Spotlight::ExhibitExportSerializer do
9
11
  allow_any_instance_of(Spotlight::Resource).to receive(:reindex)
10
12
  end
11
13
 
12
- subject { JSON.parse(described_class.new(source_exhibit).to_json) }
13
-
14
14
  it 'does not include unique identifiers' do
15
- expect(subject).to_not have_key 'id'
16
- expect(subject).to_not have_key 'slug'
17
- expect(subject).to_not have_key 'name'
18
- expect(subject).to_not have_key 'default'
19
- expect(subject).to_not have_key 'masthead_id'
20
- expect(subject).to_not have_key 'thumbnail_id'
15
+ expect(subject).not_to have_key 'id'
16
+ expect(subject).not_to have_key 'slug'
17
+ expect(subject).not_to have_key 'name'
18
+ expect(subject).not_to have_key 'default'
19
+ expect(subject).not_to have_key 'masthead_id'
20
+ expect(subject).not_to have_key 'thumbnail_id'
21
21
  end
22
22
 
23
23
  it 'has search attributes' do
@@ -26,9 +26,9 @@ describe Spotlight::ExhibitExportSerializer do
26
26
 
27
27
  it 'has home page attributes' do
28
28
  expect(subject).to have_key 'home_page'
29
- expect(subject['home_page']).to_not have_key 'id'
30
- expect(subject['home_page']).to_not have_key 'scope'
31
- expect(subject['home_page']).to_not have_key 'exhibit_id'
29
+ expect(subject['home_page']).not_to have_key 'id'
30
+ expect(subject['home_page']).not_to have_key 'scope'
31
+ expect(subject['home_page']).not_to have_key 'exhibit_id'
32
32
  end
33
33
 
34
34
  it 'has about pages' do
@@ -57,7 +57,7 @@ describe Spotlight::ExhibitExportSerializer do
57
57
  expect(subject['solr_document_sidecars']).to have(source_exhibit.solr_document_sidecars.count).items
58
58
 
59
59
  expect(subject['solr_document_sidecars'].first).to include('document_id', 'public')
60
- expect(subject['solr_document_sidecars'].first).to_not include 'id'
60
+ expect(subject['solr_document_sidecars'].first).not_to include 'id'
61
61
  end
62
62
 
63
63
  it 'has attachments' do
@@ -82,6 +82,11 @@ describe Spotlight::ExhibitExportSerializer do
82
82
  end
83
83
 
84
84
  describe 'should round-trip data' do
85
+ subject do
86
+ e = FactoryBot.create(:exhibit)
87
+ e.import(export).tap(&:save)
88
+ end
89
+
85
90
  before do
86
91
  sidecar = source_exhibit.solr_document_sidecars.create! document: SolrDocument.new(id: 1), public: false
87
92
  source_exhibit.tag(sidecar, with: 'xyz', on: :tags)
@@ -91,11 +96,6 @@ describe Spotlight::ExhibitExportSerializer do
91
96
  described_class.new(source_exhibit).as_json
92
97
  end
93
98
 
94
- subject do
95
- e = FactoryBot.create(:exhibit)
96
- e.import(export).tap(&:save)
97
- end
98
-
99
99
  it 'has exhibit properties' do
100
100
  expect(subject.title).to eq source_exhibit.title
101
101
  end
@@ -128,7 +128,7 @@ describe Spotlight::ExhibitExportSerializer do
128
128
  end
129
129
 
130
130
  it 'has sidecars' do
131
- expect(SolrDocument.new(id: 1).public?(subject)).to be_falsey
131
+ expect(SolrDocument.new(id: 1)).not_to be_public(subject)
132
132
  end
133
133
 
134
134
  context 'for an exhibit with contacts' do
@@ -138,6 +138,7 @@ describe Spotlight::ExhibitExportSerializer do
138
138
  exhibit: source_exhibit,
139
139
  contact_info: { title: 'xyz' })
140
140
  end
141
+
141
142
  it 'has contacts' do
142
143
  expect(subject.contacts.count).to eq 1
143
144
  contact = subject.contacts.first
@@ -336,6 +337,11 @@ describe Spotlight::ExhibitExportSerializer do
336
337
  end
337
338
 
338
339
  describe 'should export saved searches with query parameters that can be re-generated' do
340
+ subject do
341
+ e = FactoryBot.create(:exhibit)
342
+ e.import(export).tap(&:save)
343
+ end
344
+
339
345
  before do
340
346
  source_exhibit.feature_pages.create content: [{
341
347
  type: 'search_results',
@@ -348,11 +354,6 @@ describe Spotlight::ExhibitExportSerializer do
348
354
  }].to_json
349
355
  end
350
356
 
351
- subject do
352
- e = FactoryBot.create(:exhibit)
353
- e.import(export).tap(&:save)
354
- end
355
-
356
357
  let :export do
357
358
  described_class.new(source_exhibit).as_json
358
359
  end
@@ -3,10 +3,11 @@
3
3
  require 'spec_helper'
4
4
 
5
5
  RSpec.describe Spotlight::CloneTranslatedPageFromLocale do
6
+ subject(:clone) { described_class.call(locale: language.locale, page: page) }
7
+
6
8
  let(:exhibit) { FactoryBot.create(:exhibit) }
7
9
  let!(:page) { FactoryBot.create(:feature_page, exhibit: exhibit) }
8
10
  let!(:language) { FactoryBot.create(:language, locale: 'es', exhibit: exhibit) }
9
- subject(:clone) { described_class.call(locale: language.locale, page: page) }
10
11
 
11
12
  it 'clones the exhibit home page for a particular exhibit' do
12
13
  expect(Spotlight::Page.where(locale: 'es')).not_to be_present
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  describe Spotlight::IiifResourceResolver do
4
+ subject(:resolver) { described_class.new(resource) }
5
+
4
6
  let(:fixture_json) do
5
7
  File.open(
6
8
  File.expand_path(File.join('..', 'spec', 'fixtures', 'gk446cj2442-manifest.json'), Rails.root)
@@ -17,8 +19,6 @@ describe Spotlight::IiifResourceResolver do
17
19
  )
18
20
  end
19
21
 
20
- subject(:resolver) { described_class.new(resource) }
21
-
22
22
  before do
23
23
  expect(resolver).to receive(:response).and_return(fixture_json)
24
24
  end
@@ -81,6 +81,7 @@ describe Spotlight::IiifResourceResolver do
81
81
 
82
82
  context 'when the JSON is unparsable' do
83
83
  let(:fixture_json) { 'Some sort of html error!' }
84
+
84
85
  it 'logs that the JSON was unparsable and falls through to an no-canvas error' do
85
86
  klass = described_class.name
86
87
  expect(Rails.logger).to receive(:warn).with(
@@ -20,10 +20,11 @@ describe Spotlight::SolrDocumentBuilder do
20
20
 
21
21
  describe '#documents_to_index' do
22
22
  context 'when the document belongs to more than one exhibit' do
23
+ subject { resource.document_builder }
24
+
23
25
  let(:doc) { SolrDocument.new(id: 'abc123') }
24
26
  let(:resource) { FactoryBot.create(:resource) }
25
27
  let(:resource_alt) { FactoryBot.create(:resource) }
26
- subject { resource.document_builder }
27
28
 
28
29
  before do
29
30
  allow(Spotlight::Engine.config).to receive(:filter_resources_by_exhibit).and_return(true)
@@ -47,14 +47,14 @@ end
47
47
  require 'spotlight'
48
48
 
49
49
  # configure spotlight with all the settings necessary to test functionality
50
- Spotlight::Engine.config.exhibit_themes = %w(default modern)
50
+ Spotlight::Engine.config.exhibit_themes = %w[default modern]
51
51
 
52
52
  Dir['./spec/support/**/*.rb'].sort.each { |f| require f }
53
53
 
54
- FactoryBot.definition_file_paths = [File.expand_path('../factories', __FILE__)]
54
+ FactoryBot.definition_file_paths = [File.expand_path('factories', __dir__)]
55
55
  FactoryBot.find_definitions
56
56
 
57
- FIXTURES_PATH = File.expand_path('../fixtures', __FILE__)
57
+ FIXTURES_PATH = File.expand_path('fixtures', __dir__)
58
58
 
59
59
  RSpec.configure do |config|
60
60
  config.infer_spec_type_from_file_location!
@@ -62,7 +62,7 @@ RSpec.configure do |config|
62
62
 
63
63
  config.use_transactional_fixtures = true
64
64
 
65
- config.before :each do
65
+ config.before do
66
66
  # The first user is automatically granted admin privileges; we don't want that behavior for many of our tests
67
67
  Spotlight::Engine.user_class.create email: 'initial+admin@example.com', password: 'password', password_confirmation: 'password'
68
68
  end
@@ -45,7 +45,7 @@ module Spotlight
45
45
  EOF
46
46
  click_button('Save changes')
47
47
  # verify that the page was created
48
- expect(page).to_not have_selector('.alert-danger')
48
+ expect(page).not_to have_selector('.alert-danger')
49
49
  expect(page).to have_selector('.alert-info', text: 'page was successfully updated')
50
50
  end
51
51
 
@@ -1,4 +1,4 @@
1
- gem 'thor', '~> 0.20'
2
1
  gem 'blacklight', '~> 7.0'
3
2
  gem 'blacklight-oembed', '>= 0.1', github: 'sul-dlss/blacklight-oembed'
4
3
  gem 'sprockets', '< 4'
4
+ gem 'thor', '~> 0.20'
@@ -29,7 +29,7 @@ class CatalogController < ApplicationController
29
29
  config.index.display_type_field = 'content_metadata_type_ssm'
30
30
  config.index.thumbnail_field = Spotlight::Engine.config.thumbnail_field
31
31
 
32
- config.view.gallery.partials = [:index_header, :index]
32
+ config.view.gallery.partials = %i[index_header index]
33
33
  config.view.slideshow.partials = [:index]
34
34
 
35
35
  config.show.tile_source_field = :content_metadata_image_iiif_info_ssm
@@ -6,7 +6,7 @@ namespace :spotlight_test do
6
6
  namespace :solr do
7
7
  desc 'Index test data into solr; must be run from within an app (see spotlight:fixtures)'
8
8
  task :seed do
9
- docs = YAML.load(File.open(File.expand_path(File.join('..', 'spec', 'fixtures', 'sample_solr_documents.yml'), Rails.root)))
9
+ docs = YAML.safe_load(File.open(File.expand_path(File.join('..', 'spec', 'fixtures', 'sample_solr_documents.yml'), Rails.root)))
10
10
  Blacklight.default_index.connection.add docs
11
11
  Blacklight.default_index.connection.commit
12
12
  end
@@ -1,9 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  describe Spotlight::AttachmentUploader do
4
- let(:mounter) { Spotlight::Attachment.new(id: '5') }
5
4
  subject(:attachment_uploader) { described_class.new(mounter, 'mounted_as') }
6
5
 
6
+ let(:mounter) { Spotlight::Attachment.new(id: '5') }
7
+
7
8
  describe '#store_dir' do
8
9
  let(:store_dir) { attachment_uploader.store_dir }
9
10
 
@@ -1,9 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  describe Spotlight::FeaturedImageUploader do
4
- let(:mounter) { FactoryBot.create(:featured_image) }
5
4
  subject(:featured_image_uploader) { described_class.new(mounter, 'mounted_as') }
6
5
 
6
+ let(:mounter) { FactoryBot.create(:featured_image) }
7
+
7
8
  describe '#extension_whitelist' do
8
9
  it 'is the configured array of approved extension to be uploaded' do
9
10
  expect(featured_image_uploader.extension_whitelist).to eq Spotlight::Engine.config.allowed_upload_extensions
@@ -5,6 +5,7 @@ describe 'shared/_analytics', type: :view do
5
5
  render
6
6
  expect(rendered).to be_empty
7
7
  end
8
+
8
9
  it 'renders the GA script tag if the web property id is configured' do
9
10
  allow(Spotlight::Engine.config).to receive(:ga_web_property_id).and_return('XYZ-234')
10
11
  allow(Spotlight::Engine.config).to receive(:ga_anonymize_ip).and_return(true)
@@ -49,13 +49,13 @@ describe 'shared/_exhibit_navbar', type: :view do
49
49
 
50
50
  it 'does not display links to feature pages if none are defined' do
51
51
  render
52
- expect(response).to_not have_link 'Curated Features'
52
+ expect(response).not_to have_link 'Curated Features'
53
53
  end
54
54
 
55
55
  it 'does not display links to feature pages that are not published' do
56
56
  unpublished_feature_page
57
57
  render
58
- expect(response).to_not have_link 'Curated Features'
58
+ expect(response).not_to have_link 'Curated Features'
59
59
  end
60
60
 
61
61
  it "links to the browse index if there's a published search" do
@@ -90,13 +90,13 @@ describe 'shared/_exhibit_navbar', type: :view do
90
90
 
91
91
  it 'does not link to the about page if no about page exists' do
92
92
  render
93
- expect(response).to_not have_link 'About'
93
+ expect(response).not_to have_link 'About'
94
94
  end
95
95
 
96
96
  it 'does not to the about page if none are published' do
97
97
  unpublished_about_page
98
98
  render
99
- expect(response).to_not have_link 'About'
99
+ expect(response).not_to have_link 'About'
100
100
  end
101
101
 
102
102
  it "marks the about button as active if we're on an about page" do
@@ -115,7 +115,7 @@ describe 'shared/_exhibit_navbar', type: :view do
115
115
  it 'does not include the search bar when the exhibit is not searchable' do
116
116
  expect(current_exhibit).to receive(:searchable?).and_return(false)
117
117
  render
118
- expect(response).to_not have_content 'Search Bar'
118
+ expect(response).not_to have_content 'Search Bar'
119
119
  end
120
120
 
121
121
  it 'does not include any navigation menu items that are not configured' do
@@ -8,6 +8,8 @@ describe 'shared/_masthead', type: :view do
8
8
  stub_template 'shared/_exhibit_navbar.html.erb' => 'navbar'
9
9
  allow(view).to receive_messages(current_exhibit: exhibit,
10
10
  current_masthead: masthead,
11
+ masthead_heading_content: exhibit.title,
12
+ masthead_subheading_content: exhibit.subtitle,
11
13
  resource_masthead?: false)
12
14
  end
13
15
 
@@ -19,7 +21,7 @@ describe 'shared/_masthead', type: :view do
19
21
 
20
22
  context 'for an exhibit without a subtitle' do
21
23
  before do
22
- exhibit.update(subtitle: nil)
24
+ allow(view).to receive_messages(masthead_subheading_content: nil)
23
25
  end
24
26
 
25
27
  it 'does not include the subtitle' do
@@ -68,6 +70,7 @@ describe 'shared/_masthead', type: :view do
68
70
  render
69
71
  expect(rendered).to have_selector '.masthead.resource-masthead'
70
72
  end
73
+
71
74
  it 'puts the navbar before the title' do
72
75
  render
73
76
  expect(rendered.index('navbar')).to be < rendered.index(exhibit.title)
@@ -2,6 +2,7 @@
2
2
 
3
3
  describe 'shared/_user_util_links', type: :view do
4
4
  let(:current_exhibit) { FactoryBot.create(:exhibit) }
5
+
5
6
  before do
6
7
  allow(view).to receive(:blacklight_config).and_return(Blacklight::Configuration.new)
7
8
  allow(view).to receive(:current_user).and_return(current_user)
@@ -11,6 +12,7 @@ describe 'shared/_user_util_links', type: :view do
11
12
 
12
13
  describe 'when user is not logged in' do
13
14
  let(:current_user) { nil }
15
+
14
16
  it 'renders the links' do
15
17
  render
16
18
  expect(rendered).to have_link 'Sign in'
@@ -20,28 +22,31 @@ describe 'shared/_user_util_links', type: :view do
20
22
 
21
23
  describe 'when show_contact_form is false' do
22
24
  let(:current_user) { nil }
25
+
23
26
  before do
24
27
  allow(view).to receive_messages(show_contact_form?: false)
25
28
  end
26
29
 
27
30
  it 'does not render the feedback link' do
28
31
  render
29
- expect(rendered).to_not have_link 'Feedback'
32
+ expect(rendered).not_to have_link 'Feedback'
30
33
  end
31
34
  end
32
35
 
33
36
  describe 'when user is logged in' do
34
37
  let(:current_user) { Spotlight::Engine.user_class.new }
38
+
35
39
  it 'renders the links' do
36
40
  render
37
41
  expect(rendered).to have_link 'Feedback'
38
- expect(rendered).to_not have_link 'Exhibit dashboard'
42
+ expect(rendered).not_to have_link 'Exhibit dashboard'
39
43
  expect(rendered).to have_link 'Sign out'
40
44
  end
41
45
  end
42
46
 
43
47
  describe 'when user is a curator' do
44
48
  let(:current_user) { Spotlight::Engine.user_class.new }
49
+
45
50
  before do
46
51
  allow(view).to receive(:can?).with(:manage, Spotlight::Site).and_return(false)
47
52
  allow(view).to receive(:can?).with(:update, current_exhibit).and_return(false)
@@ -59,6 +64,7 @@ describe 'shared/_user_util_links', type: :view do
59
64
 
60
65
  describe 'when user is an admin' do
61
66
  let(:current_user) { Spotlight::Engine.user_class.new }
67
+
62
68
  before do
63
69
  allow(view).to receive(:can?).with(:manage, Spotlight::Site).and_return(false)
64
70
  allow(view).to receive(:can?).with(:update, current_exhibit).and_return(true)
@@ -76,6 +82,7 @@ describe 'shared/_user_util_links', type: :view do
76
82
 
77
83
  describe 'when user is a site-wide admin' do
78
84
  let(:current_user) { Spotlight::Engine.user_class.new }
85
+
79
86
  before do
80
87
  allow(view).to receive(:can?).with(:manage, Spotlight::Site).and_return(true)
81
88
  allow(view).to receive(:can?).with(:update, current_exhibit).and_return(true)