geoblacklight 4.0.0 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +23 -8
- data/.gitignore +3 -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/javascripts/geoblacklight/basemaps.js +1 -1
- 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 +47 -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/_citation.html.erb +35 -10
- 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.gbl_v1.yml +2 -2
- data/lib/generators/geoblacklight/templates/settings.yml +76 -24
- 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 +14 -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 +12 -7
- 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/citations_spec.rb +12 -0
- 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 +12 -9
- data/spec/features/tms_spec.rb +6 -5
- data/spec/features/web_services_modal_spec.rb +39 -38
- data/spec/features/wmts_spec.rb +20 -17
- data/spec/features/xyz_spec.rb +6 -5
- data/spec/fixtures/manifests/tilejson.json +1 -1
- data/spec/fixtures/manifests/wmts-single.xml +5 -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 +3 -3
- 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 +7 -7
- 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 +35 -38
- 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 +40 -216
- 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
- /data/app/assets/images/blacklight/{berkeley.svg → university-of-california-berkeley.svg} +0 -0
@@ -1,13 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
2
|
+
|
3
|
+
require "spec_helper"
|
3
4
|
|
4
5
|
describe WmsController, type: :controller do
|
5
6
|
let(:wms_layer) { instance_double(Geoblacklight::WmsLayer) }
|
6
|
-
let(:feature_info) { {
|
7
|
+
let(:feature_info) { {values: ["fid", "layer:example"]} }
|
7
8
|
let(:params) do
|
8
|
-
{
|
9
|
-
|
10
|
-
|
9
|
+
{"format" => "json", "URL" => "http://www.example.com/", "LAYERS" => "layer:example",
|
10
|
+
"BBOX" => "-74, 40, -68, 43", "WIDTH" => "500", "HEIGHT" => "400",
|
11
|
+
"QUERY_LAYERS" => "layer:example", "X" => "277", "Y" => "195"}
|
11
12
|
end
|
12
13
|
|
13
14
|
before do
|
@@ -15,17 +16,17 @@ describe WmsController, type: :controller do
|
|
15
16
|
allow(wms_layer).to receive(:feature_info).and_return(feature_info)
|
16
17
|
end
|
17
18
|
|
18
|
-
describe
|
19
|
-
it
|
19
|
+
describe "#handle" do
|
20
|
+
it "returns feature info as json" do
|
20
21
|
get :handle, params: params
|
21
22
|
expect(response.body).to eq(feature_info.to_json)
|
22
23
|
end
|
23
24
|
end
|
24
25
|
|
25
|
-
describe
|
26
|
+
describe "#wms_params" do
|
26
27
|
let(:wms_params) { controller.instance_eval { wms_params } }
|
27
28
|
|
28
|
-
it
|
29
|
+
it "returns only permitted params" do
|
29
30
|
get :handle, params: params
|
30
31
|
expect(wms_params.to_h).to eq(params)
|
31
32
|
end
|
data/spec/factories/user.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
FactoryBot.define do
|
3
4
|
factory :user do
|
4
5
|
sequence(:email) { |n| "user#{n}@example.com" }
|
5
|
-
password {
|
6
|
-
password_confirmation {
|
6
|
+
password { "password" }
|
7
|
+
password_confirmation { "password" }
|
7
8
|
end
|
8
9
|
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require 'spec_helper'
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
require "spec_helper"
|
4
|
+
|
5
|
+
feature "Blacklight Bookmarks" do
|
6
|
+
scenario "index has created bookmarks" do
|
7
|
+
visit solr_document_path "nyu-2451-34564"
|
8
|
+
click_button "Bookmark"
|
8
9
|
visit bookmarks_path
|
9
|
-
expect(page).to have_css
|
10
|
+
expect(page).to have_css ".document", count: 1
|
10
11
|
end
|
11
12
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "spec_helper"
|
4
|
+
|
5
|
+
feature "Blacklight Citation" do
|
6
|
+
scenario "index has created citations" do
|
7
|
+
sign_in
|
8
|
+
visit "/catalog/princeton-1r66j405w"
|
9
|
+
click_link "Cite"
|
10
|
+
expect(page).to have_text "Copy Citation"
|
11
|
+
end
|
12
|
+
end
|
@@ -1,34 +1,35 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require 'spec_helper'
|
3
2
|
|
4
|
-
|
5
|
-
|
3
|
+
require "spec_helper"
|
4
|
+
|
5
|
+
feature "Configurable basemap", js: true do
|
6
|
+
scenario "defaults to positron" do
|
6
7
|
visit root_path
|
7
8
|
expect(page).to have_css "img[src*='carto']"
|
8
9
|
end
|
9
|
-
feature
|
10
|
+
feature "without provided basemap config" do
|
10
11
|
before do
|
11
12
|
CatalogController.blacklight_config.basemap_provider = nil
|
12
13
|
end
|
13
|
-
scenario
|
14
|
+
scenario "has Carto map" do
|
14
15
|
visit root_path
|
15
16
|
expect(page).to have_css "img[src*='carto']"
|
16
17
|
end
|
17
18
|
end
|
18
|
-
feature
|
19
|
+
feature "using darkMatter" do
|
19
20
|
before do
|
20
|
-
CatalogController.blacklight_config.basemap_provider =
|
21
|
+
CatalogController.blacklight_config.basemap_provider = "darkMatter"
|
21
22
|
end
|
22
|
-
scenario
|
23
|
+
scenario "has darkMatter map" do
|
23
24
|
visit root_path
|
24
25
|
expect(page).to have_css "img[src*='dark_all']"
|
25
26
|
end
|
26
27
|
end
|
27
|
-
feature
|
28
|
+
feature "using openstreetmapHot" do
|
28
29
|
before do
|
29
|
-
CatalogController.blacklight_config.basemap_provider =
|
30
|
+
CatalogController.blacklight_config.basemap_provider = "openstreetmapHot"
|
30
31
|
end
|
31
|
-
scenario
|
32
|
+
scenario "has openstreetmapHot map" do
|
32
33
|
visit root_path
|
33
34
|
expect(page).to have_css "img[src*='hot']"
|
34
35
|
end
|
@@ -1,17 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require 'spec_helper'
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
require "spec_helper"
|
4
|
+
|
5
|
+
feature "Data dictionary download tool" do
|
6
|
+
feature "when data_dictionary reference present" do
|
7
|
+
scenario "shows up in tools" do
|
8
|
+
visit solr_document_path "nyu_2451_34502"
|
9
|
+
expect(page).to have_css "li.data_dictionary a", text: "Documentation"
|
9
10
|
end
|
10
11
|
end
|
11
|
-
feature
|
12
|
-
scenario
|
13
|
-
visit solr_document_path
|
14
|
-
expect(page).not_to have_css
|
12
|
+
feature "when data_dictionary reference absent" do
|
13
|
+
scenario "download tool is not rendered" do
|
14
|
+
visit solr_document_path "stanford-cg357zz0321"
|
15
|
+
expect(page).not_to have_css "li.data_dictionary a", text: "Documentation"
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
@@ -1,7 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require 'spec_helper'
|
3
2
|
|
4
|
-
|
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
|
14
|
-
expect(shapefile_download).to receive(:get).and_return(
|
15
|
-
visit solr_document_path(
|
16
|
-
find(
|
17
|
-
find('a[data-download-type="shapefile"]', text:
|
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:
|
21
|
+
text: "Your file mit-f6rqs4ucovjk2-shapefile.zip is ready for download"
|
21
22
|
)
|
22
23
|
end
|
23
24
|
|
24
|
-
scenario
|
25
|
-
expect(shapefile_download).to receive(:get).and_raise(Geoblacklight::Exceptions::ExternalDownloadFailed.new(message:
|
26
|
-
visit solr_document_path(
|
27
|
-
find(
|
28
|
-
find('#downloads-collapse a[data-download-type="shapefile"]', text:
|
29
|
-
expect(page).to have_css
|
30
|
-
expect(page).to have_css
|
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
|
34
|
-
expect(kmz_download).to receive(:get).and_return(
|
35
|
-
visit solr_document_path(
|
36
|
-
find(
|
37
|
-
find('#downloads-collapse a[data-download-type="kmz"]', text:
|
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:
|
41
|
+
text: "Your file mit-f6rqs4ucovjk2-kmz.kmz is ready for download"
|
41
42
|
)
|
42
43
|
end
|
43
44
|
|
44
|
-
scenario
|
45
|
-
visit solr_document_path(
|
46
|
-
find(
|
47
|
-
expect(page).to have_css(
|
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
|
51
|
-
visit solr_document_path(
|
52
|
-
find(
|
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:
|
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
|
57
|
-
visit solr_document_path(
|
58
|
-
find(
|
59
|
-
expect(page).to have_css('#downloads-collapse a[data-download-type="shapefile"]', text:
|
60
|
-
expect(page).to have_css('#downloads-collapse a[data-download-type="kmz"]', text:
|
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
|
64
|
-
visit solr_document_path(
|
65
|
-
expect(page).to have_css
|
66
|
-
expect(page).not_to have_css
|
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
|
70
|
+
scenario "restricted layer should have download available to logged in user" do
|
70
71
|
sign_in
|
71
|
-
visit solr_document_path(
|
72
|
-
expect(page).not_to have_css
|
73
|
-
expect(page).to have_css
|
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
|
77
|
+
scenario "layer with direct download and wms/wfs should include all download types" do
|
77
78
|
sign_in
|
78
|
-
visit solr_document_path(
|
79
|
-
find(
|
80
|
-
expect(page).to have_css(
|
81
|
-
expect(page).to have_css(
|
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
|
85
|
-
visit solr_document_path(
|
86
|
-
find(
|
87
|
-
find('a[data-download-type="harvard-hgl"]', text:
|
88
|
-
expect(page).to have_css(
|
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
|
92
|
+
context "with a successful request to the server" do
|
92
93
|
let(:hgl_download) { instance_double(Geoblacklight::HglDownload) }
|
93
94
|
|
94
|
-
xscenario
|
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(
|
97
|
-
find(
|
98
|
-
find('a[data-download-type="harvard-hgl"]', text:
|
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(
|
102
|
+
allow(hgl_download).to receive(:get).and_return("success")
|
102
103
|
|
103
|
-
within
|
104
|
-
fill_in(
|
105
|
-
click_button(
|
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(
|
108
|
-
expect(page).to have_content(
|
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
|
-
|
3
|
+
require "spec_helper"
|
4
|
+
|
5
|
+
feature "Empty search" do
|
5
6
|
before do
|
6
7
|
visit root_path
|
7
8
|
end
|
8
|
-
scenario
|
9
|
-
click_button
|
10
|
-
expect(page).to have_css
|
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
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
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
|
12
|
-
skip
|
13
|
-
visit solr_document_path
|
14
|
-
expect(page).to have_css
|
15
|
-
expect(page).to have_css
|
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
|
18
|
-
skip
|
19
|
-
visit solr_document_path
|
20
|
-
expect(page).to have_css
|
21
|
-
expect(page).to have_css
|
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
|
24
|
-
pending
|
25
|
-
visit solr_document_path
|
26
|
-
expect(page).to have_css
|
27
|
-
expect(Nokogiri::HTML.parse(page.body).css(
|
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
|
31
|
-
skip
|
32
|
-
visit solr_document_path
|
33
|
-
expect(page).to have_css
|
34
|
-
expect(page).to have_css
|
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
|
37
|
-
skip
|
38
|
-
visit solr_document_path
|
39
|
-
expect(page).to have_css
|
40
|
-
expect(page).to have_css
|
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
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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
|
15
|
-
feature
|
16
|
-
scenario
|
17
|
-
visit solr_document_path
|
18
|
-
expect(page).to have_css
|
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
|
23
|
-
scenario
|
24
|
-
visit solr_document_path
|
25
|
-
expect(page).not_to have_css
|
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
|
3
|
+
require "spec_helper"
|
4
4
|
|
5
|
-
feature
|
6
|
-
scenario
|
7
|
-
visit solr_document_path(
|
8
|
-
expect(page).to have_css(
|
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
|
12
|
-
visit solr_document_path(
|
13
|
-
expect(page).to have_css(
|
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
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
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
|
-
|
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
|
9
|
-
expect(page).to have_css
|
10
|
-
expect(page).to have_css
|
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
|
13
|
-
expect(page).not_to have_css
|
14
|
-
within
|
15
|
-
expect(page).to have_css
|
16
|
-
expect(page).to have_css
|
17
|
-
expect(page).to have_css
|
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
|
21
|
-
expect(page).to have_css
|
22
|
-
expect(page).to have_css
|
23
|
-
expect(page).to have_css
|
24
|
-
click_link
|
25
|
-
expect(page).to have_css
|
26
|
-
expect(page).to have_css
|
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
|
29
|
-
within
|
30
|
-
expect(page).to have_css(
|
31
|
-
expect(page).to have_css(
|
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
|
35
|
-
within
|
36
|
-
find(
|
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
|
40
|
+
expect(page).to have_css "#documents"
|
40
41
|
end
|
41
|
-
scenario
|
42
|
-
click_link
|
43
|
-
results = page.all(:css,
|
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
|