blacklight-spotlight 3.4.0 → 3.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (306) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/spotlight/roles_controller.rb +1 -1
  3. data/lib/spotlight/version.rb +1 -1
  4. metadata +6 -610
  5. data/spec/controllers/application_controller_spec.rb +0 -30
  6. data/spec/controllers/spotlight/about_pages_controller_spec.rb +0 -239
  7. data/spec/controllers/spotlight/admin_users_controller_spec.rb +0 -53
  8. data/spec/controllers/spotlight/appearances_controller_spec.rb +0 -88
  9. data/spec/controllers/spotlight/application_controller_spec.rb +0 -11
  10. data/spec/controllers/spotlight/attachments_controller_spec.rb +0 -28
  11. data/spec/controllers/spotlight/browse_controller_spec.rb +0 -133
  12. data/spec/controllers/spotlight/bulk_actions_controller_spec.rb +0 -124
  13. data/spec/controllers/spotlight/bulk_updates_controller_spec.rb +0 -77
  14. data/spec/controllers/spotlight/catalog_controller_spec.rb +0 -552
  15. data/spec/controllers/spotlight/confirmations_controller_spec.rb +0 -38
  16. data/spec/controllers/spotlight/contact_email_controller_spec.rb +0 -65
  17. data/spec/controllers/spotlight/contact_forms_controller_spec.rb +0 -38
  18. data/spec/controllers/spotlight/contacts_controller_spec.rb +0 -103
  19. data/spec/controllers/spotlight/custom_fields_controller_spec.rb +0 -62
  20. data/spec/controllers/spotlight/custom_search_fields_controller_spec.rb +0 -62
  21. data/spec/controllers/spotlight/dashboards_controller_spec.rb +0 -68
  22. data/spec/controllers/spotlight/exhibits_controller_spec.rb +0 -216
  23. data/spec/controllers/spotlight/feature_pages_controller_spec.rb +0 -251
  24. data/spec/controllers/spotlight/featured_images_controller_spec.rb +0 -77
  25. data/spec/controllers/spotlight/filters_controller_spec.rb +0 -72
  26. data/spec/controllers/spotlight/groups_controller_spec.rb +0 -103
  27. data/spec/controllers/spotlight/home_pages_controller_spec.rb +0 -126
  28. data/spec/controllers/spotlight/job_trackers_controller_spec.rb +0 -37
  29. data/spec/controllers/spotlight/languages_controller_spec.rb +0 -70
  30. data/spec/controllers/spotlight/metadata_configurations_controller_spec.rb +0 -93
  31. data/spec/controllers/spotlight/pages_controller_spec.rb +0 -50
  32. data/spec/controllers/spotlight/resources/csv_upload_controller_spec.rb +0 -71
  33. data/spec/controllers/spotlight/resources/upload_controller_spec.rb +0 -55
  34. data/spec/controllers/spotlight/resources_controller_spec.rb +0 -85
  35. data/spec/controllers/spotlight/roles_controller_spec.rb +0 -141
  36. data/spec/controllers/spotlight/search_configurations_controller_spec.rb +0 -141
  37. data/spec/controllers/spotlight/searches_controller_spec.rb +0 -195
  38. data/spec/controllers/spotlight/sites_controller_spec.rb +0 -67
  39. data/spec/controllers/spotlight/solr_controller_spec.rb +0 -116
  40. data/spec/controllers/spotlight/tags_controller_spec.rb +0 -56
  41. data/spec/controllers/spotlight/translations_controller_spec.rb +0 -132
  42. data/spec/controllers/spotlight/versions_controller_spec.rb +0 -56
  43. data/spec/controllers/spotlight/view_configurations_controller_spec.rb +0 -35
  44. data/spec/examples.txt +0 -1515
  45. data/spec/factories/bulk_updates.rb +0 -21
  46. data/spec/factories/contact_emails.rb +0 -8
  47. data/spec/factories/contact_images.rb +0 -8
  48. data/spec/factories/contacts.rb +0 -11
  49. data/spec/factories/custom_fields.rb +0 -9
  50. data/spec/factories/custom_search_fields.rb +0 -9
  51. data/spec/factories/exhibit_thumbnails.rb +0 -8
  52. data/spec/factories/exhibits.rb +0 -17
  53. data/spec/factories/featured_images.rb +0 -16
  54. data/spec/factories/group.rb +0 -17
  55. data/spec/factories/job_trackers.rb +0 -11
  56. data/spec/factories/language.rb +0 -8
  57. data/spec/factories/main_navigation.rb +0 -9
  58. data/spec/factories/pages.rb +0 -34
  59. data/spec/factories/resources.rb +0 -14
  60. data/spec/factories/roles.rb +0 -9
  61. data/spec/factories/searches.rb +0 -33
  62. data/spec/factories/tags.rb +0 -14
  63. data/spec/factories/translation.rb +0 -8
  64. data/spec/factories/users.rb +0 -50
  65. data/spec/features/about_page_spec.rb +0 -46
  66. data/spec/features/add_contacts_spec.rb +0 -63
  67. data/spec/features/add_custom_field_metadata_spec.rb +0 -88
  68. data/spec/features/add_iiif_manifest_spec.rb +0 -46
  69. data/spec/features/add_items_spec.rb +0 -135
  70. data/spec/features/autocomplete_typeahead_spec.rb +0 -89
  71. data/spec/features/browse_category_admin_spec.rb +0 -163
  72. data/spec/features/browse_category_navigation_spec.rb +0 -44
  73. data/spec/features/browse_category_spec.rb +0 -158
  74. data/spec/features/bulk_actions_spec.rb +0 -72
  75. data/spec/features/catalog_spec.rb +0 -57
  76. data/spec/features/confirm_email_spec.rb +0 -21
  77. data/spec/features/create_exhibit_spec.rb +0 -65
  78. data/spec/features/create_page_spec.rb +0 -21
  79. data/spec/features/dashboard_spec.rb +0 -34
  80. data/spec/features/edit_contact_spec.rb +0 -21
  81. data/spec/features/edit_search_fields_spec.rb +0 -79
  82. data/spec/features/exhibit_masthead_spec.rb +0 -112
  83. data/spec/features/exhibit_themes_spec.rb +0 -30
  84. data/spec/features/exhibits/add_tags_spec.rb +0 -35
  85. data/spec/features/exhibits/administration_spec.rb +0 -141
  86. data/spec/features/exhibits/custom_metadata_fields_spec.rb +0 -97
  87. data/spec/features/exhibits/custom_search_fields_spec.rb +0 -55
  88. data/spec/features/exhibits/edit_metadata_fields_spec.rb +0 -49
  89. data/spec/features/exhibits/language_create_edit_spec.rb +0 -59
  90. data/spec/features/exhibits/translation_editing_spec.rb +0 -463
  91. data/spec/features/exhibits_index_spec.rb +0 -55
  92. data/spec/features/feature_page_spec.rb +0 -155
  93. data/spec/features/home_page_spec.rb +0 -102
  94. data/spec/features/import_exhibit_spec.rb +0 -58
  95. data/spec/features/item_admin_spec.rb +0 -59
  96. data/spec/features/javascript/about_page_admin_spec.rb +0 -21
  97. data/spec/features/javascript/block_controls_spec.rb +0 -42
  98. data/spec/features/javascript/blocks/browse_group_categories_block_spec.rb +0 -64
  99. data/spec/features/javascript/blocks/featured_browse_categories_block_spec.rb +0 -46
  100. data/spec/features/javascript/blocks/featured_pages_block_spec.rb +0 -61
  101. data/spec/features/javascript/blocks/link_to_search_block_spec.rb +0 -46
  102. data/spec/features/javascript/blocks/rule_block_spec.rb +0 -23
  103. data/spec/features/javascript/blocks/search_result_block_spec.rb +0 -47
  104. data/spec/features/javascript/blocks/solr_documents_block_spec.rb +0 -232
  105. data/spec/features/javascript/blocks/solr_documents_carousel_block_spec.rb +0 -29
  106. data/spec/features/javascript/blocks/uploaded_items_block_spec.rb +0 -94
  107. data/spec/features/javascript/browse_group_admin_spec.rb +0 -45
  108. data/spec/features/javascript/edit_in_place_spec.rb +0 -93
  109. data/spec/features/javascript/feature_page_admin_spec.rb +0 -140
  110. data/spec/features/javascript/home_page_edit_spec.rb +0 -34
  111. data/spec/features/javascript/locale_selector_spec.rb +0 -66
  112. data/spec/features/javascript/metadata_admin_spec.rb +0 -41
  113. data/spec/features/javascript/multi_image_select_spec.rb +0 -50
  114. data/spec/features/javascript/reindex_monitor_spec.rb +0 -23
  115. data/spec/features/javascript/roles_admin_spec.rb +0 -38
  116. data/spec/features/javascript/search_config_admin_spec.rb +0 -140
  117. data/spec/features/javascript/search_context_spec.rb +0 -88
  118. data/spec/features/main_navigation_spec.rb +0 -96
  119. data/spec/features/metadata_admin_spec.rb +0 -18
  120. data/spec/features/report_a_problem_spec.rb +0 -62
  121. data/spec/features/site_masthead_spec.rb +0 -91
  122. data/spec/features/site_users_management_spec.rb +0 -74
  123. data/spec/features/slideshow_spec.rb +0 -21
  124. data/spec/features/translation_scope_spec.rb +0 -27
  125. data/spec/fixtures/800x600.png +0 -0
  126. data/spec/fixtures/avatar.png +0 -0
  127. data/spec/fixtures/bulk-update-template.csv +0 -57
  128. data/spec/fixtures/csv-upload-fixture.csv +0 -4
  129. data/spec/fixtures/gk446cj2442-manifest.json +0 -58
  130. data/spec/fixtures/iiif_responses.rb +0 -312
  131. data/spec/fixtures/json-upload-fixture.json +0 -3
  132. data/spec/fixtures/sample_solr_documents.yml +0 -9385
  133. data/spec/fixtures/updated-bulk-update-template-no-cols.csv +0 -4
  134. data/spec/fixtures/updated-bulk-update-template-w-tags.csv +0 -4
  135. data/spec/fixtures/updated-bulk-update-template.csv +0 -4
  136. data/spec/helpers/spotlight/application_helper_spec.rb +0 -196
  137. data/spec/helpers/spotlight/browse_helper_spec.rb +0 -13
  138. data/spec/helpers/spotlight/crop_helper_spec.rb +0 -11
  139. data/spec/helpers/spotlight/crud_link_helpers_spec.rb +0 -163
  140. data/spec/helpers/spotlight/languages_helper_spec.rb +0 -79
  141. data/spec/helpers/spotlight/main_app_helpers_spec.rb +0 -101
  142. data/spec/helpers/spotlight/masthead_helper_spec.rb +0 -51
  143. data/spec/helpers/spotlight/meta_helper_spec.rb +0 -33
  144. data/spec/helpers/spotlight/navbar_helper_spec.rb +0 -24
  145. data/spec/helpers/spotlight/pages_helper_spec.rb +0 -123
  146. data/spec/helpers/spotlight/roles_helper_spec.rb +0 -7
  147. data/spec/helpers/spotlight/search_configurations_helper_spec.rb +0 -23
  148. data/spec/helpers/spotlight/title_helper_spec.rb +0 -64
  149. data/spec/helpers/spotlight/translations_helper_spec.rb +0 -16
  150. data/spec/i18n_spec.rb +0 -27
  151. data/spec/jobs/spotlight/add_tags_job_spec.rb +0 -34
  152. data/spec/jobs/spotlight/add_uploads_from_csv_spec.rb +0 -58
  153. data/spec/jobs/spotlight/change_visibility_job_spec.rb +0 -30
  154. data/spec/jobs/spotlight/default_thumbnail_job_spec.rb +0 -14
  155. data/spec/jobs/spotlight/process_bulk_updates_csv_job_spec.rb +0 -86
  156. data/spec/jobs/spotlight/reindex_exhibit_job_spec.rb +0 -43
  157. data/spec/jobs/spotlight/reindex_job_spec.rb +0 -79
  158. data/spec/jobs/spotlight/remove_tags_job_spec.rb +0 -39
  159. data/spec/jobs/spotlight/rename_sidecar_field_job_spec.rb +0 -33
  160. data/spec/lib/migration/iiif_spec.rb +0 -91
  161. data/spec/lib/migration/page_language_spec.rb +0 -25
  162. data/spec/lib/spotlight/catalog_spec.rb +0 -0
  163. data/spec/lib/spotlight/controller_spec.rb +0 -102
  164. data/spec/lib/spotlight/upload_field_config_spec.rb +0 -40
  165. data/spec/mailers/spotlight/indexing_complete_mailer_spec.rb +0 -42
  166. data/spec/models/sir_trevor_rails/block_spec.rb +0 -72
  167. data/spec/models/sir_trevor_rails/blocks/browse_block_spec.rb +0 -42
  168. data/spec/models/sir_trevor_rails/blocks/browse_group_categories_block_spec.rb +0 -41
  169. data/spec/models/sir_trevor_rails/blocks/featured_pages_block_spec.rb +0 -50
  170. data/spec/models/sir_trevor_rails/blocks/search_results_block_spec.rb +0 -23
  171. data/spec/models/sir_trevor_rails/blocks/solr_documents_block_spec.rb +0 -59
  172. data/spec/models/sir_trevor_rails/blocks/textable_spec.rb +0 -42
  173. data/spec/models/solr_document_spec.rb +0 -214
  174. data/spec/models/spotlight/ability_spec.rb +0 -118
  175. data/spec/models/spotlight/about_page_spec.rb +0 -19
  176. data/spec/models/spotlight/access_controls_enforcement_search_builder_spec.rb +0 -82
  177. data/spec/models/spotlight/analytics/ga_spec.rb +0 -22
  178. data/spec/models/spotlight/background_job_progress_spec.rb +0 -137
  179. data/spec/models/spotlight/blacklight_configuration_spec.rb +0 -649
  180. data/spec/models/spotlight/browse_category_search_builder_spec.rb +0 -51
  181. data/spec/models/spotlight/contact_email_spec.rb +0 -48
  182. data/spec/models/spotlight/contact_form_spec.rb +0 -94
  183. data/spec/models/spotlight/contact_image_spec.rb +0 -11
  184. data/spec/models/spotlight/contact_spec.rb +0 -38
  185. data/spec/models/spotlight/custom_field_spec.rb +0 -204
  186. data/spec/models/spotlight/custom_search_field_spec.rb +0 -56
  187. data/spec/models/spotlight/custom_translation_extension_spec.rb +0 -24
  188. data/spec/models/spotlight/exhibit_spec.rb +0 -383
  189. data/spec/models/spotlight/exhibit_thumbnail_spec.rb +0 -10
  190. data/spec/models/spotlight/feature_page_spec.rb +0 -87
  191. data/spec/models/spotlight/featured_image_spec.rb +0 -110
  192. data/spec/models/spotlight/field_metadata_spec.rb +0 -58
  193. data/spec/models/spotlight/filter_spec.rb +0 -19
  194. data/spec/models/spotlight/group_spec.rb +0 -19
  195. data/spec/models/spotlight/home_page_spec.rb +0 -38
  196. data/spec/models/spotlight/language_spec.rb +0 -42
  197. data/spec/models/spotlight/main_navigation_spec.rb +0 -19
  198. data/spec/models/spotlight/masthead_spec.rb +0 -45
  199. data/spec/models/spotlight/page_configurations_spec.rb +0 -45
  200. data/spec/models/spotlight/page_spec.rb +0 -293
  201. data/spec/models/spotlight/resource_spec.rb +0 -137
  202. data/spec/models/spotlight/resources/iiif_harvester_spec.rb +0 -52
  203. data/spec/models/spotlight/resources/iiif_manifest_spec.rb +0 -178
  204. data/spec/models/spotlight/resources/iiif_service_spec.rb +0 -57
  205. data/spec/models/spotlight/resources/upload_spec.rb +0 -71
  206. data/spec/models/spotlight/resources/web_spec.rb +0 -25
  207. data/spec/models/spotlight/role_spec.rb +0 -51
  208. data/spec/models/spotlight/search_spec.rb +0 -125
  209. data/spec/models/spotlight/site_spec.rb +0 -9
  210. data/spec/models/spotlight/sitemap_spec.rb +0 -113
  211. data/spec/models/spotlight/solr_document/atomic_updates_spec.rb +0 -56
  212. data/spec/models/spotlight/solr_document/uploaded_resource_spec.rb +0 -38
  213. data/spec/models/spotlight/solr_document_sidecar_spec.rb +0 -48
  214. data/spec/models/spotlight/user_spec.rb +0 -26
  215. data/spec/models/translation_spec.rb +0 -26
  216. data/spec/presenters/spotlight/iiif_manifest_presenter_spec.rb +0 -132
  217. data/spec/routing/spotlight/exhibit_catalog_spec.rb +0 -34
  218. data/spec/routing/spotlight/featured_images_spec.rb +0 -23
  219. data/spec/routing/spotlight/pages_routing_spec.rb +0 -42
  220. data/spec/services/spotlight/bulk_updates_csv_template_service_spec.rb +0 -26
  221. data/spec/services/spotlight/carrierwave_file_resolver_spec.rb +0 -16
  222. data/spec/services/spotlight/clone_translated_page_from_locale_spec.rb +0 -30
  223. data/spec/services/spotlight/etl/context_spec.rb +0 -66
  224. data/spec/services/spotlight/etl/executor_spec.rb +0 -149
  225. data/spec/services/spotlight/etl/pipeline_spec.rb +0 -22
  226. data/spec/services/spotlight/etl/solr_loader_spec.rb +0 -76
  227. data/spec/services/spotlight/etl/step_spec.rb +0 -70
  228. data/spec/services/spotlight/exhibit_import_export_service_spec.rb +0 -569
  229. data/spec/services/spotlight/iiif_resource_resolver_spec.rb +0 -94
  230. data/spec/services/spotlight/invite_users_service_spec.rb +0 -47
  231. data/spec/spec_helper.rb +0 -146
  232. data/spec/support/controllers/engine_helpers.rb +0 -9
  233. data/spec/support/disable_friendly_id_deprecation_warnings.rb +0 -11
  234. data/spec/support/features/capybara_default_max_wait_metadata_helper.rb +0 -20
  235. data/spec/support/features/test_features_helpers.rb +0 -92
  236. data/spec/support/helpers/controller_level_helpers.rb +0 -25
  237. data/spec/support/stub_iiif_response.rb +0 -26
  238. data/spec/support/views/test_view_helpers.rb +0 -21
  239. data/spec/test_app_templates/Gemfile.extra +0 -2
  240. data/spec/test_app_templates/carrierwave.rb +0 -8
  241. data/spec/test_app_templates/catalog_controller.rb +0 -108
  242. data/spec/test_app_templates/fixture.css +0 -0
  243. data/spec/test_app_templates/fixture.png +0 -0
  244. data/spec/test_app_templates/lib/generators/test_app_generator.rb +0 -71
  245. data/spec/test_app_templates/spotlight_test.rake +0 -14
  246. data/spec/uploaders/spotlight/attachment_uploader_spec.rb +0 -27
  247. data/spec/uploaders/spotlight/featured_image_uploader_spec.rb +0 -33
  248. data/spec/views/shared/_analytics.html.erb_spec.rb +0 -17
  249. data/spec/views/shared/_exhibit_navbar.html.erb_spec.rb +0 -127
  250. data/spec/views/shared/_header_navbar.html.erb_spec.rb +0 -12
  251. data/spec/views/shared/_masthead.html.erb_spec.rb +0 -91
  252. data/spec/views/shared/_user_util_links.html.erb_spec.rb +0 -102
  253. data/spec/views/spotlight/about_pages/_empty.html.erb_spec.rb +0 -28
  254. data/spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb +0 -24
  255. data/spec/views/spotlight/about_pages/index.html.erb_spec.rb +0 -69
  256. data/spec/views/spotlight/browse/_search.html.erb_spec.rb +0 -30
  257. data/spec/views/spotlight/browse/index.html.erb_spec.rb +0 -22
  258. data/spec/views/spotlight/browse/show.html.erb_spec.rb +0 -65
  259. data/spec/views/spotlight/catalog/_edit_default.html.erb_spec.rb +0 -63
  260. data/spec/views/spotlight/catalog/admin.html.erb_spec.rb +0 -39
  261. data/spec/views/spotlight/catalog/edit.html.erb_spec.rb +0 -20
  262. data/spec/views/spotlight/contacts/edit.html.erb_spec.rb +0 -43
  263. data/spec/views/spotlight/dashboards/_analytics.html.erb_spec.rb +0 -45
  264. data/spec/views/spotlight/dashboards/_reindexing_activity.html.erb_spec.rb +0 -94
  265. data/spec/views/spotlight/dashboards/analytics.html.erb_spec.rb +0 -33
  266. data/spec/views/spotlight/exhibits/_exhibit_card.html.erb_spec.rb +0 -46
  267. data/spec/views/spotlight/exhibits/_form.html.erb_spec.rb +0 -38
  268. data/spec/views/spotlight/exhibits/edit.html.erb_spec.rb +0 -29
  269. data/spec/views/spotlight/exhibits/index.html.erb_spec.rb +0 -140
  270. data/spec/views/spotlight/feature_pages/_empty.html.erb_spec.rb +0 -28
  271. data/spec/views/spotlight/feature_pages/_sidebar.html.erb_spec.rb +0 -45
  272. data/spec/views/spotlight/featured_images/_form.html.erb_spec.rb +0 -32
  273. data/spec/views/spotlight/featured_images/_upload_form.html.erb_spec.rb +0 -32
  274. data/spec/views/spotlight/home_pages/_empty.html.erb_spec.rb +0 -28
  275. data/spec/views/spotlight/home_pages/_sidebar.html.erb_spec.rb +0 -12
  276. data/spec/views/spotlight/job_trackers/show.html.erb_spec.rb +0 -65
  277. data/spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb +0 -30
  278. data/spec/views/spotlight/metadata_configurations/edit.html.erb_spec.rb +0 -23
  279. data/spec/views/spotlight/pages/_form.html.erb_spec.rb +0 -20
  280. data/spec/views/spotlight/pages/edit.html.erb_spec.rb +0 -68
  281. data/spec/views/spotlight/pages/index.html.erb_spec.rb +0 -42
  282. data/spec/views/spotlight/pages/new.html.erb_spec.rb +0 -21
  283. data/spec/views/spotlight/pages/show.html.erb_spec.rb +0 -84
  284. data/spec/views/spotlight/resources/_external_resources_form.html.erb_spec.rb +0 -36
  285. data/spec/views/spotlight/resources/new.html.erb_spec.rb +0 -30
  286. data/spec/views/spotlight/roles/index.html.erb_spec.rb +0 -30
  287. data/spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb +0 -58
  288. data/spec/views/spotlight/search_configurations/_facets.html.erb_spec.rb +0 -54
  289. data/spec/views/spotlight/search_configurations/_search_fields.html.erb_spec.rb +0 -54
  290. data/spec/views/spotlight/search_configurations/_sort.html.erb_spec.rb +0 -40
  291. data/spec/views/spotlight/searches/_search.html.erb_spec.rb +0 -37
  292. data/spec/views/spotlight/searches/edit.html.erb_spec.rb +0 -40
  293. data/spec/views/spotlight/searches/index.html.erb_spec.rb +0 -33
  294. data/spec/views/spotlight/sir_trevor/blocks/_browse_block.html.erb_spec.rb +0 -20
  295. data/spec/views/spotlight/sir_trevor/blocks/_iframe_block.html.erb_spec.rb +0 -20
  296. data/spec/views/spotlight/sir_trevor/blocks/_link_to_search_block.html.erb_spec.rb +0 -20
  297. data/spec/views/spotlight/sir_trevor/blocks/_rule_block.html.erb_spec.rb +0 -10
  298. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb_spec.rb +0 -43
  299. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb_spec.rb +0 -34
  300. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb +0 -53
  301. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb_spec.rb +0 -54
  302. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb_spec.rb +0 -42
  303. data/spec/views/spotlight/sites/edit_exhibits.html.erb_spec.rb +0 -25
  304. data/spec/views/spotlight/tags/index.html.erb_spec.rb +0 -27
  305. data/spec/views/spotlight/translations/_import.html.erb_spec.rb +0 -24
  306. data/spec/views/spotlight/translations/_page.html.erb_spec.rb +0 -76
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'spotlight/catalog/edit.html.erb', type: :view do
4
- let(:blacklight_config) { Blacklight::Configuration.new }
5
-
6
- let(:document) { stub_model(::SolrDocument) }
7
-
8
- before do
9
- allow(view).to receive_messages(blacklight_config: blacklight_config)
10
- allow(view).to receive_messages(current_exhibit: stub_model(Spotlight::Exhibit))
11
- assign(:document, document)
12
- allow(view).to receive(:document_counter)
13
- allow(view).to receive(:render_document_partials)
14
- render
15
- end
16
-
17
- it 'renders a document div' do
18
- expect(rendered).to have_css '#document.document'
19
- end
20
- end
@@ -1,43 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'spotlight/contacts/edit.html.erb' do
4
- let(:exhibit) { FactoryBot.create(:exhibit) }
5
-
6
- let(:contact) do
7
- Spotlight::Contact.new exhibit: exhibit
8
- end
9
-
10
- before do
11
- allow(view).to receive(:exhibit_contacts_path).and_return('/exhibit/1/contacts')
12
- allow(view).to receive(:exhibit_about_pages_path).and_return('/exhibit/admin/about')
13
- allow(view).to receive(:contact_images_path).and_return('/contact_images')
14
- assign(:contact, contact)
15
- assign(:exhibit, exhibit)
16
- allow(view).to receive(:current_exhibit).and_return(exhibit)
17
- # Assumes that the second backend is the "Simple"
18
- I18n.backend.backends.second.store_translations(
19
- :en,
20
- spotlight: {
21
- contacts: {
22
- form: {
23
- new_field: {
24
- placeholder: 'place'
25
- },
26
- source: {
27
- remote: {
28
- help: 'Help!'
29
- }
30
- }
31
- }
32
- }
33
- }
34
- )
35
- end
36
-
37
- it 'has an IIIF crop' do
38
- render
39
- expect(rendered).to have_content 'Upload an image'
40
- expect(rendered).to have_css '.form-text', text: 'Help!'
41
- expect(rendered).to have_selector '#contact_avatar_attributes_iiif_cropper'
42
- end
43
- end
@@ -1,45 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'spotlight/dashboards/_analytics.html.erb', type: :view do
4
- let(:current_exhibit) { FactoryBot.create(:exhibit) }
5
- let(:ga_data) { OpenStruct.new(pageviews: 1, users: 2, sessions: 3) }
6
- let(:page_data) { [OpenStruct.new(pageTitle: 'title', pagePath: '/path', pageviews: '123')] }
7
-
8
- before do
9
- allow(view).to receive_messages(current_exhibit: current_exhibit, exhibit_root_path: '/some/path')
10
- allow(current_exhibit).to receive(:analytics).and_return(ga_data)
11
- allow(current_exhibit).to receive(:page_analytics).and_return(page_data)
12
- end
13
-
14
- it 'uses the exhibit_root_path for analytics' do
15
- expect(current_exhibit).to receive(:analytics).with(1.month, '/some/path').and_return(ga_data)
16
- expect(current_exhibit).to receive(:page_analytics).with(1.month, '/some/path').and_return(page_data)
17
- render
18
- end
19
-
20
- it 'has header' do
21
- render
22
- expect(rendered).to have_content 'User activity over the past month'
23
- end
24
-
25
- it 'has metric labels' do
26
- render
27
- expect(rendered).to have_content 'visitors'
28
- expect(rendered).to have_content 'unique visits'
29
- expect(rendered).to have_content 'page views'
30
- end
31
-
32
- it 'has metric values' do
33
- render
34
- expect(rendered).to have_selector '.value.pageviews', text: 1
35
- expect(rendered).to have_selector '.value.users', text: 2
36
- expect(rendered).to have_selector '.value.sessions', text: 3
37
- end
38
-
39
- it 'has page-level data' do
40
- render
41
- expect(rendered).to have_content 'Most popular pages'
42
- expect(rendered).to have_link 'title', href: '/path'
43
- expect(rendered).to have_content '123'
44
- end
45
- end
@@ -1,94 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'spotlight/dashboards/_reindexing_activity.html.erb', type: :view do
4
- let(:p) { 'spotlight/dashboards/reindexing_activity' }
5
- let(:exhibit) { FactoryBot.build(:exhibit) }
6
-
7
- before do
8
- assign(:recent_reindexing, recent_reindexing)
9
- allow(view).to receive(:current_exhibit).and_return(exhibit)
10
- end
11
-
12
- context 'the reindexing log is empty' do
13
- let(:recent_reindexing) { [] }
14
-
15
- before do
16
- render p
17
- end
18
-
19
- it 'displays the section header' do
20
- expect(rendered).to have_css('h2', text: 'Recent item indexing activity')
21
- end
22
-
23
- it 'displays an explanatory message when there are no reindexing attempts in the log' do
24
- expect(rendered).to have_content 'There has been no reindexing activity'
25
- end
26
- end
27
-
28
- context 'the reindexing log has entries' do
29
- # recent reindexing entries should be sorted by start_time in descending order, so mock that behavior
30
- let(:recent_reindexing) do
31
- [
32
- FactoryBot.build(:job_tracker, status: 'enqueued'),
33
- FactoryBot.build(:job_tracker, status: 'completed', data: { progress: 10 }),
34
- FactoryBot.build(:job_tracker, status: 'in_progress', created_at: Time.zone.parse('January 10, 2017 23:00')),
35
- FactoryBot.build(:job_tracker, status: 'completed', data: { progress: 100 }),
36
- FactoryBot.build(:job_tracker, status: 'failed', data: { progress: 10 })
37
- ]
38
- end
39
-
40
- before do
41
- render p
42
- end
43
-
44
- it 'displays the correct localized column headings when there are reindexing attempts in the log' do
45
- expect(rendered).to have_css('table.table-striped th.col-3', text: 'Date', count: 1)
46
- expect(rendered).to have_css('table.table-striped th.col-3', text: 'Requested by', count: 1)
47
- expect(rendered).to have_css('table.table-striped th.col-1', text: 'Items indexed', count: 1)
48
- expect(rendered).to have_css('table.table-striped th.col-3', text: 'Elapsed time', count: 1)
49
- expect(rendered).to have_css('table.table-striped th.col-2', text: 'Status', count: 1)
50
- end
51
-
52
- it 'formats the start time correctly' do
53
- expect(rendered).to have_css('table.table-striped td', text: 'January 05, 2017 23:00', count: 4)
54
- expect(rendered).to have_css('table.table-striped td', text: 'January 10, 2017 23:00', count: 1)
55
- end
56
-
57
- it 'displays the user that initiated the reindexing' do
58
- expect(rendered).to have_css('table.table-striped td', text: /user\d+@example.com/, count: 5)
59
- end
60
-
61
- it 'displays the count of reindexed items' do
62
- expect(rendered).to have_css('table.table-striped td', text: /^10$/, count: 2)
63
- expect(rendered).to have_css('table.table-striped td', text: /^100$/, count: 1)
64
- end
65
-
66
- it 'displays the duration of completed reindexing attempts' do
67
- expect(rendered).to have_css('table.table-striped td', text: '5 minutes', count: 3)
68
- end
69
-
70
- it 'displays the status of the reindexing attempt using localized text' do
71
- expect(rendered).to have_css('table.table-striped td', text: 'Not yet started', count: 1)
72
- expect(rendered).to have_css('table.table-striped td', text: 'Successful', count: 2)
73
- expect(rendered).to have_css('table.table-striped td', text: 'In progress', count: 1)
74
- expect(rendered).to have_css('table.table-striped td', text: 'Failed', count: 1)
75
- end
76
- end
77
-
78
- context 'a reindexing log entry has a null user' do
79
- let(:recent_reindexing) do
80
- [FactoryBot.build(:job_tracker, status: 'completed', data: { progress: 10 }, user: nil)]
81
- end
82
-
83
- it 'displays blank in the user field and renders without error' do
84
- expect { render p }.not_to raise_error
85
-
86
- # we expect one blank table cell for the user, and values for everything else
87
- expect(rendered).to have_css('table.table-striped td', text: /^$/, count: 1)
88
- expect(rendered).to have_css('table.table-striped td', text: 'January 05, 2017 23:00', count: 1)
89
- expect(rendered).to have_css('table.table-striped td', text: /^10$/, count: 1)
90
- expect(rendered).to have_css('table.table-striped td', text: '5 minutes', count: 1)
91
- expect(rendered).to have_css('table.table-striped td', text: 'Successful', count: 1)
92
- end
93
- end
94
- end
@@ -1,33 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'spotlight/dashboards/analytics.html.erb', type: :view do
4
- let(:current_exhibit) { FactoryBot.create(:exhibit) }
5
-
6
- before do
7
- allow(view).to receive_messages(current_exhibit: current_exhibit, exhibit_root_path: '/some/path')
8
- end
9
-
10
- it 'has a header' do
11
- render
12
- expect(rendered).to have_selector '.page-header', text: 'Curation'
13
- expect(rendered).to have_selector '.page-header small', text: 'Analytics'
14
- end
15
-
16
- it 'has directions for configuring analytics' do
17
- render
18
- expect(rendered).to have_link 'configure an analytics provider'
19
- end
20
-
21
- context 'with a configured analytics integration' do
22
- before do
23
- allow(current_exhibit).to receive(:analytics_provider).and_return(double(Spotlight::Analytics::Ga, enabled?: true))
24
- stub_template 'spotlight/dashboards/_analytics.html.erb' => 'Analytics data'
25
- end
26
-
27
- it 'has analytics data' do
28
- render
29
-
30
- expect(rendered).to have_content 'Analytics data'
31
- end
32
- end
33
- end
@@ -1,46 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'spotlight/exhibits/_exhibit_card.html.erb', type: :view do
4
- let(:exhibit) { FactoryBot.create(:exhibit) }
5
- let(:p) { 'spotlight/exhibits/exhibit_card' }
6
-
7
- before do
8
- allow(view).to receive_messages(exhibit_path: '/')
9
- end
10
-
11
- context 'for an exhibit without a thumbnail' do
12
- before do
13
- exhibit.update(thumbnail_id: nil)
14
- end
15
-
16
- it 'has a placeholder thumbnail' do
17
- render p, exhibit: exhibit
18
-
19
- expect(rendered).to have_selector 'img.default-thumbnail'
20
- end
21
- end
22
-
23
- it 'has a thumbnail' do
24
- render p, exhibit: exhibit
25
-
26
- expect(rendered).to have_selector 'img'
27
- end
28
-
29
- it 'has a title' do
30
- render p, exhibit: exhibit
31
-
32
- expect(rendered).to have_selector '.card-title', text: exhibit.title
33
- end
34
-
35
- context 'for an unpublished exhibit' do
36
- before do
37
- exhibit.update(published: false)
38
- end
39
-
40
- it 'has an unpublished banner' do
41
- render p, exhibit: exhibit
42
-
43
- expect(rendered).to have_selector '.badge.unpublished', text: 'Unpublished'
44
- end
45
- end
46
- end
@@ -1,38 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'spotlight/exhibits/_form', type: :view do
4
- let(:exhibit) { FactoryBot.create(:exhibit) }
5
-
6
- before do
7
- assign(:exhibit, exhibit)
8
- end
9
-
10
- context 'when using default language' do
11
- before do
12
- allow(view).to receive_messages(
13
- default_language?: true
14
- )
15
- end
16
-
17
- it 'allows an editable title' do
18
- render
19
- expect(rendered).to have_selector 'input[name="exhibit[title]"]'
20
- expect(rendered).not_to have_selector 'input[name="exhibit[title]"][disabled="disabled"]'
21
- expect(rendered).not_to have_content 'This field is not editable in the current language. Switch to the default language to edit it.'
22
- end
23
- end
24
-
25
- context 'when using non-default language' do
26
- before do
27
- allow(view).to receive_messages(
28
- default_language?: false
29
- )
30
- end
31
-
32
- it 'disables editable title with help text' do
33
- render
34
- expect(rendered).to have_selector 'input[name="exhibit[title]"][disabled="disabled"]'
35
- expect(rendered).to have_content 'This field is not editable in the current language. Switch to the default language to edit it.'
36
- end
37
- end
38
- end
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'spotlight/exhibits/edit', type: :view do
4
- let(:exhibit) { FactoryBot.create(:exhibit) }
5
-
6
- before do
7
- assign(:exhibit, exhibit)
8
- allow(view).to receive_messages(
9
- current_exhibit: exhibit,
10
- can?: true,
11
- import_exhibit_path: '/',
12
- get_exhibit_path: '/',
13
- exhibit_filters_path: '/',
14
- exhibit_languages_path: '/',
15
- add_exhibit_language_dropdown_options: [],
16
- default_language?: true
17
- )
18
- end
19
-
20
- it 'renders the edit page form' do
21
- render
22
-
23
- expect(rendered).to have_selector "form[action=\"#{spotlight.exhibit_path(exhibit)}\"]"
24
- expect(rendered).to have_selector '.alert.alert-danger'
25
- expect(rendered).to have_content 'This action is irreversible'
26
- expect(rendered).to have_link 'Export data', href: spotlight.edit_exhibit_path(exhibit, anchor: 'export')
27
- expect(rendered).to have_button 'Import data'
28
- end
29
- end
@@ -1,140 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'spotlight/exhibits/index', type: :view do
4
- let(:exhibits) { Spotlight::Exhibit.none }
5
- let(:published_exhibits) { exhibits.published.page(1) }
6
-
7
- let(:ability) { ::Ability.new(user) }
8
- let(:user) { Spotlight::Engine.user_class.new }
9
-
10
- before do
11
- assign(:exhibits, exhibits)
12
- assign(:published_exhibits, published_exhibits)
13
- allow(view).to receive_messages(exhibits_path: '/', exhibit_path: '/', current_user: user, current_ability: ability)
14
- end
15
-
16
- context 'with published exhibits' do
17
- let!(:exhibit_a) { FactoryBot.create(:exhibit, published: true) }
18
- let!(:exhibit_b) { FactoryBot.create(:exhibit, published: true) }
19
- let!(:exhibit_c) { FactoryBot.create(:exhibit, published: false) }
20
-
21
- let(:exhibits) { Spotlight::Exhibit.all }
22
-
23
- it 'renders the published exhibits' do
24
- render
25
-
26
- expect(rendered).to have_selector('.exhibit-card', count: 2)
27
- expect(rendered).to have_text exhibit_a.title
28
- expect(rendered).to have_text exhibit_b.title
29
- expect(rendered).not_to have_text exhibit_c.title
30
-
31
- expect(rendered).not_to include 'Private exhibits'
32
- end
33
-
34
- it 'does not include the tab bar' do
35
- render
36
-
37
- expect(rendered).not_to have_selector '.nav-tabs'
38
- end
39
-
40
- it 'does not include tags controls' do
41
- render
42
-
43
- expect(rendered).not_to have_selector '.tags'
44
- end
45
-
46
- it 'does not include pagination controls' do
47
- render
48
-
49
- expect(rendered).not_to have_selector '.pager'
50
- end
51
-
52
- context 'with tagged exhibits' do
53
- before do
54
- exhibit_a.tag_list = ['a']
55
- exhibit_b.tag_list = ['a']
56
- exhibit_c.tag_list = ['b']
57
-
58
- exhibit_a.save
59
- exhibit_b.save
60
- exhibit_c.save
61
- end
62
-
63
- it 'filters by tags' do
64
- render
65
-
66
- expect(rendered).to have_link 'All'
67
- expect(rendered).to have_link 'a'
68
- expect(rendered).to have_link 'b'
69
- end
70
- end
71
-
72
- context 'with paginated exhibits' do
73
- let(:published_exhibits) { exhibits.published.page(1).per(1) }
74
-
75
- it 'renders pagination controls' do
76
- render
77
-
78
- expect(rendered).to have_selector '.pagination'
79
- expect(rendered).to have_link 'Next', href: '/?page=2'
80
- end
81
- end
82
-
83
- context 'with an exhibit admin' do
84
- let(:user) { FactoryBot.create(:exhibit_admin) }
85
-
86
- it 'includes a tab with the exhibits curated by the user' do
87
- render
88
-
89
- expect(rendered).to have_selector '.nav-tabs'
90
- expect(rendered).to have_link 'Your exhibits'
91
- expect(rendered).to have_text user.exhibits.first.title
92
- end
93
-
94
- it 'does not include a tab for unpublished exhibits' do
95
- render
96
-
97
- expect(rendered).to have_selector '.nav-tabs'
98
- expect(rendered).not_to have_link 'Unpublished exhibits'
99
- end
100
- end
101
-
102
- context 'with a site admin' do
103
- let(:user) { FactoryBot.create(:site_admin) }
104
-
105
- before do
106
- allow(view).to receive_messages(can?: true, new_exhibit_path: '/exhibits/new')
107
- end
108
-
109
- it 'includes a tab with unpublished exhibits' do
110
- render
111
-
112
- expect(rendered).to have_selector '.nav-tabs'
113
- expect(rendered).to have_link 'Unpublished exhibits'
114
- expect(rendered).to have_text exhibit_c.title
115
- end
116
- end
117
- end
118
-
119
- context 'with an authorized user' do
120
- let(:user) { FactoryBot.build(:site_admin) }
121
-
122
- before do
123
- allow(view).to receive_messages(can?: true,
124
- new_exhibit_path: '/exhibits/new')
125
- end
126
-
127
- it 'gives instructions for getting started' do
128
- render
129
-
130
- expect(rendered).to include 'Welcome to Spotlight!'
131
- expect(rendered).to have_link 'Create Exhibit', href: '/exhibits/new'
132
- end
133
-
134
- it 'has a sidebar with a button to create a new exhibit' do
135
- render
136
-
137
- expect(view.content_for(:sidebar)).to have_selector '.btn', text: 'Create a new exhibit'
138
- end
139
- end
140
- end
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'spotlight/feature_pages/_empty.html.erb', type: :view do
4
- let(:can?) { false }
5
-
6
- before do
7
- allow(view).to receive_messages(can?: can?)
8
- render
9
- end
10
-
11
- describe 'when a user cannot edit' do
12
- it 'does not render an ordered list of steps' do
13
- expect(rendered).not_to have_css('ol')
14
- end
15
- end
16
-
17
- describe 'when a user can edit' do
18
- let(:can?) { true }
19
-
20
- it 'renders a heading' do
21
- expect(rendered).to have_css('h2', text: 'Building this feature page')
22
- end
23
-
24
- it 'renders an ordered list of steps' do
25
- expect(rendered).to have_css('ol li', count: 6)
26
- end
27
- end
28
- end
@@ -1,45 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'spotlight/feature_pages/_sidebar.html.erb', type: :view do
4
- let(:exhibit) { FactoryBot.create(:exhibit) }
5
- let!(:parent1) { FactoryBot.create(:feature_page, exhibit: exhibit, title: 'Parent Page') }
6
- let!(:parent2) { FactoryBot.create(:feature_page, exhibit: exhibit, title: 'Two') }
7
- let!(:child1) { FactoryBot.create(:feature_page, exhibit: exhibit, parent_page: parent1, title: 'Three', weight: 4) }
8
- let!(:child2) { FactoryBot.create(:feature_page, exhibit: exhibit, parent_page: parent2, title: 'Four') }
9
- let!(:child3) { FactoryBot.create(:feature_page, exhibit: exhibit, parent_page: parent1, title: 'Five', weight: 2) }
10
- let!(:child4) { FactoryBot.create(:feature_page, exhibit: exhibit, parent_page: parent1, title: 'Six', published: false) }
11
- let!(:child5) { FactoryBot.create(:feature_page, exhibit: FactoryBot.create(:exhibit), title: 'Seven') }
12
-
13
- before do
14
- allow(view).to receive_messages(current_exhibit: parent1.exhibit)
15
- allow(view).to receive_messages(feature_page_path: '/feature/9')
16
- assign(:exhibit, parent1.exhibit)
17
- end
18
-
19
- it 'renders a list of pages for a parent page' do
20
- assign(:page, parent1)
21
- allow(view).to receive(:current_page?).and_return(true, false)
22
- render
23
- # Checking that they are sorted accoding to weight
24
- expect(rendered).to have_selector 'li.active', text: 'Parent Page'
25
- expect(rendered).to have_selector 'ol.sidenav li:nth-child(1) a', text: 'Five'
26
- expect(rendered).to have_selector 'ol.sidenav li:nth-child(2) a', text: 'Three'
27
- expect(rendered).to have_selector 'li a', text: 'Two' # a different parent page
28
- expect(rendered).to have_link 'Four' # different parent
29
- expect(rendered).not_to have_link 'Six' # not published
30
- expect(rendered).not_to have_link 'Seven' # different exhibit
31
- end
32
-
33
- it 'renders a list of pages from a child page' do
34
- assign(:page, child1)
35
- render
36
- # Checking that they are sorted accoding to weight
37
- expect(rendered).to have_selector 'ol.sidenav', count: 1
38
- expect(rendered).to have_selector 'li', text: 'Parent Page'
39
- expect(rendered).to have_selector 'ol.sidenav li:nth-child(1) a', text: 'Five'
40
- expect(rendered).to have_selector 'ol.sidenav li:nth-child(2) a', text: 'Three'
41
- expect(rendered).to have_content 'Two' # not selected page
42
- expect(rendered).to have_link 'Four' # different parent
43
- expect(rendered).not_to have_link 'Six' # not published
44
- end
45
- end
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'spotlight/featured_images/_form', type: :view do
4
- let(:exhibit) { FactoryBot.create(:exhibit, :with_thumbnail) }
5
- let(:builder) { ActionView::Helpers::FormBuilder.new 'z', exhibit.thumbnail, view, {} }
6
-
7
- before do
8
- assign(:exhibit, exhibit)
9
- allow(builder).to receive_messages(file_field_without_bootstrap: nil)
10
- allow(view).to receive_messages(exhibit_thumbnails_path: nil)
11
- I18n.backend.backends.second.store_translations(
12
- :en,
13
- spotlight: {
14
- featured_images: {
15
- form: {
16
- source: {
17
- remote: {
18
- help: 'Help!'
19
- }
20
- }
21
- }
22
- }
23
- }
24
- )
25
- end
26
-
27
- it 'has help block' do
28
- render partial: 'spotlight/featured_images/form',
29
- locals: { f: builder, initial_crop_selection: [], crop_type: :thumbnail }
30
- expect(rendered).to have_css '.form-text', text: 'Help!'
31
- end
32
- end
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'spotlight/featured_images/_upload_form', type: :view do
4
- let(:exhibit) { FactoryBot.create(:exhibit, :with_thumbnail) }
5
- let(:builder) { ActionView::Helpers::FormBuilder.new 'z', exhibit.thumbnail, view, {} }
6
-
7
- before do
8
- assign(:exhibit, exhibit)
9
- allow(builder).to receive_messages(file_field_without_bootstrap: nil)
10
- allow(view).to receive_messages(exhibit_thumbnails_path: nil)
11
- I18n.backend.backends.second.store_translations(
12
- :en,
13
- spotlight: {
14
- featured_images: {
15
- upload_form: {
16
- source: {
17
- remote: {
18
- help: 'Help!'
19
- }
20
- }
21
- }
22
- }
23
- }
24
- )
25
- end
26
-
27
- it 'has help block' do
28
- render partial: 'spotlight/featured_images/upload_form',
29
- locals: { f: builder, initial_crop_selection: [], crop_type: :thumbnail }
30
- expect(rendered).to have_css '.form-text', text: 'Help!'
31
- end
32
- end
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'spotlight/home_pages/_empty.html.erb', type: :view do
4
- describe 'resource providers' do
5
- before do
6
- allow(view).to receive_messages(current_exhibit: FactoryBot.create(:exhibit),
7
- can?: true,
8
- edit_exhibit_path: '/',
9
- edit_exhibit_appearance_path: '/',
10
- exhibit_roles_path: '/',
11
- admin_exhibit_catalog_path: '/',
12
- edit_exhibit_metadata_configuration_path: '/',
13
- edit_exhibit_search_configuration_path: '/')
14
- end
15
-
16
- it 'has a list item with a link to add items when there are resource partials configured' do
17
- allow(Spotlight::Engine.config).to receive_messages(resource_partials: [true])
18
- render
19
- expect(rendered).to have_css('li a', text: 'Curation > Items')
20
- end
21
-
22
- it 'does not have a list item with a link to add items when there are no resource partials configured' do
23
- allow(Spotlight::Engine.config).to receive_messages(resource_partials: [])
24
- render
25
- expect(rendered).not_to have_css('li a', text: 'Curation > Items')
26
- end
27
- end
28
- end
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'spotlight/home_pages/_sidebar.html.erb', type: :view do
4
- before do
5
- stub_template 'catalog/_search_sidebar.html.erb' => 'Search Sidebar'
6
- end
7
-
8
- it 'has a search sidebar' do
9
- render
10
- expect(rendered).to match 'Search Sidebar'
11
- end
12
- end