geoblacklight 4.0.0 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +21 -6
- data/.solr_wrapper +1 -0
- data/.standard.yml +1 -0
- data/Gemfile +13 -11
- data/README.md +1 -1
- data/Rakefile +42 -50
- data/app/assets/images/blacklight/american-geographical-society-library-uwm-libraries.svg +26 -0
- data/app/assets/images/blacklight/arizona.svg +4 -0
- data/app/assets/images/blacklight/circle-info-solid.svg +1 -0
- data/app/assets/images/blacklight/fire-solid.svg +1 -0
- data/app/assets/images/blacklight/lightbulb-solid.svg +1 -0
- data/app/assets/images/blacklight/nebraska.svg +4 -0
- data/app/assets/images/blacklight/rutgers.svg +5 -0
- data/app/assets/images/blacklight/triangle-exclamation-solid.svg +1 -0
- data/app/assets/stylesheets/geoblacklight/modules/sidebar.scss +8 -0
- data/app/components/geoblacklight/display_note_component.html.erb +1 -0
- data/app/components/geoblacklight/display_note_component.rb +47 -0
- data/app/components/geoblacklight/icon_facet_item_component.rb +2 -2
- data/app/controllers/download_controller.rb +36 -37
- data/app/controllers/relation_controller.rb +1 -0
- data/app/controllers/wms_controller.rb +1 -0
- data/app/helpers/arcgis_helper.rb +2 -1
- data/app/helpers/blacklight_helper.rb +2 -1
- data/app/helpers/carto_helper.rb +3 -2
- data/app/helpers/geoblacklight/geoblacklight_helper_behavior.rb +2 -1
- data/app/helpers/geoblacklight_helper.rb +44 -36
- data/app/models/concerns/geoblacklight/bbox_filter_query.rb +1 -1
- data/app/models/concerns/geoblacklight/solr_document/arcgis.rb +1 -0
- data/app/models/concerns/geoblacklight/solr_document/carto.rb +1 -0
- data/app/models/concerns/geoblacklight/solr_document/citation.rb +3 -2
- data/app/models/concerns/geoblacklight/solr_document/finder.rb +1 -0
- data/app/models/concerns/geoblacklight/solr_document/inspection.rb +1 -0
- data/app/models/concerns/geoblacklight/solr_document.rb +17 -9
- data/app/models/concerns/geoblacklight/suppressed_records_search_behavior.rb +2 -1
- data/app/presenters/geoblacklight/document_presenter.rb +3 -2
- data/app/views/catalog/_show_default_display_note.html.erb +7 -0
- data/app/views/catalog/_show_sidebar.html.erb +1 -0
- data/app/views/catalog/_show_sidebar_static_map.html.erb +10 -0
- data/app/views/relation/index.json.jbuilder +1 -1
- data/config/initializers/new_gbl_settings_defaults_4.1.yml +104 -0
- data/config/initializers/rails_config.rb +5 -1
- data/config/locales/geoblacklight.en.yml +18 -10
- data/geoblacklight.gemspec +36 -40
- data/lib/generators/geoblacklight/assets_generator.rb +15 -15
- data/lib/generators/geoblacklight/install_generator.rb +24 -23
- data/lib/generators/geoblacklight/templates/catalog_controller.rb +66 -71
- data/lib/generators/geoblacklight/templates/settings.yml +74 -22
- data/lib/geoblacklight/bounding_box.rb +1 -0
- data/lib/geoblacklight/constants.rb +26 -25
- data/lib/geoblacklight/download/geojson_download.rb +10 -9
- data/lib/geoblacklight/download/geotiff_download.rb +6 -5
- data/lib/geoblacklight/download/hgl_download.rb +4 -3
- data/lib/geoblacklight/download/kmz_download.rb +11 -10
- data/lib/geoblacklight/download/shapefile_download.rb +10 -9
- data/lib/geoblacklight/download.rb +12 -11
- data/lib/geoblacklight/engine.rb +10 -9
- data/lib/geoblacklight/exceptions.rb +3 -0
- data/lib/geoblacklight/faraday_middleware/follow_redirects.rb +12 -11
- data/lib/geoblacklight/geometry.rb +6 -5
- data/lib/geoblacklight/item_viewer.rb +4 -3
- data/lib/geoblacklight/metadata/base.rb +4 -3
- data/lib/geoblacklight/metadata/fgdc.rb +1 -0
- data/lib/geoblacklight/metadata/html.rb +5 -4
- data/lib/geoblacklight/metadata/iso19139.rb +1 -0
- data/lib/geoblacklight/metadata.rb +1 -0
- data/lib/geoblacklight/metadata_transformer/base.rb +5 -4
- data/lib/geoblacklight/metadata_transformer/fgdc.rb +1 -0
- data/lib/geoblacklight/metadata_transformer/iso19139.rb +1 -0
- data/lib/geoblacklight/metadata_transformer.rb +6 -2
- data/lib/geoblacklight/reference.rb +3 -2
- data/lib/geoblacklight/references.rb +11 -6
- data/lib/geoblacklight/relation/ancestors.rb +4 -3
- data/lib/geoblacklight/relation/descendants.rb +4 -3
- data/lib/geoblacklight/relation/relation_response.rb +3 -2
- data/lib/geoblacklight/routes/downloadable.rb +3 -2
- data/lib/geoblacklight/routes/exportable.rb +4 -3
- data/lib/geoblacklight/routes/wms.rb +2 -1
- data/lib/geoblacklight/routes.rb +4 -3
- data/lib/geoblacklight/version.rb +2 -1
- data/lib/geoblacklight/view_helper_override.rb +3 -2
- data/lib/geoblacklight/wms_layer/feature_info_response.rb +5 -4
- data/lib/geoblacklight/wms_layer.rb +4 -3
- data/lib/geoblacklight.rb +32 -31
- data/lib/tasks/geoblacklight.rake +45 -44
- data/schema/geoblacklight-schema-aardvark.json +6 -0
- data/spec/components/geoblacklight/display_note_component_spec.rb +27 -0
- data/spec/components/geoblacklight/homepage_feature_facet_component_spec.rb +11 -10
- data/spec/components/geoblacklight/icon_facet_item_component_spec.rb +8 -7
- data/spec/config/initializers/rails_config_spec.rb +10 -9
- data/spec/controllers/catalog_controller_spec.rb +27 -26
- data/spec/controllers/download_controller_spec.rb +50 -49
- data/spec/controllers/relation_controller_spec.rb +5 -4
- data/spec/controllers/wms_controller_spec.rb +10 -9
- data/spec/factories/user.rb +3 -2
- data/spec/features/bookmarks_spec.rb +7 -6
- data/spec/features/configurable_basemap_spec.rb +12 -11
- data/spec/features/data_dictionary_download_spec.rb +11 -10
- data/spec/features/download_layer_spec.rb +64 -63
- data/spec/features/empty_search_spec.rb +6 -5
- data/spec/features/esri_viewer_spec.rb +33 -32
- data/spec/features/exports_spec.rb +18 -17
- data/spec/features/full_screen_controll_spec.rb +8 -8
- data/spec/features/help_text_spec.rb +6 -5
- data/spec/features/home_page_spec.rb +30 -29
- data/spec/features/iiif_viewer_spec.rb +6 -5
- data/spec/features/index_map_spec.rb +17 -16
- data/spec/features/layer_inspection_spec.rb +8 -7
- data/spec/features/layer_opacity_spec.rb +15 -14
- data/spec/features/layer_preview_spec.rb +11 -10
- data/spec/features/layer_with_no_references_spec.rb +5 -4
- data/spec/features/linkified_attribute_table_spec.rb +8 -7
- data/spec/features/metadata_panel_spec.rb +32 -31
- data/spec/features/missing_metadata_spec.rb +18 -17
- data/spec/features/multiple_downloads_spec.rb +11 -10
- data/spec/features/oembed_spec.rb +6 -5
- data/spec/features/relations_spec.rb +51 -26
- data/spec/features/saved_searches_spec.rb +7 -6
- data/spec/features/search_bar_spec.rb +9 -8
- data/spec/features/search_results_complex_geometry_spec.rb +12 -11
- data/spec/features/search_results_icons_spec.rb +10 -9
- data/spec/features/search_results_map_spec.rb +21 -20
- data/spec/features/search_results_overlap_ratio_spec.rb +17 -16
- data/spec/features/search_spec.rb +19 -18
- data/spec/features/show_page_download_spec.rb +15 -14
- data/spec/features/show_page_metadata_spec.rb +9 -8
- data/spec/features/show_page_sidebar_static_map_spec.rb +21 -0
- data/spec/features/sms_spec.rb +12 -11
- data/spec/features/split_view.html.erb_spec.rb +56 -55
- data/spec/features/suppressed_records_spec.rb +10 -9
- data/spec/features/tilejson_spec.rb +9 -8
- data/spec/features/tms_spec.rb +6 -5
- data/spec/features/web_services_modal_spec.rb +37 -36
- data/spec/features/wmts_spec.rb +16 -15
- data/spec/features/xyz_spec.rb +6 -5
- data/spec/fixtures/solr_documents/actual-papermap1.json +1 -1
- data/spec/fixtures/solr_documents/actual-point1.json +1 -1
- data/spec/fixtures/solr_documents/actual-polygon1.json +1 -1
- data/spec/fixtures/solr_documents/actual-raster1.json +1 -1
- data/spec/fixtures/solr_documents/baruch_ancestor1.json +1 -1
- data/spec/fixtures/solr_documents/baruch_ancestor2.json +1 -1
- data/spec/fixtures/solr_documents/baruch_documentation_download.json +2 -2
- data/spec/fixtures/solr_documents/cornell_html_metadata.json +1 -1
- data/spec/fixtures/solr_documents/display-note.json +52 -0
- data/spec/fixtures/solr_documents/esri-dynamic-layer-all-layers.json +1 -1
- data/spec/fixtures/solr_documents/esri-dynamic-layer-single-layer.json +1 -1
- data/spec/fixtures/solr_documents/esri-feature-layer.json +1 -1
- data/spec/fixtures/solr_documents/esri-image-map-layer.json +1 -1
- data/spec/fixtures/solr_documents/esri-tiled_map_layer.json +1 -1
- data/spec/fixtures/solr_documents/esri-wms-layer.json +1 -1
- data/spec/fixtures/solr_documents/harvard_raster.json +1 -1
- data/spec/fixtures/solr_documents/iiif-eastern-hemisphere.json +1 -1
- data/spec/fixtures/solr_documents/index-map-polygon-no-downloadurl.json +1 -1
- data/spec/fixtures/solr_documents/index-map-polygon.json +1 -1
- data/spec/fixtures/solr_documents/index-map-stanford.json +1 -1
- data/spec/fixtures/solr_documents/index_map_point.json +1 -1
- data/spec/fixtures/solr_documents/princeton-parent.json +1 -1
- data/spec/fixtures/solr_documents/public_direct_download.json +1 -1
- data/spec/fixtures/solr_documents/public_iiif_princeton.json +1 -1
- data/spec/fixtures/solr_documents/restricted-line.json +1 -1
- data/spec/fixtures/solr_documents/tilejson.json +2 -2
- data/spec/fixtures/solr_documents/umn_metro_result1.json +2 -2
- data/spec/fixtures/solr_documents/umn_state_result1.json +1 -1
- data/spec/fixtures/solr_documents/umn_state_result2.json +1 -1
- data/spec/fixtures/solr_documents/uva_slug_colon.json +1 -1
- data/spec/fixtures/solr_documents/wmts-multiple.json +1 -1
- data/spec/fixtures/solr_documents/wmts-single-layer.json +6 -6
- data/spec/fixtures/solr_documents/xyz.json +3 -3
- data/spec/helpers/arcgis_helper_spec.rb +8 -7
- data/spec/helpers/carto_helper_spec.rb +6 -5
- data/spec/helpers/geoblacklight/geoblacklight_helper_behavior_spec.rb +10 -15
- data/spec/helpers/geoblacklight_helper_spec.rb +139 -138
- data/spec/lib/geoblacklight/bounding_box_spec.rb +14 -13
- data/spec/lib/geoblacklight/document_presenter_spec.rb +26 -25
- data/spec/lib/geoblacklight/download/geojson_download_spec.rb +8 -7
- data/spec/lib/geoblacklight/download/geotiff_download_spec.rb +8 -7
- data/spec/lib/geoblacklight/download/hgl_download_spec.rb +16 -15
- data/spec/lib/geoblacklight/download/kmz_download_spec.rb +9 -8
- data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +8 -7
- data/spec/lib/geoblacklight/download_spec.rb +61 -60
- data/spec/lib/geoblacklight/geometry_spec.rb +29 -28
- data/spec/lib/geoblacklight/item_viewer_spec.rb +25 -24
- data/spec/lib/geoblacklight/metadata/base_spec.rb +44 -43
- data/spec/lib/geoblacklight/metadata/html_spec.rb +7 -6
- data/spec/lib/geoblacklight/metadata_spec.rb +15 -14
- data/spec/lib/geoblacklight/metadata_transformer/base_spec.rb +13 -12
- data/spec/lib/geoblacklight/metadata_transformer/fgdc_spec.rb +8 -7
- data/spec/lib/geoblacklight/metadata_transformer/iso19139_spec.rb +8 -7
- data/spec/lib/geoblacklight/metadata_transformer_spec.rb +15 -14
- data/spec/lib/geoblacklight/reference_spec.rb +28 -27
- data/spec/lib/geoblacklight/references_spec.rb +89 -76
- data/spec/lib/geoblacklight/relation/ancestors_spec.rb +17 -16
- data/spec/lib/geoblacklight/relation/descendants_spec.rb +17 -16
- data/spec/lib/geoblacklight/relation/relation_response_spec.rb +29 -28
- data/spec/lib/geoblacklight/view_helper_override_spec.rb +14 -13
- data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +19 -18
- data/spec/lib/geoblacklight/wms_layer_spec.rb +31 -30
- data/spec/models/concerns/geoblacklight/bbox_filter_field_spec.rb +31 -31
- data/spec/models/concerns/geoblacklight/bbox_filter_query_spec.rb +32 -32
- data/spec/models/concerns/geoblacklight/solr_document/carto_spec.rb +16 -15
- data/spec/models/concerns/geoblacklight/solr_document/citation_spec.rb +7 -6
- data/spec/models/concerns/geoblacklight/solr_document/finder_spec.rb +16 -17
- data/spec/models/concerns/geoblacklight/solr_document/inspection_spec.rb +7 -6
- data/spec/models/concerns/geoblacklight/solr_document_spec.rb +121 -107
- data/spec/models/concerns/geoblacklight/suppressed_records_search_behavior_spec.rb +8 -7
- data/spec/presenters/geoblacklight/bbox_item_presenter_spec.rb +10 -10
- data/spec/routing/catalog_routing_spec.rb +4 -3
- data/spec/spec_helper.rb +34 -33
- data/spec/support/backport_test_helpers.rb +6 -5
- data/spec/support/features/session_helpers.rb +8 -7
- data/spec/support/features.rb +2 -1
- data/spec/support/fixtures.rb +2 -1
- data/spec/tasks/geoblacklight_spec.rb +10 -9
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +16 -15
- data/spec/views/catalog/_document_split.html.erb_spec.rb +3 -2
- data/spec/views/catalog/_index_split.html.erb_spec.rb +3 -2
- data/spec/views/catalog/_results_pagination.html.erb_spec.rb +5 -4
- data/spec/views/catalog/_show_downloads.html.erb_spec.rb +11 -10
- data/spec/views/catalog/_show_tools.html.erb_spec.rb +13 -12
- data/template.rb +9 -8
- metadata +29 -212
- data/.gitmodules +0 -0
- data/.rubocop.yml +0 -111
- data/.rubocop_todo.yml +0 -437
- data/config/initializers/new_gbl_settings_defaults_3_4.yml +0 -6
@@ -40,7 +40,7 @@
|
|
40
40
|
],
|
41
41
|
"dct_issued_s": "2016-01-15",
|
42
42
|
"gbl_indexYear_im": [
|
43
|
-
|
43
|
+
2015
|
44
44
|
],
|
45
45
|
"gbl_dateRange_drsim": [
|
46
46
|
"[2015 TO 2015]"
|
@@ -59,7 +59,7 @@
|
|
59
59
|
"locn_geometry": "ENVELOPE(-74.030876,-73.755405,40.903125,40.576127)",
|
60
60
|
"dcat_centroid": "40.739626,-73.8931405",
|
61
61
|
"dct_source_sm": [
|
62
|
-
"nyu_2451_34635",
|
62
|
+
"nyu_2451_34635",
|
63
63
|
"nyu_2451_34636"
|
64
64
|
],
|
65
65
|
"dct_accessRights_s": "Public",
|
@@ -0,0 +1,52 @@
|
|
1
|
+
{
|
2
|
+
"dct_title_s": "Building Footprints, Frobozz Headquarters, 781 GUE",
|
3
|
+
"dct_description_sm": [
|
4
|
+
"This is just a test record that has a couple of display notes."
|
5
|
+
],
|
6
|
+
"dct_language_sm": [
|
7
|
+
"eng"
|
8
|
+
],
|
9
|
+
"gbl_displayNote_sm": [
|
10
|
+
"This is a generic note about the resource that may be useful to users of this data.",
|
11
|
+
"Danger: This document is highly flammable.",
|
12
|
+
"Info: This dataset represents the buildings before they were destroyed by the Curse of Megaboz.",
|
13
|
+
"Tip: Be sure to look in the mailbox outside the white house.",
|
14
|
+
"Warning: This data is fictional."
|
15
|
+
],
|
16
|
+
"dct_creator_sm": [
|
17
|
+
"FrobozzCo International"
|
18
|
+
],
|
19
|
+
"dct_publisher_sm": [
|
20
|
+
"FrobozzCo International"
|
21
|
+
],
|
22
|
+
"schema_provider_s": "Cornell",
|
23
|
+
"gbl_resourceClass_sm": [
|
24
|
+
"Datasets"
|
25
|
+
],
|
26
|
+
"gbl_resourceType_sm": [
|
27
|
+
"Polygon data"
|
28
|
+
],
|
29
|
+
"dct_subject_sm": [
|
30
|
+
"Buildings"
|
31
|
+
],
|
32
|
+
"dcat_keyword_sm": [
|
33
|
+
"GBL Fixture records"
|
34
|
+
],
|
35
|
+
"dct_temporal_sm": [
|
36
|
+
"781 GUE"
|
37
|
+
],
|
38
|
+
"dct_issued_s": "1983-01-01",
|
39
|
+
"gbl_indexYear_im": [
|
40
|
+
1983
|
41
|
+
],
|
42
|
+
"dct_spatial_sm": [
|
43
|
+
"Flatheadia, Great Underground Empire"
|
44
|
+
],
|
45
|
+
"locn_geometry": "ENVELOPE(-71.118450,-71.074848,42.381246,42.354612)",
|
46
|
+
"dcat_bbox": "ENVELOPE(-71.118450,-71.074848,42.381246,42.354612)",
|
47
|
+
"dct_accessRights_s": "Public",
|
48
|
+
"dct_format_s": "Shapefile",
|
49
|
+
"id": "frobozz-111",
|
50
|
+
"gbl_mdModified_dt": "2023-03-03T18:29:16Z",
|
51
|
+
"gbl_mdVersion_s": "Aardvark"
|
52
|
+
}
|
@@ -30,9 +30,9 @@
|
|
30
30
|
"Balkan Peninsula",
|
31
31
|
"Turkey"
|
32
32
|
],
|
33
|
-
"dct_issued_s": 1908,
|
33
|
+
"dct_issued_s": "1908",
|
34
34
|
"gbl_indexYear_im": [
|
35
|
-
|
35
|
+
1908
|
36
36
|
],
|
37
37
|
"gbl_mdModified_dt": "2022-02-03T22:13:40Z",
|
38
38
|
"dct_references_s": "{\"http://schema.org/url\":\"https://catalog.princeton.edu/catalog/99125413918506421\",\"http://schema.org/thumbnailUrl\":\"https://figgy-staging.princeton.edu/downloads/6b55d939-7188-4bce-9550-0ac535441f22/file/9042b887-da2e-4aa9-9ca5-d3ba77f440c4\",\"http://iiif.io/api/image\":\"https://iiif-cloud-staging.princeton.edu/iiif/2/05%2F71%2F04%2F0571046f9c7149a3b950899323f70788%2Fintermediate_file/info.json\",\"http://iiif.io/api/presentation#manifest\":\"https://figgy-staging.princeton.edu/concern/scanned_maps/2a91d82c-541c-426c-b787-cc62afe8f248/manifest\",\"https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames\":\"https://map-tiles-staging.princeton.edu/mosaicjson/tiles/WebMercatorQuad/{z}/{x}/{y}@1x.png?id=2a91d82c541c426cb787cc62afe8f248\",\"https://github.com/mapbox/tilejson-spec\":\"https://map-tiles-staging.princeton.edu/mosaicjson/tilejson.json?id=2a91d82c541c426cb787cc62afe8f248\"}",
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"gbl_mdVersion_s": "Aardvark",
|
3
3
|
"dct_identifier_sm": [
|
4
|
-
|
4
|
+
"ark:/99999/fk4544658v"
|
5
5
|
],
|
6
6
|
"id": "princeton-fk4544658v-wmts",
|
7
7
|
"dct_title_s": "The Balkans [and] Turkey : G.S.G.S. no. 2097 / War Office. General Staff. Geographical Section (WMTS Fixture)",
|
@@ -10,16 +10,16 @@
|
|
10
10
|
"schema_provider_s": "Princeton",
|
11
11
|
"dct_accessRights_s": "Public",
|
12
12
|
"dct_description_sm": [
|
13
|
-
|
13
|
+
"Relief shown by contours approximately 100 feet interval, spot heights, and shading. Title varies; some sheets are titled \"Turkey\". Shows international boundaries, railways, 2 categories of roads, telegraph lines, places of worship, ruins. Constantinople latest edition map has a glossary."
|
14
14
|
],
|
15
15
|
"dct_creator_sm": [
|
16
16
|
"Great Britain. War Office. General Staff. Geographical Section"
|
17
17
|
],
|
18
18
|
"dct_language_sm": [
|
19
|
-
|
19
|
+
"eng"
|
20
20
|
],
|
21
21
|
"dct_publisher_sm": [
|
22
|
-
|
22
|
+
"[London] : War Office. General Staff. Geographical Section. General Staff, 1908-25."
|
23
23
|
],
|
24
24
|
"dct_subject_sm": [
|
25
25
|
"Balkan Peninsula Maps",
|
@@ -30,9 +30,9 @@
|
|
30
30
|
"Balkan Peninsula",
|
31
31
|
"Turkey"
|
32
32
|
],
|
33
|
-
"dct_issued_s": 1908,
|
33
|
+
"dct_issued_s": "1908",
|
34
34
|
"gbl_indexYear_im": [
|
35
|
-
|
35
|
+
1908
|
36
36
|
],
|
37
37
|
"gbl_mdModified_dt": "2022-02-03T22:13:40Z",
|
38
38
|
"gbl_wxsIdentifier_s": "mosaic",
|
@@ -3,7 +3,7 @@
|
|
3
3
|
"6f47b103-9955-4bbe-a364-387039623106"
|
4
4
|
],
|
5
5
|
"dct_title_s": "Quaternary Fault and Fold Database of the United States (XYZ)",
|
6
|
-
"dct_description_sm":[
|
6
|
+
"dct_description_sm": [
|
7
7
|
"Quaternary Fault and Fold Database of the United States"
|
8
8
|
],
|
9
9
|
"dct_accessRights_s": "Public",
|
@@ -28,9 +28,9 @@
|
|
28
28
|
"Earthquakes",
|
29
29
|
"Faults"
|
30
30
|
],
|
31
|
-
"dct_issued_s": 2020,
|
31
|
+
"dct_issued_s": "2020",
|
32
32
|
"gbl_indexYear_im": [
|
33
|
-
|
33
|
+
2020
|
34
34
|
],
|
35
35
|
"dct_temporal_sm": [
|
36
36
|
"2020"
|
@@ -1,15 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
2
|
+
|
3
|
+
require "spec_helper"
|
3
4
|
|
4
5
|
describe ArcgisHelper, type: :helper do
|
5
|
-
describe
|
6
|
-
let(:application_name) {
|
6
|
+
describe "#arcgis_link" do
|
7
|
+
let(:application_name) { "My GeoBlacklight Deployment" }
|
7
8
|
|
8
|
-
it
|
9
|
-
expect(arcgis_link(
|
9
|
+
it "creates a valid ArcGIS online url with correct params" do
|
10
|
+
expect(arcgis_link("http://example.com/foo/MapServer")).to eq "https://www.arcgis.com/home/webmap/viewer.html?urls=http%3A%2F%2Fexample.com%2Ffoo%2FMapServer"
|
10
11
|
end
|
11
|
-
it
|
12
|
-
expect(arcgis_link([
|
12
|
+
it "handles multiple urls" do
|
13
|
+
expect(arcgis_link(["http://example.com/foo/MapServer", "http://example.com/foo/FeatureServer"])).to eq "https://www.arcgis.com/home/webmap/viewer.html?urls=http%3A%2F%2Fexample.com%2Ffoo%2FMapServer&urls=http%3A%2F%2Fexample.com%2Ffoo%2FFeatureServer"
|
13
14
|
end
|
14
15
|
end
|
15
16
|
end
|
@@ -1,12 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
2
|
+
|
3
|
+
require "spec_helper"
|
3
4
|
|
4
5
|
describe CartoHelper, type: :helper do
|
5
|
-
describe
|
6
|
-
let(:application_name) {
|
6
|
+
describe "#carto_link" do
|
7
|
+
let(:application_name) { "My GeoBlacklight Deployment" }
|
7
8
|
|
8
|
-
it
|
9
|
-
expect(carto_link(
|
9
|
+
it "removes spaces from application_name to produce valid Carto request URL" do
|
10
|
+
expect(carto_link("http://demo.org/wfs/layer.json")).to eq "http://oneclick.carto.com/?file=http%3A%2F%2Fdemo.org%2Fwfs%2Flayer.json&provider=MyGeoBlacklightDeployment&logo=http%3A%2F%2Fgeoblacklight.org%2Fimages%2Fgeoblacklight-logo.png"
|
10
11
|
end
|
11
12
|
end
|
12
13
|
end
|
@@ -1,31 +1,26 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
2
|
+
|
3
|
+
require "spec_helper"
|
3
4
|
|
4
5
|
describe Geoblacklight::GeoblacklightHelperBehavior do
|
5
6
|
let(:dummy_class) do
|
6
7
|
Class.new.extend(described_class)
|
7
8
|
end
|
8
|
-
let(:presenter) { instance_double(
|
9
|
-
|
10
|
-
before do
|
11
|
-
class MyPresenter < Blacklight::ShowPresenter
|
12
|
-
def fake_name; end
|
13
|
-
end
|
14
|
-
end
|
9
|
+
let(:presenter) { instance_double(Geoblacklight::DocumentPresenter, index_fields_display: "druid:abc123") }
|
15
10
|
|
16
|
-
describe
|
11
|
+
describe "#geoblacklight_present" do
|
17
12
|
before do
|
18
13
|
expect(dummy_class).to receive(:presenter).and_return(presenter)
|
19
14
|
end
|
20
15
|
|
21
|
-
context
|
22
|
-
it
|
23
|
-
expect(dummy_class.geoblacklight_present(:
|
16
|
+
context "as a Symbol" do
|
17
|
+
it "calls defined presenter class" do
|
18
|
+
expect(dummy_class.geoblacklight_present(:index_fields_display)).to eq "druid:abc123"
|
24
19
|
end
|
25
20
|
end
|
26
|
-
context
|
27
|
-
it
|
28
|
-
expect(dummy_class.geoblacklight_present(
|
21
|
+
context "as a String" do
|
22
|
+
it "calls defined presenter class" do
|
23
|
+
expect(dummy_class.geoblacklight_present("index_fields_display")).to eq "druid:abc123"
|
29
24
|
end
|
30
25
|
end
|
31
26
|
end
|