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,7 +1,8 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'Download layer' do
3
+ require "spec_helper"
4
+
5
+ feature "Download layer" do
5
6
  let(:shapefile_download) { instance_double(Geoblacklight::ShapefileDownload) }
6
7
  let(:kmz_download) { instance_double(Geoblacklight::KmzDownload) }
7
8
 
@@ -10,102 +11,102 @@ feature 'Download layer' do
10
11
  allow(Geoblacklight::KmzDownload).to receive(:new).and_return(kmz_download)
11
12
  end
12
13
 
13
- scenario 'clicking initial shapefile download button should trigger download', js: true do
14
- expect(shapefile_download).to receive(:get).and_return('mit-f6rqs4ucovjk2-shapefile.zip')
15
- visit solr_document_path('mit-f6rqs4ucovjk2')
16
- find('#downloads-button').click
17
- find('a[data-download-type="shapefile"]', text: 'Export Shapefile').click
14
+ scenario "clicking initial shapefile download button should trigger download", js: true do
15
+ expect(shapefile_download).to receive(:get).and_return("mit-f6rqs4ucovjk2-shapefile.zip")
16
+ visit solr_document_path("mit-f6rqs4ucovjk2")
17
+ find("#downloads-button").click
18
+ find('a[data-download-type="shapefile"]', text: "Export Shapefile").click
18
19
  expect(page).to have_css(
19
20
  'a[href="/download/file/mit-f6rqs4ucovjk2-shapefile.zip"]',
20
- text: 'Your file mit-f6rqs4ucovjk2-shapefile.zip is ready for download'
21
+ text: "Your file mit-f6rqs4ucovjk2-shapefile.zip is ready for download"
21
22
  )
22
23
  end
23
24
 
24
- scenario 'failed download should return message with link to layer', js: true do
25
- expect(shapefile_download).to receive(:get).and_raise(Geoblacklight::Exceptions::ExternalDownloadFailed.new(message: 'Failed', url: 'http://www.example.com/failed'))
26
- visit solr_document_path('mit-f6rqs4ucovjk2')
27
- find('#downloads-button').click
28
- find('#downloads-collapse a[data-download-type="shapefile"]', text: 'Export Shapefile').click
29
- expect(page).to have_css 'div.alert.alert-danger', text: 'Sorry, the requested file could not be downloaded. Try downloading it directly from:'
30
- expect(page).to have_css 'a', text: 'http://www.example.com/failed'
25
+ scenario "failed download should return message with link to layer", js: true do
26
+ expect(shapefile_download).to receive(:get).and_raise(Geoblacklight::Exceptions::ExternalDownloadFailed.new(message: "Failed", url: "http://www.example.com/failed"))
27
+ visit solr_document_path("mit-f6rqs4ucovjk2")
28
+ find("#downloads-button").click
29
+ find('#downloads-collapse a[data-download-type="shapefile"]', text: "Export Shapefile").click
30
+ expect(page).to have_css "div.alert.alert-danger", text: "Sorry, the requested file could not be downloaded. Try downloading it directly from:"
31
+ expect(page).to have_css "a", text: "http://www.example.com/failed"
31
32
  end
32
33
 
33
- scenario 'clicking kmz download button should trigger download', js: true do
34
- expect(kmz_download).to receive(:get).and_return('mit-f6rqs4ucovjk2-kmz.kmz')
35
- visit solr_document_path('mit-f6rqs4ucovjk2')
36
- find('#downloads-button').click
37
- find('#downloads-collapse a[data-download-type="kmz"]', text: 'Export KMZ').click
34
+ scenario "clicking kmz download button should trigger download", js: true do
35
+ expect(kmz_download).to receive(:get).and_return("mit-f6rqs4ucovjk2-kmz.kmz")
36
+ visit solr_document_path("mit-f6rqs4ucovjk2")
37
+ find("#downloads-button").click
38
+ find('#downloads-collapse a[data-download-type="kmz"]', text: "Export KMZ").click
38
39
  expect(page).to have_css(
39
40
  'a[href="/download/file/mit-f6rqs4ucovjk2-kmz.kmz"]',
40
- text: 'Your file mit-f6rqs4ucovjk2-kmz.kmz is ready for download'
41
+ text: "Your file mit-f6rqs4ucovjk2-kmz.kmz is ready for download"
41
42
  )
42
43
  end
43
44
 
44
- scenario 'jpg download option should be present under toggle' do
45
- visit solr_document_path('princeton-02870w62c')
46
- find('#downloads-button').click
47
- expect(page).to have_css('#downloads-collapse a', text: 'Original JPG')
45
+ scenario "jpg download option should be present under toggle" do
46
+ visit solr_document_path("princeton-02870w62c")
47
+ find("#downloads-button").click
48
+ expect(page).to have_css("#downloads-collapse a", text: "Original JPG")
48
49
  end
49
50
 
50
- scenario 'clicking jpg download button should redirect to external image' do
51
- visit solr_document_path('princeton-02870w62c')
52
- find('#downloads-button').click
53
- expect(page).to have_css("#downloads-collapse a[href='https://iiif-cloud.princeton.edu/iiif/2/6c%2F52%2F12%2F6c5212e81bc845f59bb1cdc740a88bad%2Fintermediate_file/full/full/0/default.jpg']", text: 'Original JPG')
51
+ scenario "clicking jpg download button should redirect to external image" do
52
+ visit solr_document_path("princeton-02870w62c")
53
+ find("#downloads-button").click
54
+ expect(page).to have_css("#downloads-collapse a[href='https://iiif-cloud.princeton.edu/iiif/2/6c%2F52%2F12%2F6c5212e81bc845f59bb1cdc740a88bad%2Fintermediate_file/full/full/0/default.jpg']", text: "Original JPG")
54
55
  end
55
56
 
56
- scenario 'options should be available under toggle' do
57
- visit solr_document_path('mit-f6rqs4ucovjk2')
58
- find('#downloads-button').click
59
- expect(page).to have_css('#downloads-collapse a[data-download-type="shapefile"]', text: 'Export Shapefile')
60
- expect(page).to have_css('#downloads-collapse a[data-download-type="kmz"]', text: 'Export KMZ')
57
+ scenario "options should be available under toggle" do
58
+ visit solr_document_path("mit-f6rqs4ucovjk2")
59
+ find("#downloads-button").click
60
+ expect(page).to have_css('#downloads-collapse a[data-download-type="shapefile"]', text: "Export Shapefile")
61
+ expect(page).to have_css('#downloads-collapse a[data-download-type="kmz"]', text: "Export KMZ")
61
62
  end
62
63
 
63
- scenario 'restricted layer should not have download available to non logged in user' do
64
- visit solr_document_path('stanford-cg357zz0321')
65
- expect(page).to have_css 'a', text: 'Login to View and Download'
66
- expect(page).not_to have_css 'button', text: 'Download'
64
+ scenario "restricted layer should not have download available to non logged in user" do
65
+ visit solr_document_path("stanford-cg357zz0321")
66
+ expect(page).to have_css "a", text: "Login to View and Download"
67
+ expect(page).not_to have_css "button", text: "Download"
67
68
  end
68
69
 
69
- scenario 'restricted layer should have download available to logged in user' do
70
+ scenario "restricted layer should have download available to logged in user" do
70
71
  sign_in
71
- visit solr_document_path('stanford-cg357zz0321')
72
- expect(page).not_to have_css 'a', text: 'Login to view and download'
73
- expect(page).to have_css 'button', text: 'Download'
72
+ visit solr_document_path("stanford-cg357zz0321")
73
+ expect(page).not_to have_css "a", text: "Login to view and download"
74
+ expect(page).to have_css "button", text: "Download"
74
75
  end
75
76
 
76
- scenario 'layer with direct download and wms/wfs should include all download types' do
77
+ scenario "layer with direct download and wms/wfs should include all download types" do
77
78
  sign_in
78
- visit solr_document_path('stanford-cg357zz0321')
79
- find('#downloads-button').click
80
- expect(page).to have_css('#downloads-collapse a', text: 'Original')
81
- expect(page).to have_css('#downloads-collapse a', text: 'Export')
79
+ visit solr_document_path("stanford-cg357zz0321")
80
+ find("#downloads-button").click
81
+ expect(page).to have_css("#downloads-collapse a", text: "Original")
82
+ expect(page).to have_css("#downloads-collapse a", text: "Export")
82
83
  end
83
84
 
84
- scenario 'clicking download GeoTIFF for Harvard layer should show email form', js: true do
85
- visit solr_document_path('harvard-g7064-s2-1834-k3')
86
- find('#downloads-button').click
87
- find('a[data-download-type="harvard-hgl"]', text: 'GeoTIFF').click
88
- expect(page).to have_css('#hglRequest')
85
+ scenario "clicking download GeoTIFF for Harvard layer should show email form", js: true do
86
+ visit solr_document_path("harvard-g7064-s2-1834-k3")
87
+ find("#downloads-button").click
88
+ find('a[data-download-type="harvard-hgl"]', text: "GeoTIFF").click
89
+ expect(page).to have_css("#hglRequest")
89
90
  end
90
91
 
91
- context 'with a successful request to the server' do
92
+ context "with a successful request to the server" do
92
93
  let(:hgl_download) { instance_double(Geoblacklight::HglDownload) }
93
94
 
94
- xscenario 'submitting email form should trigger HGL request', js: true do
95
+ xscenario "submitting email form should trigger HGL request", js: true do
95
96
  # There are currently difficulties with testing the HGL downloader
96
- visit solr_document_path('harvard-g7064-s2-1834-k3')
97
- find('#downloads-button').click
98
- find('a[data-download-type="harvard-hgl"]', text: 'Original GeoTIFF').click
97
+ visit solr_document_path("harvard-g7064-s2-1834-k3")
98
+ find("#downloads-button").click
99
+ find('a[data-download-type="harvard-hgl"]', text: "Original GeoTIFF").click
99
100
 
100
101
  allow_any_instance_of(Geoblacklight::HglDownload).to receive(:new).and_return(hgl_download)
101
- allow(hgl_download).to receive(:get).and_return('success')
102
+ allow(hgl_download).to receive(:get).and_return("success")
102
103
 
103
- within '#hglRequest' do
104
- fill_in('Email', with: 'foo@example.com')
105
- click_button('Request')
104
+ within "#hglRequest" do
105
+ fill_in("Email", with: "foo@example.com")
106
+ click_button("Request")
106
107
  end
107
- expect(page).to have_css('.alert-success')
108
- expect(page).to have_content('You should receive an email when your download is ready')
108
+ expect(page).to have_css(".alert-success")
109
+ expect(page).to have_content("You should receive an email when your download is ready")
109
110
  end
110
111
  end
111
112
  end
@@ -1,12 +1,13 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'Empty search' do
3
+ require "spec_helper"
4
+
5
+ feature "Empty search" do
5
6
  before do
6
7
  visit root_path
7
8
  end
8
- scenario 'Entering empty search returns results page' do
9
- click_button 'search'
10
- expect(page).to have_css '#documents'
9
+ scenario "Entering empty search returns results page" do
10
+ click_button "search"
11
+ expect(page).to have_css "#documents"
11
12
  end
12
13
  end
@@ -1,42 +1,43 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'feature_layer reference', js: true do
5
- scenario 'displays image map layer' do
6
- skip 'spec depend on potentially flaky external services'
7
- visit solr_document_path '32653ed6-8d83-4692-8a06-bf13ffe2c018'
8
- expect(page).to have_css '.leaflet-control-zoom', visible: true
9
- expect(page).to have_css 'img.leaflet-image-layer', visible: true
3
+ require "spec_helper"
4
+
5
+ feature "feature_layer reference", js: true do
6
+ scenario "displays image map layer" do
7
+ skip "spec depend on potentially flaky external services"
8
+ visit solr_document_path "32653ed6-8d83-4692-8a06-bf13ffe2c018"
9
+ expect(page).to have_css ".leaflet-control-zoom", visible: true
10
+ expect(page).to have_css "img.leaflet-image-layer", visible: true
10
11
  end
11
- scenario 'displays dynamic layer (all layers)' do
12
- skip 'spec depend on potentially flaky external services'
13
- visit solr_document_path '90f14ff4-1359-4beb-b931-5cb41d20ab90'
14
- expect(page).to have_css '.leaflet-control-zoom', visible: true
15
- expect(page).to have_css 'img.leaflet-image-layer', visible: true
12
+ scenario "displays dynamic layer (all layers)" do
13
+ skip "spec depend on potentially flaky external services"
14
+ visit solr_document_path "90f14ff4-1359-4beb-b931-5cb41d20ab90"
15
+ expect(page).to have_css ".leaflet-control-zoom", visible: true
16
+ expect(page).to have_css "img.leaflet-image-layer", visible: true
16
17
  end
17
- scenario 'displays dynamic layer (single layer)' do
18
- skip 'spec depend on potentially flaky external services'
19
- visit solr_document_path '4669301e-b4b2-4c8b-bf40-01b968a2865b'
20
- expect(page).to have_css '.leaflet-control-zoom', visible: true
21
- expect(page).to have_css 'img.leaflet-image-layer', visible: true
18
+ scenario "displays dynamic layer (single layer)" do
19
+ skip "spec depend on potentially flaky external services"
20
+ visit solr_document_path "4669301e-b4b2-4c8b-bf40-01b968a2865b"
21
+ expect(page).to have_css ".leaflet-control-zoom", visible: true
22
+ expect(page).to have_css "img.leaflet-image-layer", visible: true
22
23
  end
23
- scenario 'displays feature layer' do
24
- pending 'cannot currently test for svg feature'
25
- visit solr_document_path 'f406332e63eb4478a9560ad86ae90327_18'
26
- expect(page).to have_css '.leaflet-control-zoom', visible: true
27
- expect(Nokogiri::HTML.parse(page.body).css('g').length).to eq 23
24
+ scenario "displays feature layer" do
25
+ pending "cannot currently test for svg feature"
26
+ visit solr_document_path "f406332e63eb4478a9560ad86ae90327_18"
27
+ expect(page).to have_css ".leaflet-control-zoom", visible: true
28
+ expect(Nokogiri::HTML.parse(page.body).css("g").length).to eq 23
28
29
  fail
29
30
  end
30
- scenario 'displays tiled map layer' do
31
- skip 'spec depend on potentially flaky external services'
32
- visit solr_document_path 'nyu-test-soil-survey-map'
33
- expect(page).to have_css '.leaflet-control-zoom', visible: true
34
- expect(page).to have_css 'img.leaflet-tile.leaflet-tile-loaded', visible: true
31
+ scenario "displays tiled map layer" do
32
+ skip "spec depend on potentially flaky external services"
33
+ visit solr_document_path "nyu-test-soil-survey-map"
34
+ expect(page).to have_css ".leaflet-control-zoom", visible: true
35
+ expect(page).to have_css "img.leaflet-tile.leaflet-tile-loaded", visible: true
35
36
  end
36
- scenario 'displays Esri WMS layer' do
37
- skip 'spec depend on potentially flaky external services'
38
- visit solr_document_path 'purdue-urn-f082acb1-b01e-4a08-9126-fd62a23fd9aa'
39
- expect(page).to have_css '.leaflet-control-zoom', visible: true
40
- expect(page).to have_css 'img.leaflet-tile.leaflet-tile-loaded', visible: true
37
+ scenario "displays Esri WMS layer" do
38
+ skip "spec depend on potentially flaky external services"
39
+ visit solr_document_path "purdue-urn-f082acb1-b01e-4a08-9126-fd62a23fd9aa"
40
+ expect(page).to have_css ".leaflet-control-zoom", visible: true
41
+ expect(page).to have_css "img.leaflet-tile.leaflet-tile-loaded", visible: true
41
42
  end
42
43
  end
@@ -1,28 +1,29 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'Export features' do
5
- feature 'when item is public and wfs is available' do
6
- feature 'Open in Carto' do
7
- scenario 'shows up in tools' do
8
- visit solr_document_path 'tufts-cambridgegrid100-04'
9
- expect(page).to have_css 'li.carto a', text: 'Open in Carto'
10
- click_link 'Open in Carto'
3
+ require "spec_helper"
4
+
5
+ feature "Export features" do
6
+ feature "when item is public and wfs is available" do
7
+ feature "Open in Carto" do
8
+ scenario "shows up in tools" do
9
+ visit solr_document_path "tufts-cambridgegrid100-04"
10
+ expect(page).to have_css "li.carto a", text: "Open in Carto"
11
+ click_link "Open in Carto"
11
12
  end
12
13
  end
13
14
  end
14
- feature 'when esri web services are available' do
15
- feature 'Open in ArcGIS Online' do
16
- scenario 'shows up in tools' do
17
- visit solr_document_path '90f14ff4-1359-4beb-b931-5cb41d20ab90'
18
- expect(page).to have_css 'li.arcgis a', text: 'Open in ArcGIS Online'
15
+ feature "when esri web services are available" do
16
+ feature "Open in ArcGIS Online" do
17
+ scenario "shows up in tools" do
18
+ visit solr_document_path "90f14ff4-1359-4beb-b931-5cb41d20ab90"
19
+ expect(page).to have_css "li.arcgis a", text: "Open in ArcGIS Online"
19
20
  end
20
21
  end
21
22
  end
22
- feature 'when restricted or no wfs' do
23
- scenario 'is not in tools' do
24
- visit solr_document_path 'princeton-02870w62c'
25
- expect(page).not_to have_css 'li.carto a', text: 'Open in Carto'
23
+ feature "when restricted or no wfs" do
24
+ scenario "is not in tools" do
25
+ visit solr_document_path "princeton-02870w62c"
26
+ expect(page).not_to have_css "li.carto a", text: "Open in Carto"
26
27
  end
27
28
  end
28
29
  end
@@ -1,15 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
- feature 'Leaflet fullscreen control', js: true do
6
- scenario 'IIIF layer should have full screen control' do
7
- visit solr_document_path('princeton-sx61dn82p')
8
- expect(page).to have_css('.leaflet-control-fullscreen-button')
5
+ feature "Leaflet fullscreen control", js: true do
6
+ scenario "IIIF layer should have full screen control" do
7
+ visit solr_document_path("princeton-sx61dn82p")
8
+ expect(page).to have_css(".leaflet-control-fullscreen-button")
9
9
  end
10
10
 
11
- scenario 'WMS layer should have full screen control' do
12
- visit solr_document_path('stanford-cz128vq0535')
13
- expect(page).to have_css('.leaflet-control-fullscreen-button')
11
+ scenario "WMS layer should have full screen control" do
12
+ visit solr_document_path("stanford-cz128vq0535")
13
+ expect(page).to have_css(".leaflet-control-fullscreen-button")
14
14
  end
15
15
  end
@@ -1,9 +1,10 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'Help Text' do
5
- scenario 'Displays help text entry' do
6
- visit '/catalog/stanford-cg357zz0321'
7
- expect(page).to have_css '.help-text', count: 1
3
+ require "spec_helper"
4
+
5
+ feature "Help Text" do
6
+ scenario "Displays help text entry" do
7
+ visit "/catalog/stanford-cg357zz0321"
8
+ expect(page).to have_css ".help-text", count: 1
8
9
  end
9
10
  end
@@ -1,46 +1,47 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'Home page', js: true do # use js: true for tests which require js, but it slows things down
3
+ require "spec_helper"
4
+
5
+ feature "Home page", js: true do # use js: true for tests which require js, but it slows things down
5
6
  before do
6
7
  visit root_path
7
8
  end
8
- scenario 'navbar' do
9
- expect(page).to have_css '#bookmarks_nav'
10
- expect(page).to have_css 'a', text: 'History'
9
+ scenario "navbar" do
10
+ expect(page).to have_css "#bookmarks_nav"
11
+ expect(page).to have_css "a", text: "History"
11
12
  end
12
- scenario 'search bar' do
13
- expect(page).not_to have_css '#search-navbar'
14
- within '.jumbotron' do
15
- expect(page).to have_css 'h2', text: 'Explore and discover...'
16
- expect(page).to have_css 'h3', text: 'Find the maps and data you need'
17
- expect(page).to have_css 'form.search-query-form'
13
+ scenario "search bar" do
14
+ expect(page).not_to have_css "#search-navbar"
15
+ within ".jumbotron" do
16
+ expect(page).to have_css "h2", text: "Explore and discover..."
17
+ expect(page).to have_css "h3", text: "Find the maps and data you need"
18
+ expect(page).to have_css "form.search-query-form"
18
19
  end
19
20
  end
20
- scenario 'find by category' do
21
- expect(page).to have_css '.category-block', count: 4
22
- expect(page).to have_css '.home-facet-link', count: 36
23
- expect(page).to have_css 'a.more_facets_link', count: 4
24
- click_link 'Counties'
25
- expect(page).to have_css '.filter-name', text: 'Subject'
26
- expect(page).to have_css '.filter-value', text: 'Counties'
21
+ scenario "find by category" do
22
+ expect(page).to have_css ".category-block", count: 4
23
+ expect(page).to have_css ".home-facet-link", count: 36
24
+ expect(page).to have_css "a.more_facets_link", count: 4
25
+ click_link "Counties"
26
+ expect(page).to have_css ".filter-name", text: "Subject"
27
+ expect(page).to have_css ".filter-value", text: "Counties"
27
28
  end
28
- scenario 'map should be visible' do
29
- within '#main-container' do
30
- expect(page).to have_css('#map')
31
- expect(page).to have_css('img.leaflet-tile', minimum: 3)
29
+ scenario "map should be visible" do
30
+ within "#main-container" do
31
+ expect(page).to have_css("#map")
32
+ expect(page).to have_css("img.leaflet-tile", minimum: 3)
32
33
  end
33
34
  end
34
- scenario 'clicking map search should create a spatial search' do
35
- within '#map' do
36
- find('.search-control a').click
35
+ scenario "clicking map search should create a spatial search" do
36
+ within "#map" do
37
+ find(".search-control a").click
37
38
  expect(page.current_url).to match(/bbox=/)
38
39
  end
39
- expect(page).to have_css '#documents'
40
+ expect(page).to have_css "#documents"
40
41
  end
41
- scenario 'can search by placename' do
42
- click_link 'New York, New York'
43
- results = page.all(:css, 'article.document')
42
+ scenario "can search by placename" do
43
+ click_link "New York, New York"
44
+ results = page.all(:css, "article.document")
44
45
  expect(results.count).to equal(4)
45
46
  end
46
47
  end
@@ -1,9 +1,10 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'iiif reference' do
5
- scenario 'displays leaflet viewer', js: true do
6
- visit solr_document_path('princeton-02870w62c')
7
- expect(page).to have_css '.leaflet-control-zoom', visible: true
3
+ require "spec_helper"
4
+
5
+ feature "iiif reference" do
6
+ scenario "displays leaflet viewer", js: true do
7
+ visit solr_document_path("princeton-02870w62c")
8
+ expect(page).to have_css ".leaflet-control-zoom", visible: true
8
9
  end
9
10
  end
@@ -1,31 +1,32 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'Index map' do
3
+ require "spec_helper"
4
+
5
+ feature "Index map" do
5
6
  # Colors
6
- default_color = '#7FCDBB'
7
- selected_color = '#2C7FB8'
8
- scenario 'displays index map viewer (polygon)', js: true do
9
- visit solr_document_path('stanford-fb897vt9938')
7
+ default_color = "#7FCDBB"
8
+ selected_color = "#2C7FB8"
9
+ scenario "displays index map viewer (polygon)", js: true do
10
+ visit solr_document_path("stanford-fb897vt9938")
10
11
  # Wait until SVG elements are added
11
- expect(page).to have_css '.leaflet-overlay-pane svg'
12
- within '#map' do
12
+ expect(page).to have_css ".leaflet-overlay-pane svg"
13
+ within "#map" do
13
14
  expect(page).to have_css "svg g path:nth-child(2)[fill='#{default_color}']"
14
- find('svg g path:nth-child(2)').click
15
+ find("svg g path:nth-child(2)").click
15
16
  expect(page).to have_css "svg g path:nth-child(2)[fill='#{selected_color}']"
16
- first('svg g path').click
17
+ first("svg g path").click
17
18
  expect(page).to have_css "svg g path:nth-child(2)[fill='#{default_color}']"
18
19
  end
19
20
  end
20
- scenario 'displays index map viewer (points)', js: true do
21
- visit solr_document_path('cornell-ny-aerial-photos-1960s')
21
+ scenario "displays index map viewer (points)", js: true do
22
+ visit solr_document_path("cornell-ny-aerial-photos-1960s")
22
23
  # Wait until SVG elements are added
23
- expect(page).to have_css '.leaflet-overlay-pane svg'
24
- within '#map' do
24
+ expect(page).to have_css ".leaflet-overlay-pane svg"
25
+ within "#map" do
25
26
  expect(page).to have_css "svg g path:nth-child(2)[fill='#{default_color}']"
26
- find('svg g path:nth-child(2)').click
27
+ find("svg g path:nth-child(2)").click
27
28
  expect(page).to have_css "svg g path:nth-child(2)[fill='#{selected_color}']"
28
- first('svg g path').click
29
+ first("svg g path").click
29
30
  expect(page).to have_css "svg g path:nth-child(2)[fill='#{default_color}']"
30
31
  end
31
32
  end
@@ -1,11 +1,12 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'Layer inspection', js: true do
5
- scenario 'clicking map should trigger inspection' do
6
- visit solr_document_path('mit-f6rqs4ucovjk2')
7
- expect(page).to have_css('th', text: 'Attribute')
8
- find('#map').click
9
- expect(page).not_to have_css('td.default-text')
3
+ require "spec_helper"
4
+
5
+ feature "Layer inspection", js: true do
6
+ scenario "clicking map should trigger inspection" do
7
+ visit solr_document_path("mit-f6rqs4ucovjk2")
8
+ expect(page).to have_css("th", text: "Attribute")
9
+ find("#map").click
10
+ expect(page).not_to have_css("td.default-text")
10
11
  end
11
12
  end
@@ -1,22 +1,23 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'Layer opacity', js: true do
5
- scenario 'WMS layer should have opacity control' do
6
- visit solr_document_path('mit-f6rqs4ucovjk2')
7
- expect(page).to have_css('div.opacity-text', text: '75%')
8
- expect(page.all('div.leaflet-layer')[1][:style]).to match(/opacity: 0.75;/)
3
+ require "spec_helper"
4
+
5
+ feature "Layer opacity", js: true do
6
+ scenario "WMS layer should have opacity control" do
7
+ visit solr_document_path("mit-f6rqs4ucovjk2")
8
+ expect(page).to have_css("div.opacity-text", text: "75%")
9
+ expect(page.all("div.leaflet-layer")[1][:style]).to match(/opacity: 0.75;/)
9
10
  end
10
11
 
11
- scenario 'ESRI image service layer should have opacity control' do
12
- skip 'CORS error - Purdue web services are down'
13
- visit solr_document_path('32653ed6-8d83-4692-8a06-bf13ffe2c018')
14
- expect(page).to have_css('div.opacity-text', text: '75%')
15
- expect(page.find('img.leaflet-image-layer', match: :first)[:style]).to match(/opacity: 0.75;/)
12
+ scenario "ESRI image service layer should have opacity control" do
13
+ skip "CORS error - Purdue web services are down"
14
+ visit solr_document_path("32653ed6-8d83-4692-8a06-bf13ffe2c018")
15
+ expect(page).to have_css("div.opacity-text", text: "75%")
16
+ expect(page.find("img.leaflet-image-layer", match: :first)[:style]).to match(/opacity: 0.75;/)
16
17
  end
17
18
 
18
- scenario 'IIIF layer should not have opacity control' do
19
- visit solr_document_path('princeton-02870w62c')
20
- expect(page).not_to have_css('div.opacity-text', text: '75%')
19
+ scenario "IIIF layer should not have opacity control" do
20
+ visit solr_document_path("princeton-02870w62c")
21
+ expect(page).not_to have_css("div.opacity-text", text: "75%")
21
22
  end
22
23
  end
@@ -1,18 +1,19 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'Layer preview', js: true do
5
- scenario 'Restricted layer should show bounding box' do
6
- visit solr_document_path('stanford-cg357zz0321')
7
- within('#map') do
8
- expect(page).to have_css('path')
3
+ require "spec_helper"
4
+
5
+ feature "Layer preview", js: true do
6
+ scenario "Restricted layer should show bounding box" do
7
+ visit solr_document_path("stanford-cg357zz0321")
8
+ within("#map") do
9
+ expect(page).to have_css("path")
9
10
  end
10
11
  end
11
12
 
12
- scenario 'Public layer should show wms layer not bounding box' do
13
- visit solr_document_path('mit-f6rqs4ucovjk2')
14
- within '.leaflet-tile-pane' do
15
- expect(page).to have_css('.leaflet-layer', count: 2)
13
+ scenario "Public layer should show wms layer not bounding box" do
14
+ visit solr_document_path("mit-f6rqs4ucovjk2")
15
+ within ".leaflet-tile-pane" do
16
+ expect(page).to have_css(".leaflet-layer", count: 2)
16
17
  end
17
18
  end
18
19
  end
@@ -1,9 +1,10 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- feature 'layer with no wms or iiif' do
5
- scenario 'has map with bounding box' do
6
- pending 'waiting on #201, need example metadata record'
3
+ require "spec_helper"
4
+
5
+ feature "layer with no wms or iiif" do
6
+ scenario "has map with bounding box" do
7
+ pending "waiting on #201, need example metadata record"
7
8
  fail
8
9
  end
9
10
  end