blacklight-spotlight 3.4.0 → 3.4.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (275) 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 -579
  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/features/about_page_spec.rb +0 -46
  46. data/spec/features/add_contacts_spec.rb +0 -63
  47. data/spec/features/add_custom_field_metadata_spec.rb +0 -88
  48. data/spec/features/add_iiif_manifest_spec.rb +0 -46
  49. data/spec/features/add_items_spec.rb +0 -135
  50. data/spec/features/autocomplete_typeahead_spec.rb +0 -89
  51. data/spec/features/browse_category_admin_spec.rb +0 -163
  52. data/spec/features/browse_category_navigation_spec.rb +0 -44
  53. data/spec/features/browse_category_spec.rb +0 -158
  54. data/spec/features/bulk_actions_spec.rb +0 -72
  55. data/spec/features/catalog_spec.rb +0 -57
  56. data/spec/features/confirm_email_spec.rb +0 -21
  57. data/spec/features/create_exhibit_spec.rb +0 -65
  58. data/spec/features/create_page_spec.rb +0 -21
  59. data/spec/features/dashboard_spec.rb +0 -34
  60. data/spec/features/edit_contact_spec.rb +0 -21
  61. data/spec/features/edit_search_fields_spec.rb +0 -79
  62. data/spec/features/exhibit_masthead_spec.rb +0 -112
  63. data/spec/features/exhibit_themes_spec.rb +0 -30
  64. data/spec/features/exhibits/add_tags_spec.rb +0 -35
  65. data/spec/features/exhibits/administration_spec.rb +0 -141
  66. data/spec/features/exhibits/custom_metadata_fields_spec.rb +0 -97
  67. data/spec/features/exhibits/custom_search_fields_spec.rb +0 -55
  68. data/spec/features/exhibits/edit_metadata_fields_spec.rb +0 -49
  69. data/spec/features/exhibits/language_create_edit_spec.rb +0 -59
  70. data/spec/features/exhibits/translation_editing_spec.rb +0 -463
  71. data/spec/features/exhibits_index_spec.rb +0 -55
  72. data/spec/features/feature_page_spec.rb +0 -155
  73. data/spec/features/home_page_spec.rb +0 -102
  74. data/spec/features/import_exhibit_spec.rb +0 -58
  75. data/spec/features/item_admin_spec.rb +0 -59
  76. data/spec/features/javascript/about_page_admin_spec.rb +0 -21
  77. data/spec/features/javascript/block_controls_spec.rb +0 -42
  78. data/spec/features/javascript/blocks/browse_group_categories_block_spec.rb +0 -64
  79. data/spec/features/javascript/blocks/featured_browse_categories_block_spec.rb +0 -46
  80. data/spec/features/javascript/blocks/featured_pages_block_spec.rb +0 -61
  81. data/spec/features/javascript/blocks/link_to_search_block_spec.rb +0 -46
  82. data/spec/features/javascript/blocks/rule_block_spec.rb +0 -23
  83. data/spec/features/javascript/blocks/search_result_block_spec.rb +0 -47
  84. data/spec/features/javascript/blocks/solr_documents_block_spec.rb +0 -232
  85. data/spec/features/javascript/blocks/solr_documents_carousel_block_spec.rb +0 -29
  86. data/spec/features/javascript/blocks/uploaded_items_block_spec.rb +0 -94
  87. data/spec/features/javascript/browse_group_admin_spec.rb +0 -45
  88. data/spec/features/javascript/edit_in_place_spec.rb +0 -93
  89. data/spec/features/javascript/feature_page_admin_spec.rb +0 -140
  90. data/spec/features/javascript/home_page_edit_spec.rb +0 -34
  91. data/spec/features/javascript/locale_selector_spec.rb +0 -66
  92. data/spec/features/javascript/metadata_admin_spec.rb +0 -41
  93. data/spec/features/javascript/multi_image_select_spec.rb +0 -50
  94. data/spec/features/javascript/reindex_monitor_spec.rb +0 -23
  95. data/spec/features/javascript/roles_admin_spec.rb +0 -38
  96. data/spec/features/javascript/search_config_admin_spec.rb +0 -140
  97. data/spec/features/javascript/search_context_spec.rb +0 -88
  98. data/spec/features/main_navigation_spec.rb +0 -96
  99. data/spec/features/metadata_admin_spec.rb +0 -18
  100. data/spec/features/report_a_problem_spec.rb +0 -62
  101. data/spec/features/site_masthead_spec.rb +0 -91
  102. data/spec/features/site_users_management_spec.rb +0 -74
  103. data/spec/features/slideshow_spec.rb +0 -21
  104. data/spec/features/translation_scope_spec.rb +0 -27
  105. data/spec/helpers/spotlight/application_helper_spec.rb +0 -196
  106. data/spec/helpers/spotlight/browse_helper_spec.rb +0 -13
  107. data/spec/helpers/spotlight/crop_helper_spec.rb +0 -11
  108. data/spec/helpers/spotlight/crud_link_helpers_spec.rb +0 -163
  109. data/spec/helpers/spotlight/languages_helper_spec.rb +0 -79
  110. data/spec/helpers/spotlight/main_app_helpers_spec.rb +0 -101
  111. data/spec/helpers/spotlight/masthead_helper_spec.rb +0 -51
  112. data/spec/helpers/spotlight/meta_helper_spec.rb +0 -33
  113. data/spec/helpers/spotlight/navbar_helper_spec.rb +0 -24
  114. data/spec/helpers/spotlight/pages_helper_spec.rb +0 -123
  115. data/spec/helpers/spotlight/roles_helper_spec.rb +0 -7
  116. data/spec/helpers/spotlight/search_configurations_helper_spec.rb +0 -23
  117. data/spec/helpers/spotlight/title_helper_spec.rb +0 -64
  118. data/spec/helpers/spotlight/translations_helper_spec.rb +0 -16
  119. data/spec/i18n_spec.rb +0 -27
  120. data/spec/jobs/spotlight/add_tags_job_spec.rb +0 -34
  121. data/spec/jobs/spotlight/add_uploads_from_csv_spec.rb +0 -58
  122. data/spec/jobs/spotlight/change_visibility_job_spec.rb +0 -30
  123. data/spec/jobs/spotlight/default_thumbnail_job_spec.rb +0 -14
  124. data/spec/jobs/spotlight/process_bulk_updates_csv_job_spec.rb +0 -86
  125. data/spec/jobs/spotlight/reindex_exhibit_job_spec.rb +0 -43
  126. data/spec/jobs/spotlight/reindex_job_spec.rb +0 -79
  127. data/spec/jobs/spotlight/remove_tags_job_spec.rb +0 -39
  128. data/spec/jobs/spotlight/rename_sidecar_field_job_spec.rb +0 -33
  129. data/spec/lib/migration/iiif_spec.rb +0 -91
  130. data/spec/lib/migration/page_language_spec.rb +0 -25
  131. data/spec/lib/spotlight/catalog_spec.rb +0 -0
  132. data/spec/lib/spotlight/controller_spec.rb +0 -102
  133. data/spec/lib/spotlight/upload_field_config_spec.rb +0 -40
  134. data/spec/mailers/spotlight/indexing_complete_mailer_spec.rb +0 -42
  135. data/spec/models/sir_trevor_rails/block_spec.rb +0 -72
  136. data/spec/models/sir_trevor_rails/blocks/browse_block_spec.rb +0 -42
  137. data/spec/models/sir_trevor_rails/blocks/browse_group_categories_block_spec.rb +0 -41
  138. data/spec/models/sir_trevor_rails/blocks/featured_pages_block_spec.rb +0 -50
  139. data/spec/models/sir_trevor_rails/blocks/search_results_block_spec.rb +0 -23
  140. data/spec/models/sir_trevor_rails/blocks/solr_documents_block_spec.rb +0 -59
  141. data/spec/models/sir_trevor_rails/blocks/textable_spec.rb +0 -42
  142. data/spec/models/solr_document_spec.rb +0 -214
  143. data/spec/models/spotlight/ability_spec.rb +0 -118
  144. data/spec/models/spotlight/about_page_spec.rb +0 -19
  145. data/spec/models/spotlight/access_controls_enforcement_search_builder_spec.rb +0 -82
  146. data/spec/models/spotlight/analytics/ga_spec.rb +0 -22
  147. data/spec/models/spotlight/background_job_progress_spec.rb +0 -137
  148. data/spec/models/spotlight/blacklight_configuration_spec.rb +0 -649
  149. data/spec/models/spotlight/browse_category_search_builder_spec.rb +0 -51
  150. data/spec/models/spotlight/contact_email_spec.rb +0 -48
  151. data/spec/models/spotlight/contact_form_spec.rb +0 -94
  152. data/spec/models/spotlight/contact_image_spec.rb +0 -11
  153. data/spec/models/spotlight/contact_spec.rb +0 -38
  154. data/spec/models/spotlight/custom_field_spec.rb +0 -204
  155. data/spec/models/spotlight/custom_search_field_spec.rb +0 -56
  156. data/spec/models/spotlight/custom_translation_extension_spec.rb +0 -24
  157. data/spec/models/spotlight/exhibit_spec.rb +0 -383
  158. data/spec/models/spotlight/exhibit_thumbnail_spec.rb +0 -10
  159. data/spec/models/spotlight/feature_page_spec.rb +0 -87
  160. data/spec/models/spotlight/featured_image_spec.rb +0 -110
  161. data/spec/models/spotlight/field_metadata_spec.rb +0 -58
  162. data/spec/models/spotlight/filter_spec.rb +0 -19
  163. data/spec/models/spotlight/group_spec.rb +0 -19
  164. data/spec/models/spotlight/home_page_spec.rb +0 -38
  165. data/spec/models/spotlight/language_spec.rb +0 -42
  166. data/spec/models/spotlight/main_navigation_spec.rb +0 -19
  167. data/spec/models/spotlight/masthead_spec.rb +0 -45
  168. data/spec/models/spotlight/page_configurations_spec.rb +0 -45
  169. data/spec/models/spotlight/page_spec.rb +0 -293
  170. data/spec/models/spotlight/resource_spec.rb +0 -137
  171. data/spec/models/spotlight/resources/iiif_harvester_spec.rb +0 -52
  172. data/spec/models/spotlight/resources/iiif_manifest_spec.rb +0 -178
  173. data/spec/models/spotlight/resources/iiif_service_spec.rb +0 -57
  174. data/spec/models/spotlight/resources/upload_spec.rb +0 -71
  175. data/spec/models/spotlight/resources/web_spec.rb +0 -25
  176. data/spec/models/spotlight/role_spec.rb +0 -51
  177. data/spec/models/spotlight/search_spec.rb +0 -125
  178. data/spec/models/spotlight/site_spec.rb +0 -9
  179. data/spec/models/spotlight/sitemap_spec.rb +0 -113
  180. data/spec/models/spotlight/solr_document/atomic_updates_spec.rb +0 -56
  181. data/spec/models/spotlight/solr_document/uploaded_resource_spec.rb +0 -38
  182. data/spec/models/spotlight/solr_document_sidecar_spec.rb +0 -48
  183. data/spec/models/spotlight/user_spec.rb +0 -26
  184. data/spec/models/translation_spec.rb +0 -26
  185. data/spec/presenters/spotlight/iiif_manifest_presenter_spec.rb +0 -132
  186. data/spec/routing/spotlight/exhibit_catalog_spec.rb +0 -34
  187. data/spec/routing/spotlight/featured_images_spec.rb +0 -23
  188. data/spec/routing/spotlight/pages_routing_spec.rb +0 -42
  189. data/spec/services/spotlight/bulk_updates_csv_template_service_spec.rb +0 -26
  190. data/spec/services/spotlight/carrierwave_file_resolver_spec.rb +0 -16
  191. data/spec/services/spotlight/clone_translated_page_from_locale_spec.rb +0 -30
  192. data/spec/services/spotlight/etl/context_spec.rb +0 -66
  193. data/spec/services/spotlight/etl/executor_spec.rb +0 -149
  194. data/spec/services/spotlight/etl/pipeline_spec.rb +0 -22
  195. data/spec/services/spotlight/etl/solr_loader_spec.rb +0 -76
  196. data/spec/services/spotlight/etl/step_spec.rb +0 -70
  197. data/spec/services/spotlight/exhibit_import_export_service_spec.rb +0 -569
  198. data/spec/services/spotlight/iiif_resource_resolver_spec.rb +0 -94
  199. data/spec/services/spotlight/invite_users_service_spec.rb +0 -47
  200. data/spec/spec_helper.rb +0 -146
  201. data/spec/support/controllers/engine_helpers.rb +0 -9
  202. data/spec/support/disable_friendly_id_deprecation_warnings.rb +0 -11
  203. data/spec/support/features/capybara_default_max_wait_metadata_helper.rb +0 -20
  204. data/spec/support/features/test_features_helpers.rb +0 -92
  205. data/spec/support/helpers/controller_level_helpers.rb +0 -25
  206. data/spec/support/stub_iiif_response.rb +0 -26
  207. data/spec/support/views/test_view_helpers.rb +0 -21
  208. data/spec/test_app_templates/Gemfile.extra +0 -2
  209. data/spec/test_app_templates/carrierwave.rb +0 -8
  210. data/spec/test_app_templates/catalog_controller.rb +0 -108
  211. data/spec/test_app_templates/fixture.css +0 -0
  212. data/spec/test_app_templates/fixture.png +0 -0
  213. data/spec/test_app_templates/lib/generators/test_app_generator.rb +0 -71
  214. data/spec/test_app_templates/spotlight_test.rake +0 -14
  215. data/spec/uploaders/spotlight/attachment_uploader_spec.rb +0 -27
  216. data/spec/uploaders/spotlight/featured_image_uploader_spec.rb +0 -33
  217. data/spec/views/shared/_analytics.html.erb_spec.rb +0 -17
  218. data/spec/views/shared/_exhibit_navbar.html.erb_spec.rb +0 -127
  219. data/spec/views/shared/_header_navbar.html.erb_spec.rb +0 -12
  220. data/spec/views/shared/_masthead.html.erb_spec.rb +0 -91
  221. data/spec/views/shared/_user_util_links.html.erb_spec.rb +0 -102
  222. data/spec/views/spotlight/about_pages/_empty.html.erb_spec.rb +0 -28
  223. data/spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb +0 -24
  224. data/spec/views/spotlight/about_pages/index.html.erb_spec.rb +0 -69
  225. data/spec/views/spotlight/browse/_search.html.erb_spec.rb +0 -30
  226. data/spec/views/spotlight/browse/index.html.erb_spec.rb +0 -22
  227. data/spec/views/spotlight/browse/show.html.erb_spec.rb +0 -65
  228. data/spec/views/spotlight/catalog/_edit_default.html.erb_spec.rb +0 -63
  229. data/spec/views/spotlight/catalog/admin.html.erb_spec.rb +0 -39
  230. data/spec/views/spotlight/catalog/edit.html.erb_spec.rb +0 -20
  231. data/spec/views/spotlight/contacts/edit.html.erb_spec.rb +0 -43
  232. data/spec/views/spotlight/dashboards/_analytics.html.erb_spec.rb +0 -45
  233. data/spec/views/spotlight/dashboards/_reindexing_activity.html.erb_spec.rb +0 -94
  234. data/spec/views/spotlight/dashboards/analytics.html.erb_spec.rb +0 -33
  235. data/spec/views/spotlight/exhibits/_exhibit_card.html.erb_spec.rb +0 -46
  236. data/spec/views/spotlight/exhibits/_form.html.erb_spec.rb +0 -38
  237. data/spec/views/spotlight/exhibits/edit.html.erb_spec.rb +0 -29
  238. data/spec/views/spotlight/exhibits/index.html.erb_spec.rb +0 -140
  239. data/spec/views/spotlight/feature_pages/_empty.html.erb_spec.rb +0 -28
  240. data/spec/views/spotlight/feature_pages/_sidebar.html.erb_spec.rb +0 -45
  241. data/spec/views/spotlight/featured_images/_form.html.erb_spec.rb +0 -32
  242. data/spec/views/spotlight/featured_images/_upload_form.html.erb_spec.rb +0 -32
  243. data/spec/views/spotlight/home_pages/_empty.html.erb_spec.rb +0 -28
  244. data/spec/views/spotlight/home_pages/_sidebar.html.erb_spec.rb +0 -12
  245. data/spec/views/spotlight/job_trackers/show.html.erb_spec.rb +0 -65
  246. data/spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb +0 -30
  247. data/spec/views/spotlight/metadata_configurations/edit.html.erb_spec.rb +0 -23
  248. data/spec/views/spotlight/pages/_form.html.erb_spec.rb +0 -20
  249. data/spec/views/spotlight/pages/edit.html.erb_spec.rb +0 -68
  250. data/spec/views/spotlight/pages/index.html.erb_spec.rb +0 -42
  251. data/spec/views/spotlight/pages/new.html.erb_spec.rb +0 -21
  252. data/spec/views/spotlight/pages/show.html.erb_spec.rb +0 -84
  253. data/spec/views/spotlight/resources/_external_resources_form.html.erb_spec.rb +0 -36
  254. data/spec/views/spotlight/resources/new.html.erb_spec.rb +0 -30
  255. data/spec/views/spotlight/roles/index.html.erb_spec.rb +0 -30
  256. data/spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb +0 -58
  257. data/spec/views/spotlight/search_configurations/_facets.html.erb_spec.rb +0 -54
  258. data/spec/views/spotlight/search_configurations/_search_fields.html.erb_spec.rb +0 -54
  259. data/spec/views/spotlight/search_configurations/_sort.html.erb_spec.rb +0 -40
  260. data/spec/views/spotlight/searches/_search.html.erb_spec.rb +0 -37
  261. data/spec/views/spotlight/searches/edit.html.erb_spec.rb +0 -40
  262. data/spec/views/spotlight/searches/index.html.erb_spec.rb +0 -33
  263. data/spec/views/spotlight/sir_trevor/blocks/_browse_block.html.erb_spec.rb +0 -20
  264. data/spec/views/spotlight/sir_trevor/blocks/_iframe_block.html.erb_spec.rb +0 -20
  265. data/spec/views/spotlight/sir_trevor/blocks/_link_to_search_block.html.erb_spec.rb +0 -20
  266. data/spec/views/spotlight/sir_trevor/blocks/_rule_block.html.erb_spec.rb +0 -10
  267. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb_spec.rb +0 -43
  268. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb_spec.rb +0 -34
  269. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb +0 -53
  270. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb_spec.rb +0 -54
  271. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb_spec.rb +0 -42
  272. data/spec/views/spotlight/sites/edit_exhibits.html.erb_spec.rb +0 -25
  273. data/spec/views/spotlight/tags/index.html.erb_spec.rb +0 -27
  274. data/spec/views/spotlight/translations/_import.html.erb_spec.rb +0 -24
  275. data/spec/views/spotlight/translations/_page.html.erb_spec.rb +0 -76
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'Add tags to an item in an exhibit', type: :feature do
4
- let(:exhibit) { FactoryBot.create(:exhibit) }
5
- let(:curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
6
- let(:custom_field) { FactoryBot.build_stubbed(:custom_field, exhibit: exhibit) }
7
-
8
- before do
9
- login_as(curator)
10
- end
11
-
12
- it 'changes and display the of tags' do
13
- visit spotlight.exhibit_solr_document_path(exhibit, 'dq287tq6352')
14
-
15
- expect(page).to have_link 'Edit'
16
-
17
- click_on 'Edit'
18
-
19
- fill_in 'Tags', with: 'One, Two and a half, Three'
20
-
21
- click_on 'Save changes'
22
-
23
- visit spotlight.exhibit_solr_document_path(exhibit, 'dq287tq6352')
24
-
25
- within('dd.blacklight-exhibit_tags') do
26
- expect(page).to have_selector 'a', text: 'One'
27
- expect(page).to have_selector 'a', text: 'Two and a half'
28
- expect(page).to have_selector 'a', text: 'Three'
29
- end
30
-
31
- click_on 'Two and a half'
32
-
33
- expect(page).to have_content 'Remove constraint Exhibit Tags: Two and a half'
34
- end
35
- end
@@ -1,141 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'Exhibit Administration', type: :feature do
4
- let(:exhibit) { FactoryBot.create(:exhibit) }
5
- let(:admin) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
6
- let(:hidden_input_id_0) { 'exhibit_contact_emails_attributes_0_id' }
7
- let(:email_id_0) { 'exhibit_contact_email_0' }
8
- let(:email_address_0) { 'admin@example.com' }
9
- let(:hidden_input_id_1) { 'exhibit_contact_emails_attributes_1_id' }
10
- let(:hidden_input_val_1) { '2' }
11
- let(:email_id_1) { 'exhibit_contact_email_1' }
12
- let(:email_address_1) { 'admin2@example.com' }
13
-
14
- before { login_as admin }
15
-
16
- describe 'Contact Emails' do
17
- it 'has breadcrumbs' do
18
- visit spotlight.edit_exhibit_path(exhibit)
19
- expect(page).to have_breadcrumbs 'Home', 'Configuration', 'General'
20
- end
21
-
22
- it 'has a blank input field when there are no contacts yet' do
23
- visit spotlight.edit_exhibit_path(exhibit)
24
- expect(page).to have_css('input.exhibit-contact')
25
- expect(find_field(email_id_0).value).to be_blank
26
- end
27
-
28
- it 'stores and retreives a contact email address' do
29
- visit spotlight.edit_exhibit_path(exhibit)
30
- fill_in email_id_0, with: email_address_0
31
- click_button 'Save changes'
32
- expect(page).to have_content('The exhibit was successfully updated.')
33
- visit spotlight.edit_exhibit_path(exhibit)
34
- expect(find_field(email_id_0).value).to eq email_address_0
35
- end
36
-
37
- it "has new inputs added when clicking on the 'add contact' button", js: true do
38
- # Exhibit administration edit
39
- visit spotlight.edit_exhibit_path(exhibit)
40
-
41
- # fill in first email field
42
- fill_in email_id_0, with: email_address_0
43
-
44
- # Additonal blank fields should not exist
45
- expect(page).not_to have_css("input##{email_id_1}")
46
- # click the + (add contact) button
47
- find('#another-email').click
48
- # An additional blank field should exist now
49
- expect(page).to have_css("input##{email_id_1}")
50
- expect(find_field(email_id_1).value).to be_blank
51
-
52
- # fill in the second email field
53
- fill_in email_id_1, with: email_address_1
54
- click_button 'Save changes'
55
-
56
- expect(page).to have_content('The exhibit was successfully updated.')
57
- visit spotlight.edit_exhibit_path(exhibit)
58
-
59
- expect(find_field(email_id_0).value).to eq email_address_0
60
- expect(find_field(email_id_1).value).to eq email_address_1
61
- end
62
-
63
- it 'updates the aria-labels properly', js: true do
64
- visit spotlight.edit_exhibit_path(exhibit)
65
-
66
- expect(find_field(email_id_0)['aria-label']).to eq 'Recipient email 1'
67
- find('#another-email').click
68
- expect(find_field(email_id_1)['aria-label']).to eq 'Recipient email 2'
69
- end
70
-
71
- it 'allows deletion of contact email addresses', js: true do
72
- # go to edit page, fill in first email field, click the + (add contact) button, fill in the second email field, click save.
73
- visit spotlight.edit_exhibit_path(exhibit)
74
- fill_in email_id_0, with: email_address_0
75
- find('#another-email').click
76
- fill_in email_id_1, with: email_address_1
77
- click_button 'Save changes'
78
-
79
- # saving should redirect back to the edit page, which should now have the contact
80
- # email addresses, with delete buttons now that the entries have been saved.
81
- expect(find_field(email_id_0).value).to eq email_address_0
82
- expect(find_field(email_id_1).value).to eq email_address_1
83
- expect(find_all('.contact-email-delete').length).to eq 2
84
-
85
- # delete the first address in the list
86
- page.accept_confirm do
87
- find_all('.contact-email-delete').first.click
88
- end
89
-
90
- # the page element for the first entry should now be gone, but the second should still be present
91
- expect(page).not_to have_css("##{email_id_0}")
92
- expect(find_field(email_id_1).value).to eq email_address_1
93
-
94
- # reload the edit page to confirm deletion from db...
95
- visit spotlight.edit_exhibit_path(exhibit)
96
-
97
- # what was the second address should now be the only one on the page, and should now be
98
- # in the first/only form field (form fields are numbered at page load from 0).
99
- expect(find_field(email_id_0).value).to eq email_address_1
100
- expect(page).not_to have_css("##{email_id_1}")
101
-
102
- # the hidden input field is what contains the underlying id of the contact for db retrieval
103
- expect(find("##{hidden_input_id_0}", visible: false).value).to eq hidden_input_val_1
104
- end
105
-
106
- it 'creates an empty form field with no associated delete command or confirmation status when creating a blank row for a new contact', js: true do
107
- # create a contact email address and save (shouldn't see delete button or confirmation status on unsaved entries)
108
- visit spotlight.edit_exhibit_path(exhibit)
109
- fill_in email_id_0, with: email_address_0
110
- click_button 'Save changes'
111
-
112
- find('#another-email').click
113
- expect(find_field(email_id_0).value).to eq email_address_0
114
- expect(find_field(email_id_1).value).to eq ''
115
-
116
- # conf status and email delete are nested in a sibling div of the hidden
117
- # id field that's used to indicate the id of the record to be updated.
118
- expect(page).to have_css("##{hidden_input_id_0}~div div.confirmation-status")
119
- expect(page).to have_css("##{hidden_input_id_0}~div span.contact-email-delete-wrapper")
120
- expect(page).not_to have_css("##{hidden_input_id_1}~div div.confirmation-status")
121
- expect(page).not_to have_css("##{hidden_input_id_1}~div span.contact-email-delete-wrapper")
122
- expect(find_all('.confirmation-status').length).to eq 1
123
- expect(find_all('.contact-email-delete-wrapper').length).to eq 1
124
- end
125
-
126
- it 'displays the error message from the server if there is one', js: true do
127
- visit spotlight.edit_exhibit_path(exhibit)
128
- fill_in email_id_0, with: email_address_0
129
- find('#another-email').click
130
- fill_in email_id_1, with: email_address_1
131
- click_button 'Save changes'
132
-
133
- Spotlight::ContactEmail.all.first.destroy
134
- page.accept_confirm do
135
- find_all('.contact-email-delete').first.click
136
- end
137
-
138
- expect(page).to have_css("##{hidden_input_id_0}~div span.contact-email-delete-error", text: 'Problem deleting recipient: Not Found')
139
- end
140
- end
141
- end
@@ -1,97 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'Adding custom metadata fields', type: :feature do
4
- let(:exhibit) { FactoryBot.create(:exhibit) }
5
- let(:admin) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
6
-
7
- before do
8
- login_as(admin)
9
- end
10
-
11
- it 'works' do
12
- # Add
13
-
14
- visit spotlight.edit_exhibit_metadata_configuration_path exhibit
15
- click_on 'Add new field'
16
- fill_in 'Label', with: 'My new custom field'
17
- fill_in 'Short description', with: 'Helps to remind me what this field is for'
18
-
19
- click_on 'Save'
20
-
21
- expect(page).to have_content 'The custom field was created.'
22
- within '#exhibit-specific-fields' do
23
- expect(page).to have_selector '.field-label', text: 'My new custom field'
24
- expect(page).to have_selector '.field-description', text: 'Helps to remind me what this field is for'
25
- # Edit
26
- click_link 'Edit'
27
- end
28
-
29
- # on the edit form
30
- expect(find_field('Label').value).to eq 'My new custom field'
31
- expect(find_field('Short description').value).to eq 'Helps to remind me what this field is for'
32
- fill_in 'Short description', with: 'A much better description'
33
-
34
- click_button 'Save changes'
35
-
36
- expect(page).to have_content 'The custom field was successfully updated.'
37
-
38
- within '#exhibit-specific-fields' do
39
- expect(page).to have_selector '.field-label', text: 'My new custom field'
40
- expect(page).to have_selector '.field-description', text: 'A much better description'
41
- # Destroy
42
- click_link 'Delete'
43
- end
44
-
45
- expect(page).to have_content 'The custom field was deleted.'
46
- end
47
-
48
- it 'has breadcrumbs' do
49
- visit spotlight.edit_exhibit_metadata_configuration_path exhibit
50
- click_on 'Add new field'
51
- expect(page).to have_breadcrumbs 'Home', 'Configuration', 'Metadata', 'Add new field'
52
- end
53
-
54
- it 'lets the curator choose the type of field on create' do
55
- visit spotlight.edit_exhibit_metadata_configuration_path exhibit
56
- click_on 'Add new field'
57
- fill_in 'Label', with: 'My new custom field'
58
-
59
- choose 'Controlled vocabulary'
60
- click_on 'Save'
61
-
62
- expect(page).to have_content 'The custom field was created.'
63
- within '#exhibit-specific-fields' do
64
- # Edit
65
- click_link 'Edit'
66
- end
67
-
68
- expect(page).to have_checked_field 'Controlled vocabulary'
69
- expect(page).to have_unchecked_field 'Free text'
70
-
71
- visit spotlight.edit_exhibit_search_configuration_path exhibit
72
- expect(page).to have_content 'My new custom field'
73
- end
74
-
75
- it 'can be multivalued' do
76
- visit spotlight.edit_exhibit_metadata_configuration_path exhibit
77
- click_on 'Add new field'
78
- fill_in 'Label', with: 'My multivalued custom field'
79
-
80
- choose 'Controlled vocabulary'
81
- check 'custom_field_is_multiple'
82
- click_on 'Save'
83
-
84
- expect(page).to have_content 'The custom field was created.'
85
- within '#exhibit-specific-fields' do
86
- # Edit
87
- click_link 'Edit'
88
- end
89
-
90
- expect(page).to have_checked_field 'Controlled vocabulary'
91
- expect(page).to have_unchecked_field 'Free text'
92
- expect(page).to have_checked_field 'custom_field_is_multiple', disabled: true
93
-
94
- visit spotlight.edit_exhibit_search_configuration_path exhibit
95
- expect(page).to have_content 'My multivalued custom field'
96
- end
97
- end
@@ -1,55 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'Adding custom search fields', type: :feature do
4
- let(:exhibit) { FactoryBot.create(:exhibit) }
5
- let(:admin) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
6
-
7
- before do
8
- login_as(admin)
9
- end
10
-
11
- it 'works' do
12
- # Add
13
-
14
- visit spotlight.edit_exhibit_search_configuration_path exhibit
15
- click_on 'Add new field'
16
- fill_in 'Label', with: 'My new custom field'
17
- fill_in 'Slug', with: 'Foo'
18
- fill_in 'Solr specification', with: 'title^50'
19
-
20
- click_on 'Save'
21
-
22
- expect(page).to have_content 'The custom search field was created.'
23
- within '#exhibit-specific-fields' do
24
- expect(page).to have_selector '.field-label', text: 'My new custom field'
25
- expect(page).to have_selector '.field-description', text: 'title^50'
26
- # Edit
27
- click_link 'Edit'
28
- end
29
-
30
- # on the edit form
31
- expect(find_field('Label').value).to eq 'My new custom field'
32
- expect(find_field('Slug').value).to eq 'Foo'
33
- expect(find_field('Solr specification').value).to eq 'title^50'
34
- fill_in 'Solr specification', with: 'title^50 description^26'
35
-
36
- click_button 'Save changes'
37
-
38
- expect(page).to have_content 'The custom search field was successfully updated.'
39
-
40
- within '#exhibit-specific-fields' do
41
- expect(page).to have_selector '.field-label', text: 'My new custom field'
42
- expect(page).to have_selector '.field-description', text: 'title^50 description^26'
43
- # Destroy
44
- click_link 'Delete'
45
- end
46
-
47
- expect(page).to have_content 'The custom search field was deleted.'
48
- end
49
-
50
- it 'has breadcrumbs' do
51
- visit spotlight.edit_exhibit_search_configuration_path exhibit
52
- click_on 'Add new field'
53
- expect(page).to have_breadcrumbs 'Home', 'Configuration', 'Search', 'Add new field'
54
- end
55
- end
@@ -1,49 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'Editing metadata fields', type: :feature do
4
- let(:exhibit) { FactoryBot.create(:exhibit) }
5
- let(:admin) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
6
-
7
- before { login_as(admin) }
8
-
9
- it 'works' do
10
- visit spotlight.edit_exhibit_metadata_configuration_path exhibit
11
-
12
- expect(page).to have_content 'Display and order metadata fields'
13
-
14
- check :blacklight_configuration_index_fields_language_ssm_show
15
- check :blacklight_configuration_index_fields_abstract_tesim_show
16
- uncheck :blacklight_configuration_index_fields_note_mapuse_tesim_show
17
-
18
- uncheck :blacklight_configuration_index_fields_abstract_tesim_list
19
- check :blacklight_configuration_index_fields_language_ssm_list
20
- check :blacklight_configuration_index_fields_note_mapuse_tesim_list
21
-
22
- click_on 'Save changes'
23
-
24
- expect(exhibit.reload.blacklight_config.index_fields.select { |_k, x| x.list }).to include 'language_ssm', 'note_mapuse_tesim'
25
- expect(exhibit.blacklight_config.index_fields.select { |_k, x| x.list }).not_to include 'abstract_tesim'
26
- expect(exhibit.blacklight_config.show_fields.select { |_k, x| x.show }).to include 'language_ssm', 'abstract_tesim'
27
- expect(exhibit.blacklight_config.show_fields.select { |_k, x| x.show }).not_to include 'note_mapuse_tesim'
28
- end
29
-
30
- it 'has in-place editing of labels', js: true do
31
- visit spotlight.edit_exhibit_metadata_configuration_path exhibit
32
- check :blacklight_configuration_index_fields_language_ssm_show
33
- check :blacklight_configuration_index_fields_language_ssm_list
34
-
35
- click_on 'Language'
36
-
37
- expect(page).to have_field :blacklight_configuration_index_fields_language_ssm_label, visible: true
38
- fill_in :blacklight_configuration_index_fields_language_ssm_label, with: 'Language of Origin'
39
-
40
- click_on 'Save changes'
41
- expect(exhibit.reload.blacklight_config.index_fields['language_ssm'].label).to eq 'Language of Origin'
42
- end
43
-
44
- it 'has breadcrumbs' do
45
- visit spotlight.edit_exhibit_metadata_configuration_path exhibit
46
-
47
- expect(page).to have_breadcrumbs 'Home', 'Configuration', 'Metadata'
48
- end
49
- end
@@ -1,59 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'Language', type: :feature do
4
- let(:exhibit) { FactoryBot.create(:exhibit) }
5
- let(:admin) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
6
-
7
- before do
8
- login_as admin
9
- visit spotlight.edit_exhibit_path(exhibit)
10
- end
11
-
12
- describe 'creation' do
13
- it 'successfully adds languages' do
14
- within '#language' do
15
- select 'Albanian'
16
- find('input[name="commit"]').click
17
- end
18
- expect(page).to have_css '.flash_messages', text: 'The language was created.'
19
- within '#language' do
20
- expect(page).to have_css 'table'
21
- expect(page).to have_css 'td', text: 'Albanian'
22
- end
23
- end
24
- end
25
-
26
- describe 'making public' do
27
- it 'successfully updates the language' do
28
- within '#language' do
29
- select 'Albanian'
30
- find('input[name="commit"]').click
31
- end
32
- expect(page).to have_css '.flash_messages', text: 'The language was created.'
33
- within '#language' do
34
- check 'Public'
35
- click_button 'Save changes'
36
- end
37
- expect(page).to have_css '.flash_messages', text: 'The exhibit was successfully updated.'
38
- expect(exhibit.languages.last).to be_public
39
- end
40
- end
41
-
42
- describe 'deleting' do
43
- it 'successfully updates the language' do
44
- within '#language' do
45
- select 'Albanian'
46
- find('input[name="commit"]').click
47
- end
48
- expect(page).to have_css '.flash_messages', text: 'The language was created.'
49
- within '#language' do
50
- click_link 'Remove'
51
- end
52
- expect(page).to have_css '.flash_messages', text: 'The language was deleted.'
53
- within '#language' do
54
- expect(page).to have_content 'No languages have been added for translation. To add a language, make a selection above.'
55
- expect(page).not_to have_css 'table'
56
- end
57
- end
58
- end
59
- end