blacklight 7.33.0 → 8.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (387) hide show
  1. checksums.yaml +4 -4
  2. data/.env +2 -2
  3. data/.github/workflows/ruby.yml +32 -107
  4. data/.rubocop.yml +243 -2
  5. data/.rubocop_todo.yml +214 -270
  6. data/Gemfile +7 -6
  7. data/README.md +11 -3
  8. data/VERSION +1 -1
  9. data/app/assets/javascripts/blacklight/blacklight.esm.js +384 -0
  10. data/app/assets/javascripts/blacklight/blacklight.esm.js.map +1 -0
  11. data/app/assets/javascripts/blacklight/blacklight.js +351 -496
  12. data/app/assets/javascripts/blacklight/blacklight.js.map +1 -0
  13. data/app/assets/stylesheets/blacklight/_autocomplete.scss +25 -0
  14. data/app/assets/stylesheets/blacklight/_blacklight_base.scss +1 -1
  15. data/app/assets/stylesheets/blacklight/_bookmark.scss +16 -0
  16. data/app/assets/stylesheets/blacklight/_bootstrap_overrides.scss +8 -0
  17. data/app/assets/stylesheets/blacklight/_facets.scss +72 -44
  18. data/app/assets/stylesheets/blacklight/_header.scss +0 -15
  19. data/app/assets/stylesheets/blacklight/_icons.scss +0 -14
  20. data/app/assets/stylesheets/blacklight/_mixins.scss +20 -0
  21. data/app/assets/stylesheets/blacklight/_modal.scss +8 -2
  22. data/app/assets/stylesheets/blacklight/_search_form.scss +30 -3
  23. data/app/assets/stylesheets/blacklight/_search_history.scss +10 -1
  24. data/app/assets/stylesheets/blacklight/_search_results.scss +6 -2
  25. data/app/assets/stylesheets/blacklight/blacklight_defaults.scss +4 -1
  26. data/app/builders/blacklight/action_builder.rb +18 -9
  27. data/app/components/blacklight/advanced_search_form_component.html.erb +1 -1
  28. data/app/components/blacklight/advanced_search_form_component.rb +4 -6
  29. data/app/components/blacklight/constraints_component.rb +27 -37
  30. data/app/components/blacklight/document/action_component.html.erb +2 -9
  31. data/app/components/blacklight/document/action_component.rb +26 -8
  32. data/app/components/blacklight/document/actions_component.rb +1 -1
  33. data/app/components/blacklight/document/bookmark_component.html.erb +9 -0
  34. data/app/components/blacklight/document/bookmark_component.rb +4 -2
  35. data/app/components/blacklight/document/citation_component.rb +5 -3
  36. data/app/components/blacklight/document/group_component.rb +7 -3
  37. data/app/components/blacklight/document/sidebar_component.html.erb +2 -0
  38. data/app/components/blacklight/document/sidebar_component.rb +16 -0
  39. data/app/components/blacklight/document/thumbnail_component.html.erb +2 -7
  40. data/app/components/blacklight/document/thumbnail_component.rb +1 -9
  41. data/app/components/blacklight/document_component.html.erb +4 -0
  42. data/app/components/blacklight/document_component.rb +7 -23
  43. data/app/components/blacklight/document_metadata_component.rb +5 -6
  44. data/app/components/blacklight/document_title_component.rb +4 -1
  45. data/app/components/blacklight/facet_component.rb +1 -1
  46. data/app/components/blacklight/facet_field_checkboxes_component.html.erb +1 -1
  47. data/app/components/blacklight/facet_field_checkboxes_component.rb +1 -1
  48. data/app/components/blacklight/facet_field_component.html.erb +5 -5
  49. data/app/components/blacklight/facet_field_component.rb +9 -2
  50. data/app/components/blacklight/facet_field_list_component.html.erb +1 -1
  51. data/app/components/blacklight/facet_field_list_component.rb +37 -5
  52. data/app/components/blacklight/facet_field_no_layout_component.rb +0 -2
  53. data/app/components/blacklight/facet_item_component.rb +1 -43
  54. data/app/components/blacklight/facet_item_pivot_component.rb +21 -23
  55. data/app/components/blacklight/header_component.html.erb +2 -0
  56. data/app/components/blacklight/header_component.rb +26 -0
  57. data/app/components/blacklight/hidden_search_state_component.rb +1 -2
  58. data/app/components/blacklight/icons/legacy_icon_component.rb +30 -0
  59. data/app/components/blacklight/icons/list_component.rb +16 -0
  60. data/app/components/blacklight/icons/search_component.rb +16 -0
  61. data/app/components/blacklight/metadata_field_component.rb +24 -8
  62. data/app/components/blacklight/metadata_field_layout_component.rb +0 -18
  63. data/app/components/blacklight/response/facet_group_component.html.erb +3 -5
  64. data/app/components/blacklight/response/facet_group_component.rb +29 -8
  65. data/app/components/blacklight/response/sort_component.rb +1 -1
  66. data/app/components/blacklight/response/spellcheck_component.rb +17 -6
  67. data/app/components/blacklight/response/view_type_button_component.rb +2 -6
  68. data/app/components/blacklight/response/view_type_component.rb +2 -4
  69. data/app/components/blacklight/search/sidebar_component.html.erb +8 -0
  70. data/app/components/blacklight/search/sidebar_component.rb +17 -0
  71. data/app/components/blacklight/search_bar_component.html.erb +20 -15
  72. data/app/components/blacklight/search_bar_component.rb +2 -16
  73. data/app/components/blacklight/search_button_component.rb +3 -3
  74. data/app/components/blacklight/search_context_component.rb +43 -9
  75. data/app/components/blacklight/search_header_component.html.erb +2 -0
  76. data/app/components/blacklight/search_header_component.rb +6 -0
  77. data/app/components/blacklight/search_navbar_component.html.erb +5 -0
  78. data/app/components/blacklight/search_navbar_component.rb +34 -0
  79. data/app/components/blacklight/start_over_button_component.rb +5 -3
  80. data/app/components/blacklight/system/flash_message_component.html.erb +3 -1
  81. data/app/components/blacklight/system/flash_message_component.rb +10 -1
  82. data/app/components/blacklight/system/modal_component.html.erb +1 -1
  83. data/app/components/blacklight/system/modal_component.rb +0 -2
  84. data/app/components/blacklight/top_navbar_component.html.erb +12 -0
  85. data/app/components/blacklight/top_navbar_component.rb +13 -0
  86. data/app/controllers/bookmarks_controller.rb +1 -0
  87. data/app/controllers/catalog_controller.rb +1 -0
  88. data/app/controllers/concerns/blacklight/bookmarks.rb +10 -5
  89. data/app/controllers/concerns/blacklight/catalog.rb +21 -72
  90. data/app/controllers/concerns/blacklight/controller.rb +6 -43
  91. data/app/controllers/concerns/blacklight/search_context.rb +25 -7
  92. data/app/controllers/concerns/blacklight/search_history.rb +2 -0
  93. data/app/controllers/concerns/blacklight/searchable.rb +12 -1
  94. data/app/controllers/concerns/blacklight/token_based_user.rb +1 -0
  95. data/app/controllers/search_history_controller.rb +1 -0
  96. data/app/helpers/blacklight/blacklight_helper_behavior.rb +10 -308
  97. data/app/helpers/blacklight/catalog_helper_behavior.rb +22 -137
  98. data/app/helpers/blacklight/component_helper_behavior.rb +2 -53
  99. data/app/helpers/blacklight/configuration_helper_behavior.rb +2 -117
  100. data/app/helpers/blacklight/facets_helper_behavior.rb +4 -321
  101. data/app/helpers/blacklight/icon_helper_behavior.rb +5 -4
  102. data/app/helpers/blacklight/layout_helper_behavior.rb +1 -0
  103. data/app/helpers/blacklight/render_partials_helper_behavior.rb +11 -30
  104. data/app/helpers/blacklight/url_helper_behavior.rb +13 -97
  105. data/app/helpers/blacklight_helper.rb +1 -0
  106. data/app/helpers/catalog_helper.rb +1 -0
  107. data/app/javascript/blacklight/bookmark_toggle.js +13 -19
  108. data/app/javascript/blacklight/button_focus.js +12 -10
  109. data/app/javascript/blacklight/checkbox_submit.js +68 -122
  110. data/app/javascript/blacklight/core.js +6 -5
  111. data/app/javascript/blacklight/index.js +13 -0
  112. data/app/javascript/blacklight/modal.js +99 -164
  113. data/app/javascript/blacklight/modalForm.js +60 -0
  114. data/app/javascript/blacklight/search_context.js +45 -55
  115. data/app/models/blacklight/facet_paginator.rb +3 -2
  116. data/app/models/blacklight/icon.rb +4 -2
  117. data/app/models/bookmark.rb +0 -2
  118. data/app/models/concerns/blacklight/configurable.rb +5 -4
  119. data/app/models/concerns/blacklight/document/active_model_shim.rb +1 -0
  120. data/app/models/concerns/blacklight/document/attributes.rb +50 -0
  121. data/app/models/concerns/blacklight/document/cache_key.rb +1 -0
  122. data/app/models/concerns/blacklight/document/dublin_core.rb +2 -1
  123. data/app/models/concerns/blacklight/document/email.rb +1 -0
  124. data/app/models/concerns/blacklight/document/export.rb +2 -1
  125. data/app/models/concerns/blacklight/document/extensions.rb +1 -0
  126. data/app/models/concerns/blacklight/document/schema_org.rb +1 -0
  127. data/app/models/concerns/blacklight/document/semantic_fields.rb +1 -0
  128. data/app/models/concerns/blacklight/document/sms.rb +1 -0
  129. data/app/models/concerns/blacklight/document.rb +12 -20
  130. data/app/models/concerns/blacklight/suggest/response.rb +1 -0
  131. data/app/models/concerns/blacklight/user.rb +17 -8
  132. data/app/models/record_mailer.rb +13 -12
  133. data/app/models/search.rb +0 -1
  134. data/app/models/solr_document.rb +1 -0
  135. data/app/presenters/blacklight/clause_presenter.rb +1 -1
  136. data/app/presenters/blacklight/document_presenter.rb +13 -21
  137. data/app/presenters/blacklight/facet_field_presenter.rb +39 -14
  138. data/app/presenters/blacklight/facet_grouped_item_presenter.rb +1 -5
  139. data/app/presenters/blacklight/facet_item_pivot_presenter.rb +60 -0
  140. data/app/presenters/blacklight/facet_item_presenter.rb +3 -9
  141. data/app/presenters/blacklight/field_presenter.rb +1 -0
  142. data/app/presenters/blacklight/index_presenter.rb +2 -40
  143. data/app/presenters/blacklight/json_presenter.rb +7 -5
  144. data/app/presenters/blacklight/rendering/join.rb +1 -1
  145. data/app/presenters/blacklight/rendering/link_to_facet.rb +2 -5
  146. data/app/presenters/blacklight/show_presenter.rb +1 -9
  147. data/app/presenters/blacklight/thumbnail_presenter.rb +1 -1
  148. data/app/services/blacklight/bookmarks_search_builder.rb +22 -0
  149. data/app/services/blacklight/field_retriever.rb +1 -8
  150. data/app/services/blacklight/search_service.rb +8 -7
  151. data/app/values/blacklight/types.rb +95 -11
  152. data/app/views/bookmarks/_clear_bookmarks_widget.html.erb +8 -1
  153. data/app/views/bookmarks/_tools.html.erb +7 -12
  154. data/app/views/catalog/_advanced_search_form.html.erb +0 -1
  155. data/app/views/catalog/_bookmark_control.html.erb +1 -1
  156. data/app/views/catalog/_constraints.html.erb +1 -14
  157. data/app/views/catalog/_document.atom.builder +12 -14
  158. data/app/views/catalog/_document.html.erb +5 -3
  159. data/app/views/catalog/_document.rss.builder +2 -4
  160. data/app/views/catalog/_facets.html.erb +5 -4
  161. data/app/views/catalog/_home_text.html.erb +2 -14
  162. data/app/views/catalog/_search_form.html.erb +3 -3
  163. data/app/views/catalog/_search_header.html.erb +1 -2
  164. data/app/views/catalog/_search_results.html.erb +2 -2
  165. data/app/views/catalog/_search_sidebar.html.erb +5 -1
  166. data/app/views/catalog/_show_main_content.html.erb +10 -15
  167. data/app/views/catalog/_show_sidebar.html.erb +2 -2
  168. data/app/views/catalog/_show_tools.html.erb +7 -12
  169. data/app/views/catalog/_view_type_group.html.erb +1 -1
  170. data/app/views/catalog/email_success.html.erb +5 -6
  171. data/app/views/catalog/facet.html.erb +4 -2
  172. data/app/views/catalog/index.atom.builder +12 -14
  173. data/app/views/catalog/index.html.erb +4 -1
  174. data/app/views/catalog/index.json.jbuilder +19 -19
  175. data/app/views/catalog/index.rss.builder +1 -1
  176. data/app/views/catalog/opensearch.xml.builder +1 -1
  177. data/app/views/catalog/sms_success.html.erb +5 -6
  178. data/app/views/catalog/suggest.html.erb +3 -0
  179. data/app/views/layouts/blacklight/base.html.erb +20 -9
  180. data/app/views/search_history/index.html.erb +6 -2
  181. data/app/views/shared/_header_navbar.html.erb +1 -22
  182. data/app/views/shared/_modal.html.erb +3 -3
  183. data/blacklight.gemspec +6 -8
  184. data/config/importmap.rb +3 -0
  185. data/config/locales/blacklight.ar.yml +0 -1
  186. data/config/locales/blacklight.ca.yml +0 -1
  187. data/config/locales/blacklight.de.yml +0 -1
  188. data/config/locales/blacklight.en.yml +0 -1
  189. data/config/locales/blacklight.es.yml +0 -1
  190. data/config/locales/blacklight.fr.yml +0 -1
  191. data/config/locales/blacklight.hu.yml +0 -1
  192. data/config/locales/blacklight.it.yml +0 -1
  193. data/config/locales/blacklight.nl.yml +0 -1
  194. data/config/locales/blacklight.pt-BR.yml +0 -1
  195. data/config/locales/blacklight.sq.yml +0 -1
  196. data/config/locales/blacklight.zh.yml +0 -1
  197. data/config/routes.rb +3 -2
  198. data/db/migrate/20140202020201_create_searches.rb +1 -0
  199. data/db/migrate/20140202020202_create_bookmarks.rb +1 -0
  200. data/db/migrate/20140320000000_add_polymorphic_type_to_bookmarks.rb +1 -0
  201. data/lib/blacklight/abstract_repository.rb +1 -0
  202. data/lib/blacklight/configuration/context.rb +4 -4
  203. data/lib/blacklight/configuration/display_field.rb +7 -9
  204. data/lib/blacklight/configuration/facet_field.rb +17 -11
  205. data/lib/blacklight/configuration/field.rb +1 -0
  206. data/lib/blacklight/configuration/fields.rb +12 -15
  207. data/lib/blacklight/configuration/index_field.rb +1 -0
  208. data/lib/blacklight/configuration/null_display_field.rb +17 -0
  209. data/lib/blacklight/configuration/search_field.rb +1 -0
  210. data/lib/blacklight/configuration/show_field.rb +1 -0
  211. data/lib/blacklight/configuration/sort_field.rb +1 -0
  212. data/lib/blacklight/configuration/tool_config.rb +1 -0
  213. data/lib/blacklight/configuration/view_config.rb +16 -6
  214. data/lib/blacklight/configuration.rb +318 -341
  215. data/lib/blacklight/engine.rb +10 -11
  216. data/lib/blacklight/exceptions.rb +2 -2
  217. data/lib/blacklight/nested_open_struct_with_hash_access.rb +6 -12
  218. data/lib/blacklight/open_struct_with_hash_access.rb +19 -17
  219. data/lib/blacklight/parameters.rb +7 -21
  220. data/lib/blacklight/routes/exportable.rb +1 -0
  221. data/lib/blacklight/routes/searchable.rb +2 -1
  222. data/lib/blacklight/routes.rb +1 -0
  223. data/lib/blacklight/search_builder.rb +10 -10
  224. data/lib/blacklight/search_state/filter_field.rb +8 -25
  225. data/lib/blacklight/search_state/pivot_filter_field.rb +144 -0
  226. data/lib/blacklight/search_state.rb +23 -79
  227. data/lib/blacklight/solr/document.rb +1 -0
  228. data/lib/blacklight/solr/facet_paginator.rb +1 -0
  229. data/lib/blacklight/solr/repository.rb +1 -0
  230. data/lib/blacklight/solr/request.rb +3 -0
  231. data/lib/blacklight/solr/response/facets.rb +21 -5
  232. data/lib/blacklight/solr/response/group.rb +1 -0
  233. data/lib/blacklight/solr/response/group_response.rb +1 -0
  234. data/lib/blacklight/solr/response/more_like_this.rb +1 -0
  235. data/lib/blacklight/solr/response/pagination_methods.rb +4 -3
  236. data/lib/blacklight/solr/response/params.rb +5 -4
  237. data/lib/blacklight/solr/response/response.rb +1 -0
  238. data/lib/blacklight/solr/response/spelling.rb +1 -0
  239. data/lib/blacklight/solr/response.rb +4 -3
  240. data/lib/blacklight/solr/search_builder_behavior.rb +16 -32
  241. data/lib/blacklight/solr.rb +1 -0
  242. data/lib/blacklight/version.rb +1 -0
  243. data/lib/blacklight.rb +8 -11
  244. data/lib/generators/blacklight/assets/importmap_generator.rb +55 -0
  245. data/lib/generators/blacklight/assets/propshaft_generator.rb +25 -0
  246. data/lib/generators/blacklight/assets/sprockets_generator.rb +66 -0
  247. data/lib/generators/blacklight/assets_generator.rb +13 -89
  248. data/lib/generators/blacklight/controller_generator.rb +3 -2
  249. data/lib/generators/blacklight/document_generator.rb +1 -0
  250. data/lib/generators/blacklight/install_generator.rb +5 -4
  251. data/lib/generators/blacklight/models_generator.rb +1 -0
  252. data/lib/generators/blacklight/search_builder_generator.rb +1 -0
  253. data/lib/generators/blacklight/solr_generator.rb +1 -1
  254. data/lib/generators/blacklight/templates/catalog_controller.rb +37 -7
  255. data/lib/generators/blacklight/templates/solr_document.rb +1 -1
  256. data/lib/generators/blacklight/test_support_generator.rb +4 -2
  257. data/lib/generators/blacklight/user_generator.rb +7 -9
  258. data/lib/railties/blacklight.rake +2 -3
  259. data/package.json +9 -12
  260. data/rollup.config.js +27 -0
  261. data/spec/components/blacklight/constraints_component_spec.rb +17 -13
  262. data/spec/components/blacklight/document_component_spec.rb +12 -22
  263. data/spec/components/blacklight/facet_component_spec.rb +2 -7
  264. data/spec/components/blacklight/facet_field_checkboxes_component_spec.rb +1 -2
  265. data/spec/components/blacklight/facet_field_list_component_spec.rb +7 -6
  266. data/spec/components/blacklight/facet_item_pivot_component_spec.rb +9 -7
  267. data/spec/components/blacklight/response/view_type_component_spec.rb +66 -0
  268. data/spec/components/blacklight/search_context_component_spec.rb +40 -0
  269. data/spec/controllers/blacklight/catalog/component_configuration_spec.rb +1 -6
  270. data/spec/controllers/blacklight/{base_spec.rb → catalog_spec.rb} +2 -2
  271. data/spec/controllers/bookmarks_controller_spec.rb +2 -3
  272. data/spec/controllers/catalog_controller_spec.rb +13 -127
  273. data/spec/features/autocomplete_spec.rb +1 -1
  274. data/spec/features/axe_spec.rb +1 -1
  275. data/spec/features/bookmarks_spec.rb +1 -1
  276. data/spec/features/facets_spec.rb +1 -1
  277. data/spec/features/search_context_spec.rb +4 -10
  278. data/spec/features/search_results_spec.rb +0 -33
  279. data/spec/helpers/blacklight/configuration_helper_behavior_spec.rb +2 -138
  280. data/spec/helpers/blacklight/facets_helper_behavior_spec.rb +0 -387
  281. data/spec/helpers/blacklight/icon_helper_behavior_spec.rb +8 -0
  282. data/spec/helpers/blacklight/render_partials_helper_behavior_spec.rb +5 -7
  283. data/spec/helpers/blacklight/url_helper_behavior_spec.rb +9 -131
  284. data/spec/helpers/blacklight_helper_spec.rb +3 -242
  285. data/spec/helpers/catalog_helper_spec.rb +7 -118
  286. data/spec/i18n_spec.rb +1 -0
  287. data/spec/integration/generators/blacklight/solr_generator_spec.rb +1 -1
  288. data/spec/lib/blacklight/configuration/facet_field_spec.rb +27 -16
  289. data/spec/lib/blacklight/configuration/field_spec.rb +1 -1
  290. data/spec/lib/blacklight/configuration/view_config_spec.rb +1 -1
  291. data/spec/lib/blacklight/open_struct_with_hash_access_spec.rb +2 -2
  292. data/spec/lib/blacklight/parameters_spec.rb +1 -4
  293. data/spec/lib/blacklight/search_state/filter_field_spec.rb +4 -4
  294. data/spec/lib/blacklight/search_state/pivot_filter_field_spec.rb +117 -0
  295. data/spec/lib/blacklight/search_state_spec.rb +80 -198
  296. data/spec/lib/tasks/blacklight_task_spec.rb +1 -0
  297. data/spec/models/blacklight/configuration_spec.rb +39 -51
  298. data/spec/models/blacklight/document/active_model_shim_spec.rb +2 -2
  299. data/spec/models/blacklight/icon_spec.rb +31 -15
  300. data/spec/models/blacklight/search_builder_spec.rb +9 -9
  301. data/spec/models/blacklight/solr/document_spec.rb +3 -3
  302. data/spec/models/blacklight/solr/response/facets_spec.rb +27 -27
  303. data/spec/models/blacklight/solr/response/group_response_spec.rb +1 -0
  304. data/spec/models/blacklight/solr/response/group_spec.rb +1 -0
  305. data/spec/models/blacklight/solr/response_spec.rb +9 -2
  306. data/spec/models/blacklight/solr/search_builder_spec.rb +32 -23
  307. data/spec/models/blacklight/user_spec.rb +22 -0
  308. data/spec/models/solr_document_spec.rb +21 -3
  309. data/spec/presenters/blacklight/clause_presenter_spec.rb +1 -0
  310. data/spec/presenters/blacklight/document_presenter_spec.rb +2 -2
  311. data/spec/presenters/blacklight/facet_field_presenter_spec.rb +85 -12
  312. data/spec/presenters/blacklight/facet_grouped_item_presenter_spec.rb +1 -0
  313. data/spec/presenters/blacklight/facet_item_presenter_spec.rb +14 -13
  314. data/spec/presenters/blacklight/field_presenter_spec.rb +0 -14
  315. data/spec/presenters/blacklight/index_presenter_spec.rb +2 -4
  316. data/spec/presenters/blacklight/json_presenter_spec.rb +1 -0
  317. data/spec/presenters/blacklight/link_alternate_presenter_spec.rb +3 -2
  318. data/spec/presenters/blacklight/show_presenter_spec.rb +10 -25
  319. data/spec/presenters/thumbnail_presenter_spec.rb +1 -1
  320. data/spec/requests/load_suggestions_spec.rb +16 -0
  321. data/spec/routing/catalog_routing_spec.rb +2 -1
  322. data/spec/services/blacklight/search_service_spec.rb +31 -68
  323. data/spec/spec_helper.rb +3 -2
  324. data/spec/support/controller_level_helpers.rb +1 -2
  325. data/spec/support/features/search_helpers.rb +39 -0
  326. data/spec/support/features/session_helpers.rb +1 -0
  327. data/spec/support/features.rb +3 -0
  328. data/spec/test_app_templates/lib/generators/test_app_generator.rb +9 -2
  329. data/spec/views/catalog/_document.html.erb_spec.rb +3 -34
  330. data/spec/views/catalog/_facet_index_navigation.html.erb_spec.rb +1 -1
  331. data/spec/views/catalog/_search_header.erb_spec.rb +1 -0
  332. data/spec/views/catalog/_show_sidebar.erb_spec.rb +1 -0
  333. data/spec/views/catalog/_show_tools.html.erb_spec.rb +7 -54
  334. data/spec/views/catalog/_view_type_group.html.erb_spec.rb +17 -9
  335. data/spec/views/catalog/email_success.html.erb_spec.rb +2 -2
  336. data/spec/views/catalog/facet.html.erb_spec.rb +6 -3
  337. data/spec/views/catalog/index.atom.builder_spec.rb +18 -11
  338. data/spec/views/catalog/index.html.erb_spec.rb +5 -6
  339. data/spec/views/catalog/index.json.jbuilder_spec.rb +2 -2
  340. data/spec/views/catalog/show.html.erb_spec.rb +3 -25
  341. data/spec/views/catalog/sms_success.html.erb_spec.rb +2 -2
  342. data/tasks/blacklight.rake +6 -4
  343. metadata +66 -112
  344. data/.babelrc +0 -11
  345. data/app/assets/images/blacklight/list.svg +0 -1
  346. data/app/assets/images/blacklight/search.svg +0 -1
  347. data/app/assets/stylesheets/blacklight/_twitter_typeahead.scss +0 -37
  348. data/app/components/blacklight/content_areas_shim.rb +0 -13
  349. data/app/controllers/concerns/blacklight/base.rb +0 -7
  350. data/app/controllers/concerns/blacklight/default_component_configuration.rb +0 -64
  351. data/app/controllers/concerns/blacklight/facet.rb +0 -69
  352. data/app/controllers/concerns/blacklight/search_fields.rb +0 -46
  353. data/app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb +0 -27
  354. data/app/helpers/blacklight/render_constraints_helper_behavior.rb +0 -188
  355. data/app/helpers/blacklight/search_history_constraints_helper_behavior.rb +0 -97
  356. data/app/helpers/blacklight/suggest_helper_behavior.rb +0 -13
  357. data/app/javascript/blacklight/autocomplete.js +0 -36
  358. data/app/javascript/blacklight/facet_load.js +0 -22
  359. data/app/presenters/blacklight/search_bar_presenter.rb +0 -47
  360. data/app/views/catalog/_constraints_element.html.erb +0 -14
  361. data/app/views/catalog/_document_action.html.erb +0 -5
  362. data/app/views/catalog/_facet_group.html.erb +0 -5
  363. data/app/views/catalog/_facet_limit.html.erb +0 -3
  364. data/app/views/catalog/_index.html.erb +0 -1
  365. data/app/views/catalog/_index_header.html.erb +0 -22
  366. data/app/views/catalog/_previous_next_doc.html.erb +0 -2
  367. data/app/views/catalog/_show.html.erb +0 -6
  368. data/app/views/catalog/_show_header.html.erb +0 -2
  369. data/app/views/catalog/_thumbnail.html.erb +0 -1
  370. data/lib/blacklight/deprecations/engine_configuration.rb +0 -66
  371. data/lib/blacklight/deprecations/search_state_normalization.rb +0 -52
  372. data/spec/controllers/blacklight/facet_spec.rb +0 -33
  373. data/spec/controllers/blacklight/search_fields_spec.rb +0 -62
  374. data/spec/helpers/blacklight/hash_as_hidden_fields_behavior_spec.rb +0 -26
  375. data/spec/helpers/blacklight/render_constraints_helper_behavior_spec.rb +0 -92
  376. data/spec/helpers/blacklight/search_history_constraints_helper_behavior_spec.rb +0 -108
  377. data/spec/helpers/blacklight/suggest_helper_behavior_spec.rb +0 -48
  378. data/spec/lib/blacklight/engine_spec.rb +0 -41
  379. data/spec/presenters/blacklight/search_bar_presenter_spec.rb +0 -94
  380. data/spec/views/catalog/_constraints.html.erb_spec.rb +0 -33
  381. data/spec/views/catalog/_facet_group.html.erb_spec.rb +0 -84
  382. data/spec/views/catalog/_facets.html.erb_spec.rb +0 -15
  383. data/spec/views/catalog/_index.html.erb_spec.rb +0 -62
  384. data/spec/views/catalog/_index_header.html.erb_spec.rb +0 -35
  385. data/spec/views/catalog/_previous_next_doc.html.erb_spec.rb +0 -22
  386. data/spec/views/catalog/_show.html.erb_spec.rb +0 -62
  387. data/spec/views/catalog/_thumbnail.html.erb_spec.rb +0 -38
@@ -45,9 +45,11 @@ RSpec.describe SolrDocument, api: true do
45
45
 
46
46
  let(:doc_class) do
47
47
  Class.new(SolrDocument) do
48
- attribute :title, Blacklight::Types::String, 'title_tesim'
49
- attribute :author, Blacklight::Types::Array, 'author_tesim'
50
- attribute :date, Blacklight::Types::Date, 'date_dtsi'
48
+ attribute :title, :string, 'title_tesim'
49
+ attribute :author, :array, 'author_tesim', of: :string
50
+ attribute :first_author, :select, 'author_tesim', by: :min
51
+ attribute :date, :date, field: 'date_dtsi'
52
+ attribute :whatever, :string, default: ->(*) { 'default_value' }
51
53
  end
52
54
  end
53
55
  let(:document) do
@@ -60,7 +62,23 @@ RSpec.describe SolrDocument, api: true do
60
62
  it "casts the attributes" do
61
63
  expect(document.title).to eq 'Good Omens'
62
64
  expect(document.author).to eq ['Neil Gaiman', 'Terry Pratchett']
65
+ expect(document.first_author).to eq 'Neil Gaiman'
63
66
  expect(document.date).to eq Date.new(1990)
67
+ expect(document.whatever).to eq 'default_value'
68
+ end
69
+
70
+ context 'with missing data' do
71
+ let(:document) { doc_class.new(id: '123') }
72
+
73
+ it 'returns nil for scalar values' do
74
+ expect(document.title).to be_nil
75
+ expect(document.first_author).to be_nil
76
+ expect(document.date).to be_nil
77
+ end
78
+
79
+ it 'returns an array for array values' do
80
+ expect(document.author).to eq []
81
+ end
64
82
  end
65
83
  end
66
84
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'spec_helper'
3
4
 
4
5
  RSpec.describe Blacklight::ClausePresenter, type: :presenter do
@@ -17,7 +17,7 @@ RSpec.describe Blacklight::DocumentPresenter do
17
17
  describe '#fields_to_render' do
18
18
  subject { presenter.fields_to_render.to_a }
19
19
 
20
- let(:field_config) { Blacklight::Configuration::Field.new(field: 'asdf') }
20
+ let(:field_config) { Blacklight::Configuration::DisplayField.new(field: 'asdf') }
21
21
 
22
22
  context 'when all of the fields have values' do
23
23
  before do
@@ -30,7 +30,7 @@ RSpec.describe Blacklight::DocumentPresenter do
30
30
 
31
31
  describe '#field_value' do
32
32
  let(:field_presenter) { instance_double(Blacklight::FieldPresenter, render: 'xyz') }
33
- let(:field_config) { Blacklight::Configuration::Field.new }
33
+ let(:field_config) { Blacklight::Configuration::DisplayField.new }
34
34
  let(:options) { { a: 1 } }
35
35
 
36
36
  it 'calls the field presenter' do
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'spec_helper'
3
4
 
4
5
  RSpec.describe Blacklight::FacetFieldPresenter, type: :presenter do
@@ -44,11 +45,11 @@ RSpec.describe Blacklight::FacetFieldPresenter, type: :presenter do
44
45
  describe '#active?' do
45
46
  it "checks if any value is selected for a given facet" do
46
47
  search_state.params[:f] = ActiveSupport::HashWithIndifferentAccess.new(key: [1])
47
- expect(presenter.active?).to eq true
48
+ expect(presenter.active?).to be true
48
49
  end
49
50
 
50
51
  it "is false if no value for facet is selected" do
51
- expect(presenter.active?).to eq false
52
+ expect(presenter.active?).to be false
52
53
  end
53
54
  end
54
55
 
@@ -59,12 +60,12 @@ RSpec.describe Blacklight::FacetFieldPresenter, type: :presenter do
59
60
  end
60
61
 
61
62
  it 'is true' do
62
- expect(presenter.in_modal?).to eq true
63
+ expect(presenter.in_modal?).to be true
63
64
  end
64
65
  end
65
66
 
66
67
  it 'is false' do
67
- expect(presenter.in_modal?).to eq false
68
+ expect(presenter.in_modal?).to be false
68
69
  end
69
70
  end
70
71
 
@@ -72,7 +73,9 @@ RSpec.describe Blacklight::FacetFieldPresenter, type: :presenter do
72
73
  let(:paginator) { Blacklight::FacetPaginator.new([{}, {}], limit: 1) }
73
74
 
74
75
  before do
75
- allow(view_context).to receive(:facet_paginator).and_return(paginator)
76
+ # rubocop:disable RSpec/SubjectStub
77
+ allow(presenter).to receive(:paginator).and_return(paginator)
78
+ # rubocop:enable RSpec/SubjectStub
76
79
  end
77
80
 
78
81
  context 'with no additional data' do
@@ -97,13 +100,6 @@ RSpec.describe Blacklight::FacetFieldPresenter, type: :presenter do
97
100
  end
98
101
  end
99
102
 
100
- describe '#html_id' do
101
- it 'gets the id from a helper' do
102
- allow(view_context).to receive(:html_id).with('key').and_return('facet-key')
103
- expect(presenter.html_id).to eq 'facet-key'
104
- end
105
- end
106
-
107
103
  describe '#paginator' do
108
104
  subject(:paginator) { presenter.paginator }
109
105
 
@@ -112,4 +108,81 @@ RSpec.describe Blacklight::FacetFieldPresenter, type: :presenter do
112
108
  expect(paginator.total_count).to eq 0
113
109
  end
114
110
  end
111
+
112
+ describe "#facet_limit" do
113
+ subject(:facet_limit) { presenter.facet_limit }
114
+
115
+ let(:search_state) { Blacklight::SearchState.new({}, blacklight_config, controller) }
116
+ let(:blacklight_config) { CatalogController.blacklight_config }
117
+ let(:facet_field) { blacklight_config.facet_fields['subject_ssim'] }
118
+ let(:display_facet) do
119
+ instance_double(Blacklight::Solr::Response::Facets::FacetField, items: items, limit: nil, sort: :index, offset: 0, prefix: nil)
120
+ end
121
+ # let(:facet_field) { Blacklight::Configuration::FacetField.new(key: 'key') }
122
+ # let(:display_facet) do
123
+ # instance_double(Blacklight::Solr::Response::Facets::FacetField, items: items, sort: :index, offset: 0, prefix: nil)
124
+ # end
125
+
126
+ it "returns specified value for facet_field specified" do
127
+ expect(facet_limit).to eq facet_field.limit
128
+ end
129
+
130
+ describe "for 'true' configured values" do
131
+ let(:blacklight_config) do
132
+ Blacklight::Configuration.new do |config|
133
+ config.add_facet_field "language_facet", limit: true
134
+ end
135
+ end
136
+ let(:facet_field) { blacklight_config.facet_fields['language_facet'] }
137
+
138
+ context 'when the limit in the response is nil' do
139
+ let(:display_facet) do
140
+ instance_double(Blacklight::Solr::Response::Facets::FacetField, items: items, limit: nil, sort: :index, offset: 0, prefix: nil)
141
+ end
142
+
143
+ it "uses the config setting" do
144
+ blacklight_config.facet_fields['language_facet'].limit = 10
145
+ expect(facet_limit).to eq 10
146
+ end
147
+ end
148
+
149
+ context 'when the limit in the response is provided' do
150
+ let(:display_facet) do
151
+ instance_double(Blacklight::Solr::Response::Facets::FacetField, items: items, limit: 16, sort: :index, offset: 0, prefix: nil)
152
+ end
153
+
154
+ it "gets the limit from the facet field in @response" do
155
+ expect(facet_limit).to eq 15
156
+ end
157
+ end
158
+
159
+ context 'when not in the display_facet' do
160
+ let(:display_facet) { nil }
161
+
162
+ it "defaults to 10" do
163
+ expect(facet_limit).to eq 10
164
+ end
165
+ end
166
+ end
167
+
168
+ context 'for facet fields with a key that is different from the field name' do
169
+ before do
170
+ allow(controller).to receive(:blacklight_config).and_return(blacklight_config)
171
+ end
172
+
173
+ let(:blacklight_config) do
174
+ Blacklight::Configuration.new do |config|
175
+ config.add_facet_field 'some_key', field: 'x', limit: true
176
+ end
177
+ end
178
+ let(:facet_field) { blacklight_config.facet_fields['some_key'] }
179
+ let(:display_facet) do
180
+ instance_double(Blacklight::Solr::Response::Facets::FacetField, items: items, limit: 16, sort: :index, offset: 0, prefix: nil)
181
+ end
182
+
183
+ it 'gets the limit from the facet field in the @response' do
184
+ expect(facet_limit).to eq 15
185
+ end
186
+ end
187
+ end
115
188
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'spec_helper'
3
4
 
4
5
  RSpec.describe Blacklight::FacetGroupedItemPresenter, type: :presenter do
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'spec_helper'
3
4
 
4
5
  RSpec.describe Blacklight::FacetItemPresenter, type: :presenter do
@@ -7,22 +8,22 @@ RSpec.describe Blacklight::FacetItemPresenter, type: :presenter do
7
8
  end
8
9
 
9
10
  let(:facet_item) { instance_double(Blacklight::Solr::Response::Facets::FacetItem) }
11
+ let(:filter_field) { instance_double(Blacklight::SearchState::FilterField, include?: true) }
10
12
  let(:facet_config) { Blacklight::Configuration::FacetField.new(key: 'key') }
11
13
  let(:facet_field) { instance_double(Blacklight::Solr::Response::Facets::FacetField) }
12
14
  let(:view_context) { controller.view_context }
13
- let(:search_state) { instance_double(Blacklight::SearchState) }
15
+ let(:search_state) { instance_double(Blacklight::SearchState, filter: filter_field) }
14
16
 
15
17
  describe '#selected?' do
16
- it 'works' do
17
- allow(search_state).to receive(:has_facet?).and_return(true)
18
- expect(presenter.selected?).to be true
19
- end
18
+ subject { presenter.selected? }
19
+
20
+ it { is_expected.to be true }
20
21
  end
21
22
 
22
23
  describe '#label' do
23
- it "is the facet value for an ordinary facet" do
24
+ it "is the stringified facet value for an ordinary facet" do
24
25
  allow(facet_config).to receive_messages(query: nil, date: nil, helper_method: nil, url_method: nil)
25
- expect(presenter.label).to eq facet_item
26
+ expect(presenter.label).to eq facet_item.to_s
26
27
  end
27
28
 
28
29
  it "allows you to pass in a :helper_method argument to the configuration" do
@@ -63,9 +64,7 @@ RSpec.describe Blacklight::FacetItemPresenter, type: :presenter do
63
64
  end
64
65
 
65
66
  describe '#href' do
66
- before do
67
- allow(search_state).to receive(:has_facet?).and_return(false)
68
- end
67
+ let(:filter_field) { instance_double(Blacklight::SearchState::FilterField, include?: false) }
69
68
 
70
69
  it 'is the url to apply the facet' do
71
70
  allow(search_state).to receive(:add_facet_params_and_redirect).with('key', facet_item).and_return(f: 'x')
@@ -87,11 +86,13 @@ RSpec.describe Blacklight::FacetItemPresenter, type: :presenter do
87
86
  end
88
87
 
89
88
  context 'with a selected facet' do
90
- it 'is the url to remove the facet' do
91
- allow(search_state).to receive(:has_facet?).and_return(true)
92
- allow(search_state).to receive(:remove_facet_params).with('key', facet_item).and_return({})
89
+ let(:filter_field) { instance_double(Blacklight::SearchState::FilterField, include?: true, remove: {}) }
90
+
91
+ before do
93
92
  allow(view_context).to receive(:search_action_path).with({}).and_return('/catalog')
93
+ end
94
94
 
95
+ it 'is the url to remove the facet' do
95
96
  expect(presenter.href).to eq '/catalog'
96
97
  end
97
98
  end
@@ -36,7 +36,6 @@ RSpec.describe Blacklight::FieldPresenter, api: true do
36
36
  config.add_index_field 'solr_doc_accessor', accessor: true
37
37
  config.add_index_field 'explicit_accessor', accessor: :solr_doc_accessor
38
38
  config.add_index_field 'explicit_array_accessor', accessor: [:solr_doc_accessor, :some_method]
39
- config.add_index_field 'explicit_values', values: ->(_config, _doc) { ['some-value'] }
40
39
  config.add_index_field 'explicit_values_with_context', values: ->(_config, _doc, view_context) { [view_context.params[:x]] }
41
40
  config.add_index_field 'alias', field: 'qwer'
42
41
  config.add_index_field 'with_default', default: 'value'
@@ -162,15 +161,6 @@ RSpec.describe Blacklight::FieldPresenter, api: true do
162
161
  end
163
162
  end
164
163
 
165
- context 'when the values lambda is provided' do
166
- let(:field_name) { 'explicit_values' }
167
-
168
- it 'calls the accessors on the return of the preceeding' do
169
- allow(Deprecation).to receive(:warn)
170
- expect(subject).to eq 'some-value'
171
- end
172
- end
173
-
174
164
  context 'when the values lambda is provided and accepts the view contexts' do
175
165
  let(:field_name) { 'explicit_values_with_context' }
176
166
 
@@ -241,10 +231,6 @@ RSpec.describe Blacklight::FieldPresenter, api: true do
241
231
 
242
232
  let(:field_config) { double('field config', if: true, unless: false, except_operations: nil) }
243
233
 
244
- before do
245
- allow(presenter).to receive_messages(document_has_value?: true)
246
- end
247
-
248
234
  it { is_expected.to be true }
249
235
 
250
236
  context 'when the view context says not to render the field' do
@@ -25,14 +25,12 @@ RSpec.describe Blacklight::IndexPresenter, api: true do
25
25
  end
26
26
 
27
27
  describe '#fields' do
28
- let(:field) { instance_double(Blacklight::Configuration::Field) }
29
-
30
28
  before do
31
- allow(config).to receive(:index_fields_for).and_return(title: field)
29
+ config.add_index_field 'title'
32
30
  end
33
31
 
34
32
  it 'returns the list from the configs' do
35
- expect(subject.send(:fields)).to eq(title: field)
33
+ expect(subject.send(:fields).keys).to eq ['title']
36
34
  end
37
35
  end
38
36
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'spec_helper'
3
4
 
4
5
  RSpec.describe Blacklight::JsonPresenter, api: true do
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'spec_helper'
3
4
 
4
5
  RSpec.describe Blacklight::LinkAlternatePresenter do
@@ -25,8 +26,8 @@ RSpec.describe Blacklight::LinkAlternatePresenter do
25
26
 
26
27
  let(:expected_html) do
27
28
  '<link rel="alternate" title="xml" type="application/xml" href="http://test.host/catalog/9999.xml" />' \
28
- '<link rel="alternate" title="dc_xml" type="text/xml" href="http://test.host/catalog/9999.dc_xml" />' \
29
- '<link rel="alternate" title="oai_dc_xml" type="text/xml" href="http://test.host/catalog/9999.oai_dc_xml" />'
29
+ '<link rel="alternate" title="dc_xml" type="text/xml" href="http://test.host/catalog/9999.dc_xml" />' \
30
+ '<link rel="alternate" title="oai_dc_xml" type="text/xml" href="http://test.host/catalog/9999.oai_dc_xml" />'
30
31
  end
31
32
 
32
33
  it { is_expected.to be_equivalent_to expected_html }
@@ -14,10 +14,7 @@ RSpec.describe Blacklight::ShowPresenter, api: true do
14
14
  let(:search_state) { Blacklight::SearchState.new(params, config, controller) }
15
15
 
16
16
  let(:document) do
17
- SolrDocument.new(id: 1,
18
- 'link_to_facet_true' => 'x',
19
- 'link_to_facet_named' => 'x',
20
- 'qwer' => 'document qwer value')
17
+ SolrDocument.new(id: 'xyz', some_field: 'value')
21
18
  end
22
19
 
23
20
  before do
@@ -108,43 +105,36 @@ RSpec.describe Blacklight::ShowPresenter, api: true do
108
105
  end
109
106
 
110
107
  describe '#fields' do
111
- let(:field) { instance_double(Blacklight::Configuration::Field) }
112
-
113
108
  before do
114
- allow(config).to receive(:show_fields_for).and_return(title: field)
109
+ config.add_show_field 'title'
115
110
  end
116
111
 
117
112
  it 'returns the list from the configs' do
118
- expect(subject.send(:fields)).to eq(title: field)
113
+ expect(subject.send(:fields).keys).to eq ['title']
119
114
  end
120
115
  end
121
116
 
122
117
  describe "#heading" do
123
118
  it "falls back to an id" do
124
- allow(document).to receive(:[]).with('id').and_return "xyz"
125
119
  expect(subject.heading).to eq document.id
126
120
  end
127
121
 
128
122
  it "returns the value of the field" do
129
- config.show.title_field = :x
130
- allow(document).to receive(:has?).with(:x).and_return(true)
131
- allow(document).to receive(:fetch).with(:x, nil).and_return("value")
123
+ config.show.title_field = 'some_field'
132
124
  expect(subject.heading).to eq "value"
133
125
  end
134
126
 
135
127
  it "returns the first present value" do
136
- config.show.title_field = [:x, :y]
137
- allow(document).to receive(:fetch).with(:x, nil).and_return(nil)
138
- allow(document).to receive(:fetch).with(:y, nil).and_return("value")
128
+ config.show.title_field = %w[a_field_that_doesnt_exist some_field]
139
129
  expect(subject.heading).to eq "value"
140
130
  end
141
131
 
142
132
  it "can use explicit field configuration" do
143
- config.show.title_field = Blacklight::Configuration::Field.new(field: 'x', values: ->(*_) { 'hardcoded' })
133
+ config.show.title_field = Blacklight::Configuration::DisplayField.new(field: 'x', values: ->(*_) { 'hardcoded' })
144
134
  expect(subject.heading).to eq 'hardcoded'
145
135
  end
146
136
 
147
- context "when empty document" do
137
+ context "with an empty document" do
148
138
  let(:document) { SolrDocument.new({}) }
149
139
 
150
140
  it "returns an empty string as the heading" do
@@ -155,26 +145,21 @@ RSpec.describe Blacklight::ShowPresenter, api: true do
155
145
 
156
146
  describe "#html_title" do
157
147
  it "falls back to an id" do
158
- allow(document).to receive(:[]).with('id').and_return "xyz"
159
148
  expect(subject.html_title).to eq document.id
160
149
  end
161
150
 
162
151
  it "returns the value of the field" do
163
- config.show.html_title_field = :x
164
- allow(document).to receive(:has?).with(:x).and_return(true)
165
- allow(document).to receive(:fetch).with(:x, nil).and_return("value")
152
+ config.show.html_title_field = 'some_field'
166
153
  expect(subject.html_title).to eq "value"
167
154
  end
168
155
 
169
156
  it "returns the first present value" do
170
- config.show.html_title_field = [:x, :y]
171
- allow(document).to receive(:fetch).with(:x, nil).and_return(nil)
172
- allow(document).to receive(:fetch).with(:y, nil).and_return("value")
157
+ config.show.html_title_field = %w[a_field_that_doesnt_exist some_field]
173
158
  expect(subject.html_title).to eq "value"
174
159
  end
175
160
 
176
161
  it "can use explicit field configuration" do
177
- config.show.html_title_field = Blacklight::Configuration::Field.new(field: 'x', values: ->(*_) { 'hardcoded' })
162
+ config.show.html_title_field = Blacklight::Configuration::DisplayField.new(field: 'x', values: ->(*_) { 'hardcoded' })
178
163
  expect(subject.html_title).to eq 'hardcoded'
179
164
  end
180
165
  end
@@ -95,7 +95,7 @@ RSpec.describe Blacklight::ThumbnailPresenter do
95
95
  allow(view_context).to receive_messages(xyz: nil)
96
96
  end
97
97
 
98
- it { is_expected.to be nil }
98
+ it { is_expected.to be_nil }
99
99
  end
100
100
  end
101
101
 
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ RSpec.describe 'GET /catalog/suggest' do
6
+ it 'returns suggestions' do
7
+ get '/catalog/suggest?q=new'
8
+ expect(response.body).to eq <<-RESULT
9
+ <li role="option"><span>new jersey</span></li>
10
+ <li role="option"><span>new jersey bridgeton biography</span></li>
11
+ <li role="option"><span>new jersey bridgeton history</span></li>
12
+ <li role="option"><span>new york</span></li>
13
+ <li role="option"><span>nuwākshūṭ</span></li>
14
+ RESULT
15
+ end
16
+ end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
3
4
 
4
5
  RSpec.describe "Routing" do
5
6
  describe "Paths Generated by Custom Routes:" do