geoblacklight 4.0.0 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (225) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +21 -6
  3. data/.solr_wrapper +1 -0
  4. data/.standard.yml +1 -0
  5. data/Gemfile +13 -11
  6. data/README.md +1 -1
  7. data/Rakefile +42 -50
  8. data/app/assets/images/blacklight/american-geographical-society-library-uwm-libraries.svg +26 -0
  9. data/app/assets/images/blacklight/arizona.svg +4 -0
  10. data/app/assets/images/blacklight/circle-info-solid.svg +1 -0
  11. data/app/assets/images/blacklight/fire-solid.svg +1 -0
  12. data/app/assets/images/blacklight/lightbulb-solid.svg +1 -0
  13. data/app/assets/images/blacklight/nebraska.svg +4 -0
  14. data/app/assets/images/blacklight/rutgers.svg +5 -0
  15. data/app/assets/images/blacklight/triangle-exclamation-solid.svg +1 -0
  16. data/app/assets/stylesheets/geoblacklight/modules/sidebar.scss +8 -0
  17. data/app/components/geoblacklight/display_note_component.html.erb +1 -0
  18. data/app/components/geoblacklight/display_note_component.rb +47 -0
  19. data/app/components/geoblacklight/icon_facet_item_component.rb +2 -2
  20. data/app/controllers/download_controller.rb +36 -37
  21. data/app/controllers/relation_controller.rb +1 -0
  22. data/app/controllers/wms_controller.rb +1 -0
  23. data/app/helpers/arcgis_helper.rb +2 -1
  24. data/app/helpers/blacklight_helper.rb +2 -1
  25. data/app/helpers/carto_helper.rb +3 -2
  26. data/app/helpers/geoblacklight/geoblacklight_helper_behavior.rb +2 -1
  27. data/app/helpers/geoblacklight_helper.rb +44 -36
  28. data/app/models/concerns/geoblacklight/bbox_filter_query.rb +1 -1
  29. data/app/models/concerns/geoblacklight/solr_document/arcgis.rb +1 -0
  30. data/app/models/concerns/geoblacklight/solr_document/carto.rb +1 -0
  31. data/app/models/concerns/geoblacklight/solr_document/citation.rb +3 -2
  32. data/app/models/concerns/geoblacklight/solr_document/finder.rb +1 -0
  33. data/app/models/concerns/geoblacklight/solr_document/inspection.rb +1 -0
  34. data/app/models/concerns/geoblacklight/solr_document.rb +17 -9
  35. data/app/models/concerns/geoblacklight/suppressed_records_search_behavior.rb +2 -1
  36. data/app/presenters/geoblacklight/document_presenter.rb +3 -2
  37. data/app/views/catalog/_show_default_display_note.html.erb +7 -0
  38. data/app/views/catalog/_show_sidebar.html.erb +1 -0
  39. data/app/views/catalog/_show_sidebar_static_map.html.erb +10 -0
  40. data/app/views/relation/index.json.jbuilder +1 -1
  41. data/config/initializers/new_gbl_settings_defaults_4.1.yml +104 -0
  42. data/config/initializers/rails_config.rb +5 -1
  43. data/config/locales/geoblacklight.en.yml +18 -10
  44. data/geoblacklight.gemspec +36 -40
  45. data/lib/generators/geoblacklight/assets_generator.rb +15 -15
  46. data/lib/generators/geoblacklight/install_generator.rb +24 -23
  47. data/lib/generators/geoblacklight/templates/catalog_controller.rb +66 -71
  48. data/lib/generators/geoblacklight/templates/settings.yml +74 -22
  49. data/lib/geoblacklight/bounding_box.rb +1 -0
  50. data/lib/geoblacklight/constants.rb +26 -25
  51. data/lib/geoblacklight/download/geojson_download.rb +10 -9
  52. data/lib/geoblacklight/download/geotiff_download.rb +6 -5
  53. data/lib/geoblacklight/download/hgl_download.rb +4 -3
  54. data/lib/geoblacklight/download/kmz_download.rb +11 -10
  55. data/lib/geoblacklight/download/shapefile_download.rb +10 -9
  56. data/lib/geoblacklight/download.rb +12 -11
  57. data/lib/geoblacklight/engine.rb +10 -9
  58. data/lib/geoblacklight/exceptions.rb +3 -0
  59. data/lib/geoblacklight/faraday_middleware/follow_redirects.rb +12 -11
  60. data/lib/geoblacklight/geometry.rb +6 -5
  61. data/lib/geoblacklight/item_viewer.rb +4 -3
  62. data/lib/geoblacklight/metadata/base.rb +4 -3
  63. data/lib/geoblacklight/metadata/fgdc.rb +1 -0
  64. data/lib/geoblacklight/metadata/html.rb +5 -4
  65. data/lib/geoblacklight/metadata/iso19139.rb +1 -0
  66. data/lib/geoblacklight/metadata.rb +1 -0
  67. data/lib/geoblacklight/metadata_transformer/base.rb +5 -4
  68. data/lib/geoblacklight/metadata_transformer/fgdc.rb +1 -0
  69. data/lib/geoblacklight/metadata_transformer/iso19139.rb +1 -0
  70. data/lib/geoblacklight/metadata_transformer.rb +6 -2
  71. data/lib/geoblacklight/reference.rb +3 -2
  72. data/lib/geoblacklight/references.rb +11 -6
  73. data/lib/geoblacklight/relation/ancestors.rb +4 -3
  74. data/lib/geoblacklight/relation/descendants.rb +4 -3
  75. data/lib/geoblacklight/relation/relation_response.rb +3 -2
  76. data/lib/geoblacklight/routes/downloadable.rb +3 -2
  77. data/lib/geoblacklight/routes/exportable.rb +4 -3
  78. data/lib/geoblacklight/routes/wms.rb +2 -1
  79. data/lib/geoblacklight/routes.rb +4 -3
  80. data/lib/geoblacklight/version.rb +2 -1
  81. data/lib/geoblacklight/view_helper_override.rb +3 -2
  82. data/lib/geoblacklight/wms_layer/feature_info_response.rb +5 -4
  83. data/lib/geoblacklight/wms_layer.rb +4 -3
  84. data/lib/geoblacklight.rb +32 -31
  85. data/lib/tasks/geoblacklight.rake +45 -44
  86. data/schema/geoblacklight-schema-aardvark.json +6 -0
  87. data/spec/components/geoblacklight/display_note_component_spec.rb +27 -0
  88. data/spec/components/geoblacklight/homepage_feature_facet_component_spec.rb +11 -10
  89. data/spec/components/geoblacklight/icon_facet_item_component_spec.rb +8 -7
  90. data/spec/config/initializers/rails_config_spec.rb +10 -9
  91. data/spec/controllers/catalog_controller_spec.rb +27 -26
  92. data/spec/controllers/download_controller_spec.rb +50 -49
  93. data/spec/controllers/relation_controller_spec.rb +5 -4
  94. data/spec/controllers/wms_controller_spec.rb +10 -9
  95. data/spec/factories/user.rb +3 -2
  96. data/spec/features/bookmarks_spec.rb +7 -6
  97. data/spec/features/configurable_basemap_spec.rb +12 -11
  98. data/spec/features/data_dictionary_download_spec.rb +11 -10
  99. data/spec/features/download_layer_spec.rb +64 -63
  100. data/spec/features/empty_search_spec.rb +6 -5
  101. data/spec/features/esri_viewer_spec.rb +33 -32
  102. data/spec/features/exports_spec.rb +18 -17
  103. data/spec/features/full_screen_controll_spec.rb +8 -8
  104. data/spec/features/help_text_spec.rb +6 -5
  105. data/spec/features/home_page_spec.rb +30 -29
  106. data/spec/features/iiif_viewer_spec.rb +6 -5
  107. data/spec/features/index_map_spec.rb +17 -16
  108. data/spec/features/layer_inspection_spec.rb +8 -7
  109. data/spec/features/layer_opacity_spec.rb +15 -14
  110. data/spec/features/layer_preview_spec.rb +11 -10
  111. data/spec/features/layer_with_no_references_spec.rb +5 -4
  112. data/spec/features/linkified_attribute_table_spec.rb +8 -7
  113. data/spec/features/metadata_panel_spec.rb +32 -31
  114. data/spec/features/missing_metadata_spec.rb +18 -17
  115. data/spec/features/multiple_downloads_spec.rb +11 -10
  116. data/spec/features/oembed_spec.rb +6 -5
  117. data/spec/features/relations_spec.rb +51 -26
  118. data/spec/features/saved_searches_spec.rb +7 -6
  119. data/spec/features/search_bar_spec.rb +9 -8
  120. data/spec/features/search_results_complex_geometry_spec.rb +12 -11
  121. data/spec/features/search_results_icons_spec.rb +10 -9
  122. data/spec/features/search_results_map_spec.rb +21 -20
  123. data/spec/features/search_results_overlap_ratio_spec.rb +17 -16
  124. data/spec/features/search_spec.rb +19 -18
  125. data/spec/features/show_page_download_spec.rb +15 -14
  126. data/spec/features/show_page_metadata_spec.rb +9 -8
  127. data/spec/features/show_page_sidebar_static_map_spec.rb +21 -0
  128. data/spec/features/sms_spec.rb +12 -11
  129. data/spec/features/split_view.html.erb_spec.rb +56 -55
  130. data/spec/features/suppressed_records_spec.rb +10 -9
  131. data/spec/features/tilejson_spec.rb +9 -8
  132. data/spec/features/tms_spec.rb +6 -5
  133. data/spec/features/web_services_modal_spec.rb +37 -36
  134. data/spec/features/wmts_spec.rb +16 -15
  135. data/spec/features/xyz_spec.rb +6 -5
  136. data/spec/fixtures/solr_documents/actual-papermap1.json +1 -1
  137. data/spec/fixtures/solr_documents/actual-point1.json +1 -1
  138. data/spec/fixtures/solr_documents/actual-polygon1.json +1 -1
  139. data/spec/fixtures/solr_documents/actual-raster1.json +1 -1
  140. data/spec/fixtures/solr_documents/baruch_ancestor1.json +1 -1
  141. data/spec/fixtures/solr_documents/baruch_ancestor2.json +1 -1
  142. data/spec/fixtures/solr_documents/baruch_documentation_download.json +2 -2
  143. data/spec/fixtures/solr_documents/cornell_html_metadata.json +1 -1
  144. data/spec/fixtures/solr_documents/display-note.json +52 -0
  145. data/spec/fixtures/solr_documents/esri-dynamic-layer-all-layers.json +1 -1
  146. data/spec/fixtures/solr_documents/esri-dynamic-layer-single-layer.json +1 -1
  147. data/spec/fixtures/solr_documents/esri-feature-layer.json +1 -1
  148. data/spec/fixtures/solr_documents/esri-image-map-layer.json +1 -1
  149. data/spec/fixtures/solr_documents/esri-tiled_map_layer.json +1 -1
  150. data/spec/fixtures/solr_documents/esri-wms-layer.json +1 -1
  151. data/spec/fixtures/solr_documents/harvard_raster.json +1 -1
  152. data/spec/fixtures/solr_documents/iiif-eastern-hemisphere.json +1 -1
  153. data/spec/fixtures/solr_documents/index-map-polygon-no-downloadurl.json +1 -1
  154. data/spec/fixtures/solr_documents/index-map-polygon.json +1 -1
  155. data/spec/fixtures/solr_documents/index-map-stanford.json +1 -1
  156. data/spec/fixtures/solr_documents/index_map_point.json +1 -1
  157. data/spec/fixtures/solr_documents/princeton-parent.json +1 -1
  158. data/spec/fixtures/solr_documents/public_direct_download.json +1 -1
  159. data/spec/fixtures/solr_documents/public_iiif_princeton.json +1 -1
  160. data/spec/fixtures/solr_documents/restricted-line.json +1 -1
  161. data/spec/fixtures/solr_documents/tilejson.json +2 -2
  162. data/spec/fixtures/solr_documents/umn_metro_result1.json +2 -2
  163. data/spec/fixtures/solr_documents/umn_state_result1.json +1 -1
  164. data/spec/fixtures/solr_documents/umn_state_result2.json +1 -1
  165. data/spec/fixtures/solr_documents/uva_slug_colon.json +1 -1
  166. data/spec/fixtures/solr_documents/wmts-multiple.json +1 -1
  167. data/spec/fixtures/solr_documents/wmts-single-layer.json +6 -6
  168. data/spec/fixtures/solr_documents/xyz.json +3 -3
  169. data/spec/helpers/arcgis_helper_spec.rb +8 -7
  170. data/spec/helpers/carto_helper_spec.rb +6 -5
  171. data/spec/helpers/geoblacklight/geoblacklight_helper_behavior_spec.rb +10 -15
  172. data/spec/helpers/geoblacklight_helper_spec.rb +139 -138
  173. data/spec/lib/geoblacklight/bounding_box_spec.rb +14 -13
  174. data/spec/lib/geoblacklight/document_presenter_spec.rb +26 -25
  175. data/spec/lib/geoblacklight/download/geojson_download_spec.rb +8 -7
  176. data/spec/lib/geoblacklight/download/geotiff_download_spec.rb +8 -7
  177. data/spec/lib/geoblacklight/download/hgl_download_spec.rb +16 -15
  178. data/spec/lib/geoblacklight/download/kmz_download_spec.rb +9 -8
  179. data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +8 -7
  180. data/spec/lib/geoblacklight/download_spec.rb +61 -60
  181. data/spec/lib/geoblacklight/geometry_spec.rb +29 -28
  182. data/spec/lib/geoblacklight/item_viewer_spec.rb +25 -24
  183. data/spec/lib/geoblacklight/metadata/base_spec.rb +44 -43
  184. data/spec/lib/geoblacklight/metadata/html_spec.rb +7 -6
  185. data/spec/lib/geoblacklight/metadata_spec.rb +15 -14
  186. data/spec/lib/geoblacklight/metadata_transformer/base_spec.rb +13 -12
  187. data/spec/lib/geoblacklight/metadata_transformer/fgdc_spec.rb +8 -7
  188. data/spec/lib/geoblacklight/metadata_transformer/iso19139_spec.rb +8 -7
  189. data/spec/lib/geoblacklight/metadata_transformer_spec.rb +15 -14
  190. data/spec/lib/geoblacklight/reference_spec.rb +28 -27
  191. data/spec/lib/geoblacklight/references_spec.rb +89 -76
  192. data/spec/lib/geoblacklight/relation/ancestors_spec.rb +17 -16
  193. data/spec/lib/geoblacklight/relation/descendants_spec.rb +17 -16
  194. data/spec/lib/geoblacklight/relation/relation_response_spec.rb +29 -28
  195. data/spec/lib/geoblacklight/view_helper_override_spec.rb +14 -13
  196. data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +19 -18
  197. data/spec/lib/geoblacklight/wms_layer_spec.rb +31 -30
  198. data/spec/models/concerns/geoblacklight/bbox_filter_field_spec.rb +31 -31
  199. data/spec/models/concerns/geoblacklight/bbox_filter_query_spec.rb +32 -32
  200. data/spec/models/concerns/geoblacklight/solr_document/carto_spec.rb +16 -15
  201. data/spec/models/concerns/geoblacklight/solr_document/citation_spec.rb +7 -6
  202. data/spec/models/concerns/geoblacklight/solr_document/finder_spec.rb +16 -17
  203. data/spec/models/concerns/geoblacklight/solr_document/inspection_spec.rb +7 -6
  204. data/spec/models/concerns/geoblacklight/solr_document_spec.rb +121 -107
  205. data/spec/models/concerns/geoblacklight/suppressed_records_search_behavior_spec.rb +8 -7
  206. data/spec/presenters/geoblacklight/bbox_item_presenter_spec.rb +10 -10
  207. data/spec/routing/catalog_routing_spec.rb +4 -3
  208. data/spec/spec_helper.rb +34 -33
  209. data/spec/support/backport_test_helpers.rb +6 -5
  210. data/spec/support/features/session_helpers.rb +8 -7
  211. data/spec/support/features.rb +2 -1
  212. data/spec/support/fixtures.rb +2 -1
  213. data/spec/tasks/geoblacklight_spec.rb +10 -9
  214. data/spec/test_app_templates/lib/generators/test_app_generator.rb +16 -15
  215. data/spec/views/catalog/_document_split.html.erb_spec.rb +3 -2
  216. data/spec/views/catalog/_index_split.html.erb_spec.rb +3 -2
  217. data/spec/views/catalog/_results_pagination.html.erb_spec.rb +5 -4
  218. data/spec/views/catalog/_show_downloads.html.erb_spec.rb +11 -10
  219. data/spec/views/catalog/_show_tools.html.erb_spec.rb +13 -12
  220. data/template.rb +9 -8
  221. metadata +29 -212
  222. data/.gitmodules +0 -0
  223. data/.rubocop.yml +0 -111
  224. data/.rubocop_todo.yml +0 -437
  225. data/config/initializers/new_gbl_settings_defaults_3_4.yml +0 -6
@@ -1,37 +1,38 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'Search' do
5
- scenario 'Suppressed records are hidden' do
6
- visit '/?q=Sanborn+Map+Company'
7
- expect(page).to have_css '.document', count: 1
3
+ require "spec_helper"
4
+
5
+ feature "Search" do
6
+ scenario "Suppressed records are hidden" do
7
+ visit "/?q=Sanborn+Map+Company"
8
+ expect(page).to have_css ".document", count: 1
8
9
  end
9
10
 
10
- scenario 'When searching child records from a parent record, supressed records are not hidden', js: true do
11
- visit '/catalog/princeton-1r66j405w'
11
+ scenario "When searching child records from a parent record, supressed records are not hidden", js: true do
12
+ visit "/catalog/princeton-1r66j405w"
12
13
 
13
- within('.card.relations.relationship-source_descendants') do
14
+ within(".card.relations.relationship-source_descendants") do
14
15
  expect(page).to have_link(href: /f%5Bdct_source_sm%5D/)
15
16
  end
16
17
 
17
- click_link 'Browse all 4 records...'
18
- expect(page).to have_css '.document', count: 4
18
+ click_link "Browse all 4 records..."
19
+ expect(page).to have_css ".document", count: 4
19
20
  end
20
21
 
21
- scenario 'When sorting by year desc, highest value sorts first' do
22
- visit '/?f%5Bschema_provider_s%5D%5B%5D=University+of+Minnesota&sort=gbl_indexYear_im+desc%2C+dct_title_sort+asc'
22
+ scenario "When sorting by year desc, highest value sorts first" do
23
+ visit "/?f%5Bschema_provider_s%5D%5B%5D=University+of+Minnesota&sort=gbl_indexYear_im+desc%2C+dct_title_sort+asc"
23
24
 
24
- first_doc = find('.document', match: :first)
25
+ first_doc = find(".document", match: :first)
25
26
 
26
27
  # Doc with gbl_indexYear_im value: [2014, 2030]
27
- expect(first_doc['data-document-id']).to eq('02236876-9c21-42f6-9870-d2562da8e44f')
28
+ expect(first_doc["data-document-id"]).to eq("02236876-9c21-42f6-9870-d2562da8e44f")
28
29
  end
29
30
 
30
- scenario 'When sorting by year, missing values sort last' do
31
- visit '/?f%5Bschema_provider_s%5D%5B%5D=University+of+Minnesota&sort=gbl_indexYear_im+desc%2C+dct_title_sort+asc'
32
- last_doc = find_all('.document').last
31
+ scenario "When sorting by year, missing values sort last" do
32
+ visit "/?f%5Bschema_provider_s%5D%5B%5D=University+of+Minnesota&sort=gbl_indexYear_im+desc%2C+dct_title_sort+asc"
33
+ last_doc = find_all(".document").last
33
34
 
34
35
  # Doc without gbl_indexYear_im value
35
- expect(last_doc['data-document-id']).to eq('05d-03-nogeomtype')
36
+ expect(last_doc["data-document-id"]).to eq("05d-03-nogeomtype")
36
37
  end
37
38
  end
@@ -1,28 +1,29 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'Download display on show page' do
5
- scenario 'with download String' do
6
- visit solr_document_path '2eddde2f-c222-41ca-bd07-2fd74a21f4de'
7
- find('#downloads-button').click
8
- within '#downloads-collapse' do
3
+ require "spec_helper"
4
+
5
+ feature "Download display on show page" do
6
+ scenario "with download String" do
7
+ visit solr_document_path "2eddde2f-c222-41ca-bd07-2fd74a21f4de"
8
+ find("#downloads-button").click
9
+ within "#downloads-collapse" do
9
10
  expect(page).to have_selector(:css, 'a[href="ftp://gdrs.dnr.state.mn.us/gdrs/data/pub/us_mn_state_dnr/fgdb_base_usgs_scanned_topo_100k_drg.zip"]')
10
11
  end
11
12
  end
12
13
 
13
- scenario 'with download Array' do
14
- visit solr_document_path 'princeton-sx61dn82p'
15
- find('#downloads-button').click
16
- within '#downloads-collapse' do
14
+ scenario "with download Array" do
15
+ visit solr_document_path "princeton-sx61dn82p"
16
+ find("#downloads-button").click
17
+ within "#downloads-collapse" do
17
18
  expect(page).to have_selector(:css, 'a[href="https://figgy.princeton.edu/downloads/a990e1b4-7f0e-44b8-ae2a-de7e93cdd74a/file/36a2274c-e0c6-4901-a14f-7c422d15e194"]')
18
19
  expect(page).to have_selector(:css, 'a[href="https://libimages1.princeton.edu/loris/figgy_prod/2e%2Fa9%2F43%2F2ea943b0bd4348fc9954b299f1b359f6%2Fintermediate_file.jp2/full/full/0/default.jpg"]')
19
20
  end
20
21
  end
21
22
 
22
- scenario 'with Harvard hgl_download' do
23
- visit solr_document_path 'harvard-g7064-s2-1834-k3'
24
- find('#downloads-button').click
25
- within '#downloads-collapse' do
23
+ scenario "with Harvard hgl_download" do
24
+ visit solr_document_path "harvard-g7064-s2-1834-k3"
25
+ find("#downloads-button").click
26
+ within "#downloads-collapse" do
26
27
  expect(page).to have_selector(:css, 'a[href="/download/hgl/harvard-g7064-s2-1834-k3"][data-download-type="harvard-hgl"]')
27
28
  end
28
29
  end
@@ -1,13 +1,14 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'Metadata display on show page' do
5
- scenario 'with default CatalogController specified fields' do
6
- visit solr_document_path 'stanford-dp018hs9766'
7
- within '.document-metadata' do
8
- expect(page).to have_css 'dt', count: 16
9
- expect(page).to have_css 'dd', count: 16
10
- expect(page).to have_css 'div.truncate-abstract', count: 1
3
+ require "spec_helper"
4
+
5
+ feature "Metadata display on show page" do
6
+ scenario "with default CatalogController specified fields" do
7
+ visit solr_document_path "stanford-dp018hs9766"
8
+ within ".document-metadata" do
9
+ expect(page).to have_css "dt", count: 16
10
+ expect(page).to have_css "dd", count: 16
11
+ expect(page).to have_css "div.truncate-abstract", count: 1
11
12
  end
12
13
  end
13
14
  end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "spec_helper"
4
+
5
+ feature "Display sidebar static map on catalog#show page" do
6
+ scenario "Document viewer protocol: IIIF (show)" do
7
+ visit solr_document_path "princeton-02870w62c"
8
+ within ".page-sidebar" do
9
+ expect(page).to have_content "Location"
10
+ expect(page).to have_css "div#static-map"
11
+ end
12
+ end
13
+
14
+ scenario "Document viewer protocol: WMS (do not show)" do
15
+ visit solr_document_path "stanford-cg357zz0321"
16
+ within ".page-sidebar" do
17
+ expect(page).to have_no_content "Location"
18
+ expect(page).to have_no_css "div#static-map"
19
+ end
20
+ end
21
+ end
@@ -1,16 +1,17 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'SMS tool', js: true do
5
- scenario 'shows up in tools' do
6
- visit solr_document_path 'stanford-cg357zz0321'
7
- expect(page).to have_css 'li.sms a', text: 'SMS This'
8
- click_link 'SMS This'
9
- within '.modal-body' do
10
- expect(page).to have_css 'input', count: 1
11
- expect(page).to have_css 'label', text: 'Phone Number:'
12
- expect(page).to have_css 'select', count: 1
13
- expect(page).to have_css 'label', text: 'Carrier'
3
+ require "spec_helper"
4
+
5
+ feature "SMS tool", js: true do
6
+ scenario "shows up in tools" do
7
+ visit solr_document_path "stanford-cg357zz0321"
8
+ expect(page).to have_css "li.sms a", text: "SMS This"
9
+ click_link "SMS This"
10
+ within ".modal-body" do
11
+ expect(page).to have_css "input", count: 1
12
+ expect(page).to have_css "label", text: "Phone Number:"
13
+ expect(page).to have_css "select", count: 1
14
+ expect(page).to have_css "label", text: "Carrier"
14
15
  end
15
16
  end
16
17
  end
@@ -1,90 +1,91 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'Index view', js: true do
3
+ require "spec_helper"
4
+
5
+ feature "Index view", js: true do
5
6
  let(:subject_field) { Settings.FIELDS.SUBJECT }
6
7
  before do
7
- visit search_catalog_path(q: '*')
8
+ visit search_catalog_path(q: "*")
8
9
  end
9
10
 
10
- scenario 'should have documents and map on page' do
11
- visit search_catalog_path(f: { Settings.FIELDS.PROVIDER => ['Stanford'] })
12
- expect(page).to have_css('#documents')
13
- expect(page).to have_css('.document', count: 6)
14
- expect(page).to have_css('#map')
11
+ scenario "should have documents and map on page" do
12
+ visit search_catalog_path(f: {Settings.FIELDS.PROVIDER => ["Stanford"]})
13
+ expect(page).to have_css("#documents")
14
+ expect(page).to have_css(".document", count: 6)
15
+ expect(page).to have_css("#map")
15
16
  end
16
17
 
17
- scenario 'should have sort and per_page on page' do
18
- visit search_catalog_path(f: { Settings.FIELDS.PROVIDER => ['Stanford'] })
19
- expect(page).to have_css('#sort-dropdown')
20
- expect(page).to have_css('#per_page-dropdown')
18
+ scenario "should have sort and per_page on page" do
19
+ visit search_catalog_path(f: {Settings.FIELDS.PROVIDER => ["Stanford"]})
20
+ expect(page).to have_css("#sort-dropdown")
21
+ expect(page).to have_css("#per_page-dropdown")
21
22
  end
22
23
 
23
- scenario 'should have facets listed correctly' do
24
- within '#facet-panel-collapse' do
25
- expect(page).to have_css('div.card.facet-limit', text: 'Year')
26
- expect(page).to have_css('div.card.facet-limit', text: 'Place')
27
- expect(page).to have_css('div.card.facet-limit', text: 'Access')
28
- expect(page).to have_css('div.card.facet-limit', text: 'Resource Class')
29
- expect(page).to have_css('div.card.facet-limit', text: 'Resource Type')
30
- expect(page).to have_css('div.card.facet-limit', text: 'Format')
31
- expect(page).to have_css('div.card.facet-limit', text: 'Subject')
32
- expect(page).to have_css('div.card.facet-limit', text: 'Theme')
33
- expect(page).to have_css('div.card.facet-limit', text: 'Creator')
34
- expect(page).to have_css('div.card.facet-limit', text: 'Publisher')
35
- expect(page).to have_css('div.card.facet-limit', text: 'Provider')
36
- expect(page).to have_css('div.card.facet-limit', text: 'Georeferenced')
24
+ scenario "should have facets listed correctly" do
25
+ within "#facet-panel-collapse" do
26
+ expect(page).to have_css("div.card.facet-limit", text: "Year")
27
+ expect(page).to have_css("div.card.facet-limit", text: "Place")
28
+ expect(page).to have_css("div.card.facet-limit", text: "Access")
29
+ expect(page).to have_css("div.card.facet-limit", text: "Resource Class")
30
+ expect(page).to have_css("div.card.facet-limit", text: "Resource Type")
31
+ expect(page).to have_css("div.card.facet-limit", text: "Format")
32
+ expect(page).to have_css("div.card.facet-limit", text: "Subject")
33
+ expect(page).to have_css("div.card.facet-limit", text: "Theme")
34
+ expect(page).to have_css("div.card.facet-limit", text: "Creator")
35
+ expect(page).to have_css("div.card.facet-limit", text: "Publisher")
36
+ expect(page).to have_css("div.card.facet-limit", text: "Provider")
37
+ expect(page).to have_css("div.card.facet-limit", text: "Georeferenced")
37
38
  end
38
- click_button 'Provider'
39
+ click_button "Provider"
39
40
  using_wait_time 120 do
40
- expect(page).to have_css('a.facet-select', text: 'University of Minnesota', visible: true)
41
- expect(page).to have_css('a.facet-select', text: 'MIT', visible: true)
42
- expect(page).to have_css('a.facet-select', text: 'Stanford', visible: true)
43
- expect(page).to have_css('.more_facets a', text: /more\sProvider\s»/, visible: true)
41
+ expect(page).to have_css("a.facet-select", text: "University of Minnesota", visible: true)
42
+ expect(page).to have_css("a.facet-select", text: "MIT", visible: true)
43
+ expect(page).to have_css("a.facet-select", text: "Stanford", visible: true)
44
+ expect(page).to have_css(".more_facets a", text: /more\sProvider\s»/, visible: true)
44
45
  end
45
46
  end
46
47
 
47
- scenario 'hover on record should produce bounding box on map' do
48
+ scenario "hover on record should produce bounding box on map" do
48
49
  # Needed to find an svg element on the page
49
- visit search_catalog_path(f: { Settings.FIELDS.PROVIDER => ['Stanford'] })
50
+ visit search_catalog_path(f: {Settings.FIELDS.PROVIDER => ["Stanford"]})
50
51
  # BL7 has svg icons, so sniffing for SVG path won't return false
51
52
  # expect(Nokogiri::HTML.parse(page.body).css('path').length).to eq 0
52
- find('.documentHeader', match: :first).hover
53
- within('#map') do
54
- expect(page).to have_css('path')
53
+ find(".documentHeader", match: :first).hover
54
+ within("#map") do
55
+ expect(page).to have_css("path")
55
56
  end
56
57
  end
57
58
 
58
- scenario 'click on a record area to expand collapse' do
59
- within('article', match: :first) do
60
- expect(page).not_to have_css('.collapse')
61
- find('button').click
62
- expect(page).to have_css('.collapse', visible: true)
59
+ scenario "click on a record area to expand collapse" do
60
+ within("article", match: :first) do
61
+ expect(page).not_to have_css(".collapse")
62
+ find("button").click
63
+ expect(page).to have_css(".collapse", visible: true)
63
64
  end
64
65
  end
65
66
 
66
- scenario 'spatial search should reset to page one' do
67
- visit '/?per_page=5&q=%2A&page=2'
68
- find('#map').double_click
69
- expect(find('.page-entries')).to have_content(/^1 - \d of \d.*$/)
67
+ scenario "spatial search should reset to page one" do
68
+ visit "/?per_page=5&q=%2A&page=2"
69
+ find("#map").double_click
70
+ expect(find(".page-entries")).to have_content(/^1 - \d of \d.*$/)
70
71
  end
71
72
 
72
- scenario 'clicking map search should retain current search parameters' do
73
+ scenario "clicking map search should retain current search parameters" do
73
74
  visit "/?f[#{subject_field}][]=Population"
74
- find('#map').double_click
75
- within '#appliedParams' do
76
- expect(page).to have_content('Subject Population')
77
- expect(page).to have_css 'span.filter-name', text: 'Bounding Box'
75
+ find("#map").double_click
76
+ within "#appliedParams" do
77
+ expect(page).to have_content("Subject Population")
78
+ expect(page).to have_css "span.filter-name", text: "Bounding Box"
78
79
  end
79
80
  end
80
81
 
81
- scenario 'should have schema.org props listed' do
82
- visit search_catalog_path(f: { Settings.FIELDS.PROVIDER => ['Stanford'] })
83
- within('.documentHeader', match: :first) do
82
+ scenario "should have schema.org props listed" do
83
+ visit search_catalog_path(f: {Settings.FIELDS.PROVIDER => ["Stanford"]})
84
+ within(".documentHeader", match: :first) do
84
85
  expect(page).to have_css("a[itemprop='name']")
85
- find('.caret-toggle').click
86
+ find(".caret-toggle").click
86
87
  end
87
- within('.more-info-area', match: :first) do
88
+ within(".more-info-area", match: :first) do
88
89
  expect(page).to have_css("small[itemprop='description']")
89
90
  end
90
91
  end
@@ -1,15 +1,16 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'Suppressed records' do
5
- scenario 'are viewable' do
6
- visit solr_document_path 'princeton-jq085m62x'
7
- expect(page).to have_css('#document')
3
+ require "spec_helper"
4
+
5
+ feature "Suppressed records" do
6
+ scenario "are viewable" do
7
+ visit solr_document_path "princeton-jq085m62x"
8
+ expect(page).to have_css("#document")
8
9
  end
9
10
 
10
- scenario 'are exportable' do
11
- visit solr_document_path 'princeton-jq085m62x'
12
- click_link 'Web services'
13
- expect(page).to have_css 'h1.modal-title', text: 'Web services'
11
+ scenario "are exportable" do
12
+ visit solr_document_path "princeton-jq085m62x"
13
+ click_link "Web services"
14
+ expect(page).to have_css "h1.modal-title", text: "Web services"
14
15
  end
15
16
  end
@@ -1,22 +1,23 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'tilejson layer' do
3
+ require "spec_helper"
4
+
5
+ feature "tilejson layer" do
5
6
  before do
6
- WebMock.disable_net_connect!(allow_localhost: true, allow: 'chromedriver.storage.googleapis.com')
7
+ WebMock.disable_net_connect!(allow_localhost: true, allow: "chromedriver.storage.googleapis.com")
7
8
  end
8
9
 
9
10
  after do
10
11
  WebMock.allow_net_connect!
11
12
  end
12
13
 
13
- scenario 'displays tilejson layer', js: true do
14
+ scenario "displays tilejson layer", js: true do
14
15
  # Mock tilejson manifest url
15
- stub_request(:get, 'https://map-tiles-staging.princeton.edu/mosaicjson/tilejson.json?id=2a91d82c541c426cb787cc62afe8f248')
16
- .to_return(status: 200, body: read_fixture('manifests/tilejson.json'))
16
+ stub_request(:get, "https://map-tiles-staging.princeton.edu/mosaicjson/tilejson.json?id=2a91d82c541c426cb787cc62afe8f248")
17
+ .to_return(status: 200, body: read_fixture("manifests/tilejson.json"))
17
18
 
18
- visit solr_document_path('princeton-fk4544658v-tilejson')
19
- expect(page).to have_css '.leaflet-control-zoom', visible: :visible
19
+ visit solr_document_path("princeton-fk4544658v-tilejson")
20
+ expect(page).to have_css ".leaflet-control-zoom", visible: :visible
20
21
  expect(page).to have_css "img[src*='https://map-tiles-staging.princeton.edu/mosaicjson/tiles/WebMercatorQuad']"
21
22
  end
22
23
  end
@@ -1,10 +1,11 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'tms layer' do
5
- scenario 'displays tms layer', js: true do
6
- visit solr_document_path('cugir-007957')
7
- expect(page).to have_css '.leaflet-control-zoom', visible: true
3
+ require "spec_helper"
4
+
5
+ feature "tms layer" do
6
+ scenario "displays tms layer", js: true do
7
+ visit solr_document_path("cugir-007957")
8
+ expect(page).to have_css ".leaflet-control-zoom", visible: true
8
9
  expect(page).to have_css "img[src*='cugir.library.cornell.edu']"
9
10
  end
10
11
  end
@@ -1,57 +1,58 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'web services tools' do
5
- feature 'when wms/wfs are provided', js: true do
6
- scenario 'shows up in tools' do
7
- visit solr_document_path 'stanford-cg357zz0321'
8
- expect(page).to have_css 'div.web-services-sidebar a', text: 'Web services'
9
- click_link 'Web services'
10
- within '.modal-body' do
11
- expect(page).to have_css 'input', count: 4
12
- expect(page).to have_css 'label', text: 'Web Feature Service (WFS)'
3
+ require "spec_helper"
4
+
5
+ feature "web services tools" do
6
+ feature "when wms/wfs are provided", js: true do
7
+ scenario "shows up in tools" do
8
+ visit solr_document_path "stanford-cg357zz0321"
9
+ expect(page).to have_css "div.web-services-sidebar a", text: "Web services"
10
+ click_link "Web services"
11
+ within ".modal-body" do
12
+ expect(page).to have_css "input", count: 4
13
+ expect(page).to have_css "label", text: "Web Feature Service (WFS)"
13
14
  expect(page).to have_css 'input[value="https://geowebservices-restricted.stanford.edu/geoserver/wfs"]'
14
15
  expect(page).to have_css 'input[value="druid:cg357zz0321"]', count: 2
15
- expect(page).to have_css 'label', text: 'Web Mapping Service (WMS)'
16
+ expect(page).to have_css "label", text: "Web Mapping Service (WMS)"
16
17
  expect(page).to have_css 'input[value="https://geowebservices-restricted.stanford.edu/geoserver/wms"]'
17
18
  end
18
19
  end
19
20
  end
20
- feature 'no wms or wfs provided' do
21
- scenario 'does not show up in tools' do
22
- visit solr_document_path 'mit-001145244'
23
- expect(page).not_to have_css 'div.web-services-sidebar a', text: 'Web services'
21
+ feature "no wms or wfs provided" do
22
+ scenario "does not show up in tools" do
23
+ visit solr_document_path "mit-001145244"
24
+ expect(page).not_to have_css "div.web-services-sidebar a", text: "Web services"
24
25
  end
25
26
  end
26
- feature 'when xyz tile reference is provided', js: true do
27
- scenario 'shows up in tools' do
28
- visit solr_document_path '6f47b103-9955-4bbe-a364-387039623106-xyz'
29
- expect(page).to have_css 'div.web-services-sidebar a', text: 'Web services'
30
- click_link 'Web services'
31
- within '.modal-body' do
32
- expect(page).to have_css 'label', text: 'XYZ Tiles'
27
+ feature "when xyz tile reference is provided", js: true do
28
+ scenario "shows up in tools" do
29
+ visit solr_document_path "6f47b103-9955-4bbe-a364-387039623106-xyz"
30
+ expect(page).to have_css "div.web-services-sidebar a", text: "Web services"
31
+ click_link "Web services"
32
+ within ".modal-body" do
33
+ expect(page).to have_css "label", text: "XYZ Tiles"
33
34
  expect(page).to have_css 'input[value="https://earthquake.usgs.gov/basemap/tiles/faults/{z}/{x}/{y}.png"]'
34
35
  end
35
36
  end
36
37
  end
37
- feature 'when wmts tile reference is provided', js: true do
38
- scenario 'shows up in tools' do
39
- visit solr_document_path 'princeton-fk4544658v-wmts'
40
- expect(page).to have_css 'div.web-services-sidebar a', text: 'Web services'
41
- click_link 'Web services'
42
- within '.modal-body' do
43
- expect(page).to have_css 'label', text: 'Web Map Tile Service'
38
+ feature "when wmts tile reference is provided", js: true do
39
+ scenario "shows up in tools" do
40
+ visit solr_document_path "princeton-fk4544658v-wmts"
41
+ expect(page).to have_css "div.web-services-sidebar a", text: "Web services"
42
+ click_link "Web services"
43
+ within ".modal-body" do
44
+ expect(page).to have_css "label", text: "Web Map Tile Service"
44
45
  expect(page).to have_css 'input[value="https://map-tiles-staging.princeton.edu/mosaicjson/WMTSCapabilities.xml?id=2a91d82c541c426cb787cc62afe8f248"]'
45
46
  end
46
47
  end
47
48
  end
48
- feature 'when tilejson reference is provided', js: true do
49
- scenario 'shows up in tools' do
50
- visit solr_document_path 'princeton-fk4544658v-tilejson'
51
- expect(page).to have_css 'div.web-services-sidebar a', text: 'Web services'
52
- click_link 'Web services'
53
- within '.modal-body' do
54
- expect(page).to have_css 'label', text: 'TileJSON Document'
49
+ feature "when tilejson reference is provided", js: true do
50
+ scenario "shows up in tools" do
51
+ visit solr_document_path "princeton-fk4544658v-tilejson"
52
+ expect(page).to have_css "div.web-services-sidebar a", text: "Web services"
53
+ click_link "Web services"
54
+ within ".modal-body" do
55
+ expect(page).to have_css "label", text: "TileJSON Document"
55
56
  expect(page).to have_css 'input[value="https://map-tiles-staging.princeton.edu/mosaicjson/tilejson.json?id=2a91d82c541c426cb787cc62afe8f248"]'
56
57
  end
57
58
  end
@@ -1,33 +1,34 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'wmts layer' do
3
+ require "spec_helper"
4
+
5
+ feature "wmts layer" do
5
6
  before do
6
- WebMock.disable_net_connect!(allow_localhost: true, allow: 'chromedriver.storage.googleapis.com')
7
+ WebMock.disable_net_connect!(allow_localhost: true, allow: "chromedriver.storage.googleapis.com")
7
8
  end
8
9
 
9
10
  after do
10
11
  WebMock.allow_net_connect!
11
12
  end
12
13
 
13
- context 'when referencing a WMTSCapabilities document with a single layer' do
14
- scenario 'displays the layer', js: true do
14
+ context "when referencing a WMTSCapabilities document with a single layer" do
15
+ scenario "displays the layer", js: true do
15
16
  # Mock wmts manifest url
16
- stub_request(:get, 'https://map-tiles-staging.princeton.edu/mosaicjson/WMTSCapabilities.xml?id=2a91d82c541c426cb787cc62afe8f248')
17
- .to_return(status: 200, body: read_fixture('manifests/wmts-single.xml'))
17
+ stub_request(:get, "https://map-tiles-staging.princeton.edu/mosaicjson/WMTSCapabilities.xml?id=2a91d82c541c426cb787cc62afe8f248")
18
+ .to_return(status: 200, body: read_fixture("manifests/wmts-single.xml"))
18
19
 
19
- visit solr_document_path('princeton-fk4544658v-wmts')
20
- expect(page).to have_css '.leaflet-control-zoom', visible: :visible
20
+ visit solr_document_path("princeton-fk4544658v-wmts")
21
+ expect(page).to have_css ".leaflet-control-zoom", visible: :visible
21
22
  expect(page).to have_css "img[src*='map-tiles-staging.princeton.edu/mosaicjson/tiles/WebMercatorQuad']"
22
23
  end
23
24
  end
24
- context 'when referencing a WMTSCapabilities document with a multiple layers' do
25
- scenario 'displays the layer referenced in the layer_id field', js: true do
25
+ context "when referencing a WMTSCapabilities document with a multiple layers" do
26
+ scenario "displays the layer referenced in the layer_id field", js: true do
26
27
  # Mock wmts manifest url
27
- stub_request(:get, 'https://maps.wien.gv.at/wmts/1.0.0/WMTSCapabilities.xml')
28
- .to_return(status: 200, body: read_fixture('manifests/wmts-multiple.xml'))
29
- visit solr_document_path('princeton-fk4db9hn29')
30
- expect(page).to have_css '.leaflet-control-zoom', visible: :visible
28
+ stub_request(:get, "https://maps.wien.gv.at/wmts/1.0.0/WMTSCapabilities.xml")
29
+ .to_return(status: 200, body: read_fixture("manifests/wmts-multiple.xml"))
30
+ visit solr_document_path("princeton-fk4db9hn29")
31
+ expect(page).to have_css ".leaflet-control-zoom", visible: :visible
31
32
  expect(page).to have_css "img[src*='http://maps1.wien.gv.at/wmts/lb2016/farbe/google3857']"
32
33
  end
33
34
  end
@@ -1,10 +1,11 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'xyz layer' do
5
- scenario 'displays tms layer', js: true do
6
- visit solr_document_path('6f47b103-9955-4bbe-a364-387039623106-xyz')
7
- expect(page).to have_css '.leaflet-control-zoom', visible: :visible
3
+ require "spec_helper"
4
+
5
+ feature "xyz layer" do
6
+ scenario "displays tms layer", js: true do
7
+ visit solr_document_path("6f47b103-9955-4bbe-a364-387039623106-xyz")
8
+ expect(page).to have_css ".leaflet-control-zoom", visible: :visible
8
9
  expect(page).to have_css "img[src*='earthquake.usgs.gov']"
9
10
  end
10
11
  end
@@ -26,7 +26,7 @@
26
26
  ],
27
27
  "dct_issued_s": "1905-06-22",
28
28
  "gbl_indexYear_im": [
29
- "1996"
29
+ 1996
30
30
  ],
31
31
  "gbl_dateRange_drsim": [
32
32
  "[1996 TO 1996]"
@@ -33,7 +33,7 @@
33
33
  ],
34
34
  "dct_issued_s": "1905-07-06",
35
35
  "gbl_indexYear_im": [
36
- "1905"
36
+ 1905
37
37
  ],
38
38
  "gbl_dateRange_drsim": [
39
39
  "[1905 TO 2014]"
@@ -28,7 +28,7 @@
28
28
  ],
29
29
  "dct_issued_s": "1905-06-27",
30
30
  "gbl_indexYear_im": [
31
- "2004"
31
+ 2004
32
32
  ],
33
33
  "gbl_dateRange_drsim": [
34
34
  "[2004 TO 2004]"
@@ -40,7 +40,7 @@
40
40
  ],
41
41
  "dct_issued_s": "1905-06-27",
42
42
  "gbl_indexYear_im": [
43
- "2005"
43
+ 2005
44
44
  ],
45
45
  "gbl_dateRange_drsim": [
46
46
  "[2005 TO 2005]"
@@ -38,7 +38,7 @@
38
38
  ],
39
39
  "dct_issued_s": "2016-01-15",
40
40
  "gbl_indexYear_im": [
41
- "2010"
41
+ 2010
42
42
  ],
43
43
  "gbl_dateRange_drsim": [
44
44
  "[2010 TO 2016]"