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,12 +1,13 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'Attribute table values', js: true do
5
- xscenario 'are linkified' do
3
+ require "spec_helper"
4
+
5
+ feature "Attribute table values", js: true do
6
+ xscenario "are linkified" do
6
7
  # ArcGIS server returning an error. Wait until SVG elements are added
7
- visit solr_document_path 'f406332e63eb4478a9560ad86ae90327_18'
8
- expect(page).to have_css '.leaflet-overlay-pane svg'
9
- page.first('svg g path').click
10
- expect(page).to have_css 'td a[href="http://www.minneapolismn.gov/fire/stations/fire_station28"]', text: 'http://www.minneapolismn.gov/fire/stations/fire_station28'
8
+ visit solr_document_path "f406332e63eb4478a9560ad86ae90327_18"
9
+ expect(page).to have_css ".leaflet-overlay-pane svg"
10
+ page.first("svg g path").click
11
+ expect(page).to have_css 'td a[href="http://www.minneapolismn.gov/fire/stations/fire_station28"]', text: "http://www.minneapolismn.gov/fire/stations/fire_station28"
11
12
  end
12
13
  end
@@ -1,11 +1,12 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'Metadata tools' do
5
- feature 'when metadata references are available', js: :true do
6
- let(:iso19139) { File.read(Rails.root.join('..', 'spec', 'fixtures', 'iso19139', 'stanford-cg357zz0321.xml')) }
7
- let(:fgdc) { File.read(Rails.root.join('..', 'spec', 'fixtures', 'fgdc', 'harvard-g7064-s2-1834-k3.xml')) }
8
- let(:mods) { File.read(Rails.root.join('..', 'spec', 'fixtures', 'mods', 'stanford-cg357zz0321.mods')) }
3
+ require "spec_helper"
4
+
5
+ feature "Metadata tools" do
6
+ feature "when metadata references are available", js: true do
7
+ let(:iso19139) { File.read(Rails.root.join("..", "spec", "fixtures", "iso19139", "stanford-cg357zz0321.xml")) }
8
+ let(:fgdc) { File.read(Rails.root.join("..", "spec", "fixtures", "fgdc", "harvard-g7064-s2-1834-k3.xml")) }
9
+ let(:mods) { File.read(Rails.root.join("..", "spec", "fixtures", "mods", "stanford-cg357zz0321.mods")) }
9
10
  let(:fgdc_response) { instance_double(Faraday::Response) }
10
11
  let(:fgdc_connection) { instance_double(Faraday::Connection) }
11
12
  let(:iso19139_response) { instance_double(Faraday::Response) }
@@ -17,35 +18,35 @@ feature 'Metadata tools' do
17
18
  allow(iso19139_response).to receive(:body).and_return(iso19139)
18
19
  allow(iso19139_response).to receive(:status).and_return(200)
19
20
  allow(iso19139_connection).to receive(:get).and_return(iso19139_response)
20
- allow(Faraday).to receive(:new).with(url: 'https://raw.githubusercontent.com/OpenGeoMetadata/edu.stanford.purl/master/cg/357/zz/0321/iso19139.xml').and_return(iso19139_connection)
21
+ allow(Faraday).to receive(:new).with(url: "https://raw.githubusercontent.com/OpenGeoMetadata/edu.stanford.purl/master/cg/357/zz/0321/iso19139.xml").and_return(iso19139_connection)
21
22
 
22
23
  allow(fgdc_response).to receive(:body).and_return(fgdc)
23
24
  allow(fgdc_response).to receive(:status).and_return(200)
24
25
  allow(fgdc_connection).to receive(:get).and_return(fgdc_response)
25
- allow(Faraday).to receive(:new).with(url: 'https://raw.githubusercontent.com/OpenGeoMetadata/edu.harvard/master/217/121/227/77/fgdc.xml').and_return(fgdc_connection)
26
+ allow(Faraday).to receive(:new).with(url: "https://raw.githubusercontent.com/OpenGeoMetadata/edu.harvard/master/217/121/227/77/fgdc.xml").and_return(fgdc_connection)
26
27
 
27
28
  allow(response).to receive(:body).and_return(mods)
28
29
  allow(response).to receive(:status).and_return(200)
29
30
  allow(connection).to receive(:get).and_return(response)
30
- allow(Faraday).to receive(:new).with(url: 'http://purl.stanford.edu/cg357zz0321.mods').and_return(connection)
31
+ allow(Faraday).to receive(:new).with(url: "http://purl.stanford.edu/cg357zz0321.mods").and_return(connection)
31
32
 
32
33
  allow(Faraday).to receive(:new).with(hash_including(url: %r{solr/blacklight-core})).and_call_original
33
34
  end
34
35
 
35
- scenario 'shows up as HTML' do
36
- visit solr_document_path 'harvard-g7064-s2-1834-k3'
37
- expect(page).to have_css 'li.metadata a', text: 'Metadata'
38
- click_link 'Metadata'
36
+ scenario "shows up as HTML" do
37
+ visit solr_document_path "harvard-g7064-s2-1834-k3"
38
+ expect(page).to have_css "li.metadata a", text: "Metadata"
39
+ click_link "Metadata"
39
40
  using_wait_time 15 do
40
- within '.metadata-view' do
41
- expect(page).to have_css '.pill-metadata', text: 'FGDC'
42
- expect(page).to have_css 'dt', text: 'Identification Information'
43
- expect(page).to have_css 'dt', text: 'Metadata Reference Information'
41
+ within ".metadata-view" do
42
+ expect(page).to have_css ".pill-metadata", text: "FGDC"
43
+ expect(page).to have_css "dt", text: "Identification Information"
44
+ expect(page).to have_css "dt", text: "Metadata Reference Information"
44
45
  end
45
46
  end
46
47
  end
47
- context 'when the metadata is in the XML' do
48
- let(:mods) { File.read(Rails.root.join('..', 'spec', 'fixtures', 'mods', 'fb897vt9938.mods')) }
48
+ context "when the metadata is in the XML" do
49
+ let(:mods) { File.read(Rails.root.join("..", "spec", "fixtures", "mods", "fb897vt9938.mods")) }
49
50
  let(:response) { instance_double(Faraday::Response) }
50
51
  let(:connection) { instance_double(Faraday::Connection) }
51
52
 
@@ -53,27 +54,27 @@ feature 'Metadata tools' do
53
54
  allow(response).to receive(:body).and_return(mods)
54
55
  allow(response).to receive(:status).and_return(200)
55
56
  allow(connection).to receive(:get).and_return(response)
56
- allow(Faraday).to receive(:new).with(url: 'http://purl.stanford.edu/fb897vt9938.mods').and_return(connection)
57
+ allow(Faraday).to receive(:new).with(url: "http://purl.stanford.edu/fb897vt9938.mods").and_return(connection)
57
58
  allow(Faraday).to receive(:new).and_call_original
58
59
  end
59
60
 
60
- scenario 'shows up as XML' do
61
- visit solr_document_path 'stanford-cg357zz0321'
62
- expect(page).to have_css 'li.metadata a', text: 'Metadata'
63
- click_link 'Metadata'
61
+ scenario "shows up as XML" do
62
+ visit solr_document_path "stanford-cg357zz0321"
63
+ expect(page).to have_css "li.metadata a", text: "Metadata"
64
+ click_link "Metadata"
64
65
  using_wait_time 15 do
65
- within '.metadata-view' do
66
- expect(page).to have_css '.pill-metadata', text: 'MODS'
67
- expect(page).to have_css '.CodeRay'
66
+ within ".metadata-view" do
67
+ expect(page).to have_css ".pill-metadata", text: "MODS"
68
+ expect(page).to have_css ".CodeRay"
68
69
  end
69
70
  end
70
71
  end
71
72
  end
72
73
  end
73
- feature 'when metadata references are not available' do
74
- scenario 'is not in tools' do
75
- visit solr_document_path 'mit-f6rqs4ucovjk2'
76
- expect(page).not_to have_css 'li.metadata a', text: 'Metadata'
74
+ feature "when metadata references are not available" do
75
+ scenario "is not in tools" do
76
+ visit solr_document_path "mit-f6rqs4ucovjk2"
77
+ expect(page).not_to have_css "li.metadata a", text: "Metadata"
77
78
  end
78
79
  end
79
80
  end
@@ -1,25 +1,26 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'Missing metadata', js: true do
5
- scenario 'Yields error free results page for no spatial' do
6
- visit search_catalog_path(q: 'ASTER Global Emissivity')
7
- expect(page).to have_css('#map')
3
+ require "spec_helper"
4
+
5
+ feature "Missing metadata", js: true do
6
+ scenario "Yields error free results page for no spatial" do
7
+ visit search_catalog_path(q: "ASTER Global Emissivity")
8
+ expect(page).to have_css("#map")
8
9
  end
9
- scenario 'Yields error free show page for no wxs_identifier or spatial' do
10
- visit solr_document_path('aster-global-emissivity-dataset-1-kilometer-v003-ag1kmcad20')
11
- expect(page).to have_css('#map')
10
+ scenario "Yields error free show page for no wxs_identifier or spatial" do
11
+ visit solr_document_path("aster-global-emissivity-dataset-1-kilometer-v003-ag1kmcad20")
12
+ expect(page).to have_css("#map")
12
13
  end
13
- scenario 'Yields error free show page for no layer_geom_type_s' do
14
- visit solr_document_path('05d-03-noGeomType')
15
- expect(page).to have_css('#map')
14
+ scenario "Yields error free show page for no layer_geom_type_s" do
15
+ visit solr_document_path("05d-03-noGeomType")
16
+ expect(page).to have_css("#map")
16
17
  end
17
- scenario 'Yields error free show page for no dct_provider_s' do
18
- visit solr_document_path('99-0001-noprovider')
19
- expect(page).to have_css('#map')
18
+ scenario "Yields error free show page for no dct_provider_s" do
19
+ visit solr_document_path("99-0001-noprovider")
20
+ expect(page).to have_css("#map")
20
21
  end
21
- scenario 'Yields error free show page for no locn_geometry' do
22
- visit solr_document_path('05d-p16022coll246-noGeo')
23
- expect(page).to have_css('#map')
22
+ scenario "Yields error free show page for no locn_geometry" do
23
+ visit solr_document_path("05d-p16022coll246-noGeo")
24
+ expect(page).to have_css("#map")
24
25
  end
25
26
  end
@@ -1,15 +1,16 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'Multiple downloads' do
5
- feature 'when item has multiple downloads in dct_references_s' do
6
- scenario 'downloads are listed in download card' do
7
- visit solr_document_path 'cugir-007950'
8
- find('#downloads-button').click
9
- within '#downloads-collapse' do
10
- expect(page).to have_link 'Shapefile', href: 'https://cugir-data.s3.amazonaws.com/00/79/50/cugir-007950.zip'
11
- expect(page).to have_link 'PDF', href: 'https://cugir-data.s3.amazonaws.com/00/79/50/agBROO.pdf'
12
- expect(page).to have_link 'KMZ', href: 'https://cugir-data.s3.amazonaws.com/00/79/50/agBROO2011.kmz'
3
+ require "spec_helper"
4
+
5
+ feature "Multiple downloads" do
6
+ feature "when item has multiple downloads in dct_references_s" do
7
+ scenario "downloads are listed in download card" do
8
+ visit solr_document_path "cugir-007950"
9
+ find("#downloads-button").click
10
+ within "#downloads-collapse" do
11
+ expect(page).to have_link "Shapefile", href: "https://cugir-data.s3.amazonaws.com/00/79/50/cugir-007950.zip"
12
+ expect(page).to have_link "PDF", href: "https://cugir-data.s3.amazonaws.com/00/79/50/agBROO.pdf"
13
+ expect(page).to have_link "KMZ", href: "https://cugir-data.s3.amazonaws.com/00/79/50/agBROO2011.kmz"
13
14
  end
14
15
  end
15
16
  end
@@ -1,10 +1,11 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'Oembed layer' do
5
- scenario 'Should show oembed content and map' do
6
- visit solr_document_path('stanford-dc482zx1528')
7
- expect(page).to have_css '#map'
3
+ require "spec_helper"
4
+
5
+ feature "Oembed layer" do
6
+ scenario "Should show oembed content and map" do
7
+ visit solr_document_path("stanford-dc482zx1528")
8
+ expect(page).to have_css "#map"
8
9
  expect(page).to have_css '[data-protocol="Oembed"]'
9
10
  end
10
11
  end
@@ -1,44 +1,69 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'Display related documents' do
5
- scenario 'Record with dct_source_sm value(s) should have parent(s)' do
6
- visit relations_solr_document_path('nyu_2451_34502')
7
- expect(page).to have_css('.relations .card-header h2', text: 'Source Datasets')
3
+ require "spec_helper"
4
+
5
+ feature "Display related documents" do
6
+ scenario "Record with dct_source_sm value(s) should have parent(s)" do
7
+ visit relations_solr_document_path("nyu_2451_34502")
8
+ expect(page).to have_css(".relations .card-header h2", text: "Source records...")
8
9
  end
9
10
 
10
- scenario 'Record that is pointed to by others should have children' do
11
- visit relations_solr_document_path('nyu_2451_34635')
12
- expect(page).to have_css('.relations .card-header h2', text: 'Derived Datasets')
11
+ scenario "Record that is pointed to by others should have children" do
12
+ visit relations_solr_document_path("nyu_2451_34635")
13
+ expect(page).to have_css(".relations .card-header h2", text: "Derived records...")
13
14
  end
14
15
 
15
- scenario 'Relations should respond to json' do
16
- visit relations_solr_document_path('nyu_2451_34635', format: 'json')
16
+ scenario "Relations should respond to json" do
17
+ visit relations_solr_document_path("nyu_2451_34635", format: "json")
17
18
  response = JSON.parse(page.body)
18
- expect(response['relations']).not_to respond_to('source_ancestors')
19
- expect(response['relations']['source_descendants']['docs'].first[Settings.FIELDS.ID]).to eq 'nyu_2451_34502'
20
- expect(response['current_doc']).to eq 'nyu_2451_34635'
19
+ expect(response["relations"]).not_to respond_to("source_ancestors")
20
+ expect(response["relations"]["source_descendants"]["docs"].first[Settings.FIELDS.ID]).to eq "nyu_2451_34502"
21
+ expect(response["current_doc"]).to eq "nyu_2451_34635"
21
22
  end
22
23
 
23
- scenario 'Record with relations should render widget in catalog#show', js: true do
24
- visit solr_document_path('nyu_2451_34635')
25
- expect(page).to have_css('.card.relations')
26
- expect(page).to have_css('div.card-header', text: 'Derived Datasets')
24
+ scenario "Record with relations should render widget in catalog#show", js: true do
25
+ visit solr_document_path("nyu_2451_34635")
26
+ expect(page).to have_css(".card.relations")
27
+ expect(page).to have_css("div.card-header", text: "Derived records...")
27
28
  end
28
29
 
29
- scenario 'Record without relations should not render widget in catalog#show', js: true do
30
- visit solr_document_path('harvard-g7064-s2-1834-k3')
31
- expect(page).to have_no_css('.card.relations')
30
+ scenario "Record without relations should not render widget in catalog#show", js: true do
31
+ visit solr_document_path("harvard-g7064-s2-1834-k3")
32
+ expect(page).to have_no_css(".card.relations")
32
33
  end
33
34
 
34
- scenario 'Relationship browse link returns relationship-scoped results', js: true do
35
+ scenario "Relationship browse link returns relationship-scoped results", js: true do
35
36
  # Wabash Topo parent record
36
- visit solr_document_path('88cc9b19-3294-4da9-9edd-775c81fb1c59')
37
+ visit solr_document_path("88cc9b19-3294-4da9-9edd-775c81fb1c59")
38
+
39
+ expect(page).to have_content("Has part...")
40
+ expect(page).to have_link("Browse all 4 records...")
41
+ click_link("Browse all 4 records...")
37
42
 
38
- expect(page).to have_content('Has part...')
39
- expect(page).to have_link('Browse all 4 records...')
40
- click_link('Browse all 4 records...')
43
+ expect(page).not_to have_content("No results found for your search")
44
+ end
45
+
46
+ scenario "Record with dct_isPartOf_sm value(s) should link to relations", js: true do
47
+ # All Relationships
48
+ visit solr_document_path("all-relationships")
49
+ expect(page).to have_content("Is part of...")
50
+ end
51
+
52
+ scenario "Record pointed at by a parent with dct_isPartOf_sm value(s) should link back", js: true do
53
+ # The Related Record
54
+ visit solr_document_path("the-related-record")
55
+ expect(page).to have_content("Has part...")
56
+ end
57
+
58
+ scenario "Record with pcdm_memberOf_sm value(s) should link to relations", js: true do
59
+ # All Relationships
60
+ visit solr_document_path("all-relationships")
61
+ expect(page).to have_content("Belongs to collection...")
62
+ end
41
63
 
42
- expect(page).not_to have_content('No results found for your search')
64
+ scenario "Record pointed at by a parent with pcdm_memberOf_sm value(s) should link back", js: true do
65
+ # The Related Record
66
+ visit solr_document_path("the-related-record")
67
+ expect(page).to have_content("Collection records...")
43
68
  end
44
69
  end
@@ -1,14 +1,15 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'saved searches' do
5
- scenario 'list spatial search', js: true do
3
+ require "spec_helper"
4
+
5
+ feature "saved searches" do
6
+ scenario "list spatial search", js: true do
6
7
  visit root_path
7
- within '#map' do
8
- find('.search-control a').click
8
+ within "#map" do
9
+ find(".search-control a").click
9
10
  expect(page.current_url).to match(/bbox=/)
10
11
  end
11
12
  visit blacklight.search_history_path
12
- expect(page).to have_css 'td.query a', text: /#{I18n.t('geoblacklight.bbox_label')}/
13
+ expect(page).to have_css "td.query a", text: /#{I18n.t('geoblacklight.bbox_label')}/
13
14
  end
14
15
  end
@@ -1,13 +1,14 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'search bar' do
5
- scenario 'present on a spatial search' do
6
- visit search_catalog_path(bbox: '25 3 75 35')
7
- expect(page).to have_css '.navbar-search'
3
+ require "spec_helper"
4
+
5
+ feature "search bar" do
6
+ scenario "present on a spatial search" do
7
+ visit search_catalog_path(bbox: "25 3 75 35")
8
+ expect(page).to have_css ".navbar-search"
8
9
  end
9
- scenario 'present on a text search' do
10
- visit search_catalog_path(q: 'test')
11
- expect(page).to have_css '.navbar-search'
10
+ scenario "present on a text search" do
11
+ visit search_catalog_path(q: "test")
12
+ expect(page).to have_css ".navbar-search"
12
13
  end
13
14
  end
@@ -1,24 +1,25 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'spatial search results with an WKT bounding box that crosses the anti-meridian' do
5
- scenario 'when searching within the covered area' do
3
+ require "spec_helper"
4
+
5
+ feature "spatial search results with an WKT bounding box that crosses the anti-meridian" do
6
+ scenario "when searching within the covered area" do
6
7
  # BBox param is in China
7
8
  visit search_catalog_path(
8
- q: 'A new & accurate map of Asia',
9
- bbox: '98.4375 31.765537 117.202148 45.429299'
9
+ q: "A new & accurate map of Asia",
10
+ bbox: "98.4375 31.765537 117.202148 45.429299"
10
11
  )
11
- result_id = page.all('div.documentHeader.row').first['data-layer-id']
12
- expect(result_id).to eq '57f0f116-b64e-4773-8684-96ba09afb549'
12
+ result_id = page.all("div.documentHeader.row").first["data-layer-id"]
13
+ expect(result_id).to eq "57f0f116-b64e-4773-8684-96ba09afb549"
13
14
  end
14
15
 
15
- scenario 'when searching outside the covered area' do
16
+ scenario "when searching outside the covered area" do
16
17
  # BBox param is in Oklahoma
17
18
  visit search_catalog_path(
18
- q: 'A new & accurate map of Asia',
19
- bbox: '-98.717651 34.40691 -96.37207 36.199958'
19
+ q: "A new & accurate map of Asia",
20
+ bbox: "-98.717651 34.40691 -96.37207 36.199958"
20
21
  )
21
- results = page.all('div.documentHeader.row')
22
+ results = page.all("div.documentHeader.row")
22
23
  expect(results.count).to eq 0
23
24
  end
24
25
  end
@@ -1,16 +1,17 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'search results display document iconography' do
5
- scenario 'when viewing result row' do
3
+ require "spec_helper"
4
+
5
+ feature "search results display document iconography" do
6
+ scenario "when viewing result row" do
6
7
  # Search returns fixture stanford-cg357zz0321
7
8
  visit search_catalog_path(
8
- search_field: 'all_fields',
9
- q: 'stanford-cg357zz0321'
9
+ search_field: "all_fields",
10
+ q: "stanford-cg357zz0321"
10
11
  )
11
- first_result = page.all('span.status-icons > span')
12
- expect(first_result[0][:class]).to include 'blacklight-icon-dataset'
13
- expect(first_result[1][:class]).to include 'blacklight-icon-stanford'
14
- expect(first_result[2][:class]).to include 'blacklight-icon-restricted'
12
+ first_result = page.all("span.status-icons > span")
13
+ expect(first_result[0][:class]).to include "blacklight-icon-dataset"
14
+ expect(first_result[1][:class]).to include "blacklight-icon-stanford"
15
+ expect(first_result[2][:class]).to include "blacklight-icon-restricted"
15
16
  end
16
17
  end
@@ -1,48 +1,49 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'search results map', js: true do
5
- scenario 'present on a search result page' do
6
- visit search_catalog_path(q: 'Minnesota')
7
- expect(page).to have_css '#map'
3
+ require "spec_helper"
4
+
5
+ feature "search results map", js: true do
6
+ scenario "present on a search result page" do
7
+ visit search_catalog_path(q: "Minnesota")
8
+ expect(page).to have_css "#map"
8
9
  end
9
- xscenario 'view is scoped to Minnesota' do
10
+ xscenario "view is scoped to Minnesota" do
10
11
  # pending 'Minnesota fixtures have changed.'
11
12
  visit root_path
12
- click_link 'Minnesota, United States'
13
- expect(page).to have_css '#map'
14
- bbox = page.find('#map')['data-js-map-render-bbox']
13
+ click_link "Minnesota, United States"
14
+ expect(page).to have_css "#map"
15
+ bbox = page.find("#map")["data-js-map-render-bbox"]
15
16
 
16
17
  # Example bbox for Place > Minnesota, United States:
17
18
  # "-101.90917968749999,38.75408327579141,-83.27636718749999,53.27835301753182"
18
- left, bottom, right, top = bbox.split(',')
19
+ left, bottom, right, top = bbox.split(",")
19
20
  expect(left.to_f).to be_within(2).of(-101)
20
21
  expect(bottom.to_f).to be_within(3).of(38)
21
22
  expect(right.to_f).to be_within(2).of(-83)
22
23
  expect(top.to_f).to be_within(2).of(53)
23
24
  end
24
- scenario 'view is scoped to Twin Cities metro area' do
25
- visit search_catalog_path(q: 'Minneapolis')
26
- expect(page).to have_css '#map'
27
- bbox = page.find('#map')['data-js-map-render-bbox']
25
+ scenario "view is scoped to Twin Cities metro area" do
26
+ visit search_catalog_path(q: "Minneapolis")
27
+ expect(page).to have_css "#map"
28
+ bbox = page.find("#map")["data-js-map-render-bbox"]
28
29
 
29
30
  # Example bbox for q: Minneapolis
30
31
  # "-94.537353515625,44.004669106432225,-92.208251953125,45.87088761346192"
31
- left, bottom, right, top = bbox.split(',')
32
+ left, bottom, right, top = bbox.split(",")
32
33
  expect(left.to_f).to be_within(1).of(-94)
33
34
  expect(bottom.to_f).to be_within(1).of(44)
34
35
  expect(right.to_f).to be_within(1).of(-92)
35
36
  expect(top.to_f).to be_within(1).of(45)
36
37
  end
37
- scenario 'view is scoped to NYC' do
38
+ scenario "view is scoped to NYC" do
38
39
  visit root_path
39
- click_link 'New York, New York'
40
- expect(page).to have_css '#map'
41
- bbox = page.find('#map')['data-js-map-render-bbox']
40
+ click_link "New York, New York"
41
+ expect(page).to have_css "#map"
42
+ bbox = page.find("#map")["data-js-map-render-bbox"]
42
43
 
43
44
  # Example bbox for Place > New York, New York, United States
44
45
  # "-74.26895141601562,40.455307212131494,-73.68667602539061,40.95501133048621"
45
- left, bottom, right, top = bbox.split(',')
46
+ left, bottom, right, top = bbox.split(",")
46
47
  expect(left.to_f).to be_within(2).of(-74)
47
48
  expect(bottom.to_f).to be_within(2).of(40)
48
49
  expect(right.to_f).to be_within(2).of(-73)
@@ -1,56 +1,57 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'spatial search results overlap ratio' do
5
- scenario 'result bboxes fully contained, overlap ratio applied to relevancy' do
3
+ require "spec_helper"
4
+
5
+ feature "spatial search results overlap ratio" do
6
+ scenario "result bboxes fully contained, overlap ratio applied to relevancy" do
6
7
  allow(Settings).to receive(:OVERLAP_RATIO_BOOST).and_return 200
7
8
 
8
9
  # BBox param is the US upper midwest and Canada, roughly centered on the state of Minnesota
9
10
  visit search_catalog_path(
10
- bbox: '-103.196521 39.21962 -84.431873 53.63497',
11
- "f[#{Settings.FIELDS.PROVIDER}][]": 'University of Minnesota'
11
+ bbox: "-103.196521 39.21962 -84.431873 53.63497",
12
+ "f[#{Settings.FIELDS.PROVIDER}][]": "University of Minnesota"
12
13
  )
13
14
 
14
15
  # MN State result
15
16
  # Slightly bigger bbox / result bbox fits bbox param best
16
- expect(position_in_result_page(page, 'e9c71086-6b25-4950-8e1c-84c2794e3382')).to eq 1
17
+ expect(position_in_result_page(page, "e9c71086-6b25-4950-8e1c-84c2794e3382")).to eq 1
17
18
 
18
19
  # MN State result
19
20
  # Slightly smaller bbox / result bbox fits bbox param second best
20
- expect(position_in_result_page(page, '2eddde2f-c222-41ca-bd07-2fd74a21f4de')).to eq 2
21
+ expect(position_in_result_page(page, "2eddde2f-c222-41ca-bd07-2fd74a21f4de")).to eq 2
21
22
 
22
23
  # TC Metro result
23
24
  # Smaller bbox / result bbox fits bbox param third
24
- expect(position_in_result_page(page, '02236876-9c21-42f6-9870-d2562da8e44f')).to eq 3
25
+ expect(position_in_result_page(page, "02236876-9c21-42f6-9870-d2562da8e44f")).to eq 3
25
26
  end
26
27
 
27
- scenario 'three bboxes overlap, but none are fully contained, overlap ratio should still impact relevancy' do
28
+ scenario "three bboxes overlap, but none are fully contained, overlap ratio should still impact relevancy" do
28
29
  allow(Settings).to receive(:OVERLAP_RATIO_BOOST).and_return 200
29
30
 
30
31
  # BBox param is the center to western edge of New York state and Canada, roughly centered on Lake Ontario
31
32
  visit search_catalog_path(
32
- bbox: '-83.750499 40.41709 -74.368175 47.963663',
33
- "f[#{Settings.FIELDS.PROVIDER}][]": 'Cornell'
33
+ bbox: "-83.750499 40.41709 -74.368175 47.963663",
34
+ "f[#{Settings.FIELDS.PROVIDER}][]": "Cornell"
34
35
  )
35
36
 
36
37
  # NY State result
37
38
  # Bigger bbox / result bbox overlaps bbox param best
38
- expect(position_in_result_page(page, 'cugir-008186')).to be < 4
39
+ expect(position_in_result_page(page, "cugir-008186")).to be < 4
39
40
 
40
41
  # NY State result
41
42
  # Bigger bbox / result bbox overlaps bbox param best (score tie)
42
- expect(position_in_result_page(page, 'cugir-008186-no-downloadurl')).to be < 4
43
+ expect(position_in_result_page(page, "cugir-008186-no-downloadurl")).to be < 4
43
44
 
44
45
  # NY Adirondak Region result
45
46
  # Smaller bbox / result bbox overlaps bbox param the least
46
- expect(position_in_result_page(page, 'cugir-007741')).to eq 4
47
+ expect(position_in_result_page(page, "cugir-007741")).to eq 4
47
48
  end
48
49
  end
49
50
 
50
51
  def position_in_result_page(page, id)
51
52
  results = []
52
- page.all('div.documentHeader.row').each do |div|
53
- results << div['data-layer-id']
53
+ page.all("div.documentHeader.row").each do |div|
54
+ results << div["data-layer-id"]
54
55
  end
55
56
  results.index(id) + 1
56
57
  end