geoblacklight 2.3.0
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 +7 -0
- data/.circleci/config.yml +195 -0
- data/.github/ISSUE_TEMPLATE.md +17 -0
- data/.gitignore +21 -0
- data/.gitmodules +0 -0
- data/.hound.yml +8 -0
- data/.jshintignore +2 -0
- data/.jshintrc +67 -0
- data/.rubocop.yml +99 -0
- data/.rubocop_todo.yml +196 -0
- data/.solr_wrapper +5 -0
- data/CODE_OF_CONDUCT.md +76 -0
- data/CONTRIBUTING.md +49 -0
- data/Gemfile +39 -0
- data/LICENSE.txt +13 -0
- data/README.md +39 -0
- data/Rakefile +125 -0
- data/app/assets/images/blacklight/arrow-circle-down.svg +4 -0
- data/app/assets/images/blacklight/baruch-cuny.svg +6 -0
- data/app/assets/images/blacklight/berkeley.svg +7 -0
- data/app/assets/images/blacklight/book.svg +6 -0
- data/app/assets/images/blacklight/bookmark.svg +6 -0
- data/app/assets/images/blacklight/cd-rom.svg +6 -0
- data/app/assets/images/blacklight/chicago.svg +7 -0
- data/app/assets/images/blacklight/columbia.svg +6 -0
- data/app/assets/images/blacklight/cornell.svg +8 -0
- data/app/assets/images/blacklight/dvd-rom.svg +6 -0
- data/app/assets/images/blacklight/email.svg +6 -0
- data/app/assets/images/blacklight/esri-globe.svg +34 -0
- data/app/assets/images/blacklight/geoblacklight-icons.json +2079 -0
- data/app/assets/images/blacklight/globe.svg +4 -0
- data/app/assets/images/blacklight/harvard.svg +6 -0
- data/app/assets/images/blacklight/home.svg +4 -0
- data/app/assets/images/blacklight/illinois.svg +7 -0
- data/app/assets/images/blacklight/image.svg +6 -0
- data/app/assets/images/blacklight/indiana.svg +6 -0
- data/app/assets/images/blacklight/iowa.svg +6 -0
- data/app/assets/images/blacklight/leaf.svg +6 -0
- data/app/assets/images/blacklight/lewis-clark.svg +8 -0
- data/app/assets/images/blacklight/line.svg +7 -0
- data/app/assets/images/blacklight/logo.svg +1 -0
- data/app/assets/images/blacklight/map-marker.svg +6 -0
- data/app/assets/images/blacklight/map.svg +6 -0
- data/app/assets/images/blacklight/maryland.svg +6 -0
- data/app/assets/images/blacklight/massgis.svg +6 -0
- data/app/assets/images/blacklight/metadata.svg +6 -0
- data/app/assets/images/blacklight/michigan-state.svg +7 -0
- data/app/assets/images/blacklight/michigan.svg +6 -0
- data/app/assets/images/blacklight/minnesota.svg +6 -0
- data/app/assets/images/blacklight/mit.svg +6 -0
- data/app/assets/images/blacklight/mixed.svg +8 -0
- data/app/assets/images/blacklight/multilinestring.svg +9 -0
- data/app/assets/images/blacklight/multipoint.svg +6 -0
- data/app/assets/images/blacklight/multipolygon.svg +9 -0
- data/app/assets/images/blacklight/nyu.svg +9 -0
- data/app/assets/images/blacklight/ohio-state.svg +8 -0
- data/app/assets/images/blacklight/pagelines-brands.svg +6 -0
- data/app/assets/images/blacklight/paper-map.svg +6 -0
- data/app/assets/images/blacklight/penn-state.svg +7 -0
- data/app/assets/images/blacklight/point.svg +6 -0
- data/app/assets/images/blacklight/polygon.svg +7 -0
- data/app/assets/images/blacklight/polyline.svg +9 -0
- data/app/assets/images/blacklight/princeton.svg +6 -0
- data/app/assets/images/blacklight/public.svg +6 -0
- data/app/assets/images/blacklight/purdue.svg +7 -0
- data/app/assets/images/blacklight/raster.svg +6 -0
- data/app/assets/images/blacklight/restricted.svg +6 -0
- data/app/assets/images/blacklight/sms.svg +6 -0
- data/app/assets/images/blacklight/stanford.svg +6 -0
- data/app/assets/images/blacklight/table.svg +6 -0
- data/app/assets/images/blacklight/tags.svg +4 -0
- data/app/assets/images/blacklight/texas.svg +6 -0
- data/app/assets/images/blacklight/tufts.svg +6 -0
- data/app/assets/images/blacklight/ucla.svg +6 -0
- data/app/assets/images/blacklight/uva.svg +6 -0
- data/app/assets/images/blacklight/web_services.svg +6 -0
- data/app/assets/images/blacklight/wisconsin.svg +6 -0
- data/app/assets/javascripts/geoblacklight/basemaps.js +85 -0
- data/app/assets/javascripts/geoblacklight/controls.js +1 -0
- data/app/assets/javascripts/geoblacklight/controls/opacity.js +6 -0
- data/app/assets/javascripts/geoblacklight/downloaders.js +1 -0
- data/app/assets/javascripts/geoblacklight/downloaders/downloader.js +61 -0
- data/app/assets/javascripts/geoblacklight/downloaders/hgl_downloader.js +32 -0
- data/app/assets/javascripts/geoblacklight/geoblacklight.js +42 -0
- data/app/assets/javascripts/geoblacklight/modules.js +1 -0
- data/app/assets/javascripts/geoblacklight/modules/collapse.js +7 -0
- data/app/assets/javascripts/geoblacklight/modules/download.js +11 -0
- data/app/assets/javascripts/geoblacklight/modules/geosearch.js +133 -0
- data/app/assets/javascripts/geoblacklight/modules/help_text.js +7 -0
- data/app/assets/javascripts/geoblacklight/modules/home.js +16 -0
- data/app/assets/javascripts/geoblacklight/modules/item.js +13 -0
- data/app/assets/javascripts/geoblacklight/modules/layer_opacity.js +68 -0
- data/app/assets/javascripts/geoblacklight/modules/metadata.js +15 -0
- data/app/assets/javascripts/geoblacklight/modules/metadata_download_button.js +53 -0
- data/app/assets/javascripts/geoblacklight/modules/relations.js +14 -0
- data/app/assets/javascripts/geoblacklight/modules/results.js +82 -0
- data/app/assets/javascripts/geoblacklight/modules/util.js +38 -0
- data/app/assets/javascripts/geoblacklight/templates/index_map_download.hbs +19 -0
- data/app/assets/javascripts/geoblacklight/templates/index_map_info.hbs +40 -0
- data/app/assets/javascripts/geoblacklight/viewers.js +1 -0
- data/app/assets/javascripts/geoblacklight/viewers/esri.js +77 -0
- data/app/assets/javascripts/geoblacklight/viewers/esri/dynamic_map_layer.js +85 -0
- data/app/assets/javascripts/geoblacklight/viewers/esri/feature_layer.js +76 -0
- data/app/assets/javascripts/geoblacklight/viewers/esri/image_map_layer.js +14 -0
- data/app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js +50 -0
- data/app/assets/javascripts/geoblacklight/viewers/iiif.js +25 -0
- data/app/assets/javascripts/geoblacklight/viewers/index_map.js +70 -0
- data/app/assets/javascripts/geoblacklight/viewers/map.js +67 -0
- data/app/assets/javascripts/geoblacklight/viewers/oembed.js +13 -0
- data/app/assets/javascripts/geoblacklight/viewers/viewer.js +65 -0
- data/app/assets/javascripts/geoblacklight/viewers/wms.js +74 -0
- data/app/assets/stylesheets/geoblacklight/_blacklight_overrides.scss +51 -0
- data/app/assets/stylesheets/geoblacklight/_geoblacklight.scss +36 -0
- data/app/assets/stylesheets/geoblacklight/_styles.scss +4 -0
- data/app/assets/stylesheets/geoblacklight/application.scss +2 -0
- data/app/assets/stylesheets/geoblacklight/modules/downloads.scss +93 -0
- data/app/assets/stylesheets/geoblacklight/modules/facets.scss +5 -0
- data/app/assets/stylesheets/geoblacklight/modules/geosearch.scss +29 -0
- data/app/assets/stylesheets/geoblacklight/modules/home.scss +28 -0
- data/app/assets/stylesheets/geoblacklight/modules/icon-customization.scss +50 -0
- data/app/assets/stylesheets/geoblacklight/modules/index_maps.scss +7 -0
- data/app/assets/stylesheets/geoblacklight/modules/item.scss +26 -0
- data/app/assets/stylesheets/geoblacklight/modules/layer_opacity.scss +87 -0
- data/app/assets/stylesheets/geoblacklight/modules/metadata.scss +31 -0
- data/app/assets/stylesheets/geoblacklight/modules/metadata_content.scss +43 -0
- data/app/assets/stylesheets/geoblacklight/modules/metadata_markup.scss +9 -0
- data/app/assets/stylesheets/geoblacklight/modules/metadata_missing.scss +7 -0
- data/app/assets/stylesheets/geoblacklight/modules/mixins.scss +5 -0
- data/app/assets/stylesheets/geoblacklight/modules/modal.scss +14 -0
- data/app/assets/stylesheets/geoblacklight/modules/relations.scss +15 -0
- data/app/assets/stylesheets/geoblacklight/modules/results.scss +68 -0
- data/app/assets/stylesheets/geoblacklight/modules/search_widgets.scss +5 -0
- data/app/assets/stylesheets/geoblacklight/modules/sidebar.scss +60 -0
- data/app/assets/stylesheets/geoblacklight/modules/toolbar.scss +70 -0
- data/app/assets/stylesheets/geoblacklight/modules/web_services.scss +5 -0
- data/app/controllers/download_controller.rb +114 -0
- data/app/controllers/relation_controller.rb +20 -0
- data/app/controllers/wms_controller.rb +15 -0
- data/app/helpers/arcgis_helper.rb +12 -0
- data/app/helpers/blacklight_helper.rb +9 -0
- data/app/helpers/carto_helper.rb +29 -0
- data/app/helpers/geoblacklight_helper.rb +323 -0
- data/app/models/concerns/geoblacklight/solr_document.rb +113 -0
- data/app/models/concerns/geoblacklight/solr_document/arcgis.rb +10 -0
- data/app/models/concerns/geoblacklight/solr_document/carto.rb +28 -0
- data/app/models/concerns/geoblacklight/solr_document/finder.rb +38 -0
- data/app/models/concerns/geoblacklight/solr_document/inspection.rb +15 -0
- data/app/models/concerns/geoblacklight/spatial_search_behavior.rb +69 -0
- data/app/presenters/geoblacklight/document_presenter.rb +23 -0
- data/app/views/catalog/_data_dictionary.html.erb +6 -0
- data/app/views/catalog/_document_action.html.erb +6 -0
- data/app/views/catalog/_document_split.html.erb +6 -0
- data/app/views/catalog/_download_generated_link.html.erb +4 -0
- data/app/views/catalog/_download_link.html.erb +3 -0
- data/app/views/catalog/_downloads_generated.html.erb +6 -0
- data/app/views/catalog/_downloads_primary.html.erb +14 -0
- data/app/views/catalog/_downloads_secondary.html.erb +39 -0
- data/app/views/catalog/_exports.html.erb +3 -0
- data/app/views/catalog/_facet_tag_item.html.erb +3 -0
- data/app/views/catalog/_facet_tag_layout.html.erb +2 -0
- data/app/views/catalog/_header_icons.html.erb +3 -0
- data/app/views/catalog/_home_text.html.erb +43 -0
- data/app/views/catalog/_icon_facet.html.erb +16 -0
- data/app/views/catalog/_index_split_default.html.erb +22 -0
- data/app/views/catalog/_metadata.html.erb +27 -0
- data/app/views/catalog/_relations_container.html.erb +1 -0
- data/app/views/catalog/_results_pagination.html.erb +12 -0
- data/app/views/catalog/_show_default_attribute_table.html.erb +19 -0
- data/app/views/catalog/_show_default_viewer_container.html.erb +12 -0
- data/app/views/catalog/_show_default_viewer_information.html.erb +4 -0
- data/app/views/catalog/_show_downloads.html.erb +34 -0
- data/app/views/catalog/_show_header_default.html.erb +4 -0
- data/app/views/catalog/_show_sidebar.html.erb +12 -0
- data/app/views/catalog/_show_tools.html.erb +25 -0
- data/app/views/catalog/_web_services.html.erb +8 -0
- data/app/views/catalog/_web_services_default.html.erb +8 -0
- data/app/views/catalog/_web_services_wfs.html.erb +8 -0
- data/app/views/catalog/_web_services_wms.html.erb +8 -0
- data/app/views/catalog/index.html.erb +13 -0
- data/app/views/catalog/metadata.html.erb +11 -0
- data/app/views/catalog/metadata/_content.html.erb +3 -0
- data/app/views/catalog/metadata/_markup.html.erb +8 -0
- data/app/views/catalog/metadata/_missing.html.erb +6 -0
- data/app/views/catalog/web_services.html.erb +10 -0
- data/app/views/download/hgl.html.erb +25 -0
- data/app/views/relation/_ancestors.html.erb +11 -0
- data/app/views/relation/_descendants.html.erb +18 -0
- data/app/views/relation/index.html.erb +13 -0
- data/app/views/relation/index.json.jbuilder +3 -0
- data/app/views/shared/_header_navbar.html.erb +38 -0
- data/config/initializers/rails_config.rb +3 -0
- data/config/locales/geoblacklight.en.yml +163 -0
- data/geoblacklight.gemspec +49 -0
- data/lib/generators/geoblacklight/install_generator.rb +105 -0
- data/lib/generators/geoblacklight/templates/Procfile +3 -0
- data/lib/generators/geoblacklight/templates/catalog_controller.rb +272 -0
- data/lib/generators/geoblacklight/templates/geoblacklight.js +10 -0
- data/lib/generators/geoblacklight/templates/geoblacklight.scss +4 -0
- data/lib/generators/geoblacklight/templates/package.json +14 -0
- data/lib/generators/geoblacklight/templates/settings.yml +127 -0
- data/lib/generators/geoblacklight/templates/webpacker.yml +67 -0
- data/lib/generators/geoblacklight/webpacker_generator.rb +35 -0
- data/lib/geoblacklight.rb +50 -0
- data/lib/geoblacklight/bounding_box.rb +45 -0
- data/lib/geoblacklight/catalog_helper_override.rb +13 -0
- data/lib/geoblacklight/constants.rb +28 -0
- data/lib/geoblacklight/download.rb +108 -0
- data/lib/geoblacklight/download/geojson_download.rb +22 -0
- data/lib/geoblacklight/download/geotiff_download.rb +20 -0
- data/lib/geoblacklight/download/hgl_download.rb +18 -0
- data/lib/geoblacklight/download/kmz_download.rb +22 -0
- data/lib/geoblacklight/download/shapefile_download.rb +20 -0
- data/lib/geoblacklight/engine.rb +27 -0
- data/lib/geoblacklight/exceptions.rb +27 -0
- data/lib/geoblacklight/geoblacklight_helper_behavior.rb +14 -0
- data/lib/geoblacklight/item_viewer.rb +54 -0
- data/lib/geoblacklight/metadata.rb +18 -0
- data/lib/geoblacklight/metadata/base.rb +93 -0
- data/lib/geoblacklight/metadata/fgdc.rb +14 -0
- data/lib/geoblacklight/metadata/html.rb +13 -0
- data/lib/geoblacklight/metadata/iso19139.rb +14 -0
- data/lib/geoblacklight/metadata_transformer.rb +33 -0
- data/lib/geoblacklight/metadata_transformer/base.rb +42 -0
- data/lib/geoblacklight/metadata_transformer/fgdc.rb +8 -0
- data/lib/geoblacklight/metadata_transformer/iso19139.rb +8 -0
- data/lib/geoblacklight/reference.rb +45 -0
- data/lib/geoblacklight/references.rb +132 -0
- data/lib/geoblacklight/relation/ancestors.rb +27 -0
- data/lib/geoblacklight/relation/descendants.rb +27 -0
- data/lib/geoblacklight/relation/relation_response.rb +24 -0
- data/lib/geoblacklight/routes.rb +7 -0
- data/lib/geoblacklight/routes/downloadable.rb +14 -0
- data/lib/geoblacklight/routes/exportable.rb +17 -0
- data/lib/geoblacklight/routes/wms.rb +13 -0
- data/lib/geoblacklight/version.rb +3 -0
- data/lib/geoblacklight/view_helper_override.rb +40 -0
- data/lib/geoblacklight/wms_layer.rb +35 -0
- data/lib/geoblacklight/wms_layer/feature_info_response.rb +32 -0
- data/lib/tasks/geoblacklight.rake +108 -0
- data/package.json +4 -0
- data/schema/format-values.md +50 -0
- data/schema/geoblacklight-schema-deprecated.md +39 -0
- data/schema/geoblacklight-schema.json +214 -0
- data/schema/geoblacklight-schema.md +323 -0
- data/schema/geometry-type-values.md +11 -0
- data/schema/references.md +23 -0
- data/schema/schema-commentary.md +198 -0
- data/schema/subjects.md +41 -0
- data/schema/type-values.md +10 -0
- data/solr/conf/_rest_managed.json +3 -0
- data/solr/conf/admin-extra.html +31 -0
- data/solr/conf/core.properties +5 -0
- data/solr/conf/elevate.xml +36 -0
- data/solr/conf/mapping-ISOLatin1Accent.txt +246 -0
- data/solr/conf/protwords.txt +21 -0
- data/solr/conf/schema.xml +198 -0
- data/solr/conf/scripts.conf +24 -0
- data/solr/conf/solrconfig.xml +243 -0
- data/solr/conf/spellings.txt +2 -0
- data/solr/conf/stopwords.txt +58 -0
- data/solr/conf/stopwords_en.txt +58 -0
- data/solr/conf/synonyms.txt +31 -0
- data/solr/conf/xslt/example.xsl +132 -0
- data/solr/conf/xslt/example_atom.xsl +67 -0
- data/solr/conf/xslt/example_rss.xsl +66 -0
- data/solr/conf/xslt/luke.xsl +337 -0
- data/spec/controllers/catalog_controller_spec.rb +82 -0
- data/spec/controllers/download_controller_spec.rb +120 -0
- data/spec/controllers/relation_controller_spec.rb +11 -0
- data/spec/controllers/wms_controller_spec.rb +34 -0
- data/spec/factories/user.rb +7 -0
- data/spec/features/bookmarks_spec.rb +10 -0
- data/spec/features/configurable_basemap_spec.rb +35 -0
- data/spec/features/data_dictionary_download_spec.rb +16 -0
- data/spec/features/download_layer_spec.rb +93 -0
- data/spec/features/empty_search_spec.rb +11 -0
- data/spec/features/esri_viewer_spec.rb +42 -0
- data/spec/features/exports_spec.rb +36 -0
- data/spec/features/help_text_spec.rb +8 -0
- data/spec/features/home_page_spec.rb +40 -0
- data/spec/features/iiif_viewer_spec.rb +8 -0
- data/spec/features/index_map_spec.rb +31 -0
- data/spec/features/layer_inspection_spec.rb +10 -0
- data/spec/features/layer_opacity_spec.rb +20 -0
- data/spec/features/layer_preview_spec.rb +17 -0
- data/spec/features/layer_with_no_references_spec.rb +8 -0
- data/spec/features/linkified_attribute_table_spec.rb +11 -0
- data/spec/features/metadata_panel_spec.rb +78 -0
- data/spec/features/missing_metadata_spec.rb +24 -0
- data/spec/features/oembed_spec.rb +9 -0
- data/spec/features/relations_spec.rb +51 -0
- data/spec/features/saved_searches_spec.rb +13 -0
- data/spec/features/search_bar_spec.rb +12 -0
- data/spec/features/search_results_map_spec.rb +55 -0
- data/spec/features/search_results_overlap_ratio_spec.rb +55 -0
- data/spec/features/search_spec.rb +14 -0
- data/spec/features/show_page_metadata_spec.rb +12 -0
- data/spec/features/sms_spec.rb +15 -0
- data/spec/features/split_view.html.erb_spec.rb +75 -0
- data/spec/features/suppressed_records_spec.rb +14 -0
- data/spec/features/web_services_modal_spec.rb +25 -0
- data/spec/fixtures/fgdc/harvard-g7064-s2-1834-k3.xml +1 -0
- data/spec/fixtures/iso19139/stanford-cg357zz0321.xml +581 -0
- data/spec/fixtures/mods/fb897vt9938.mods +111 -0
- data/spec/fixtures/mods/stanford-cg357zz0321.mods +113 -0
- data/spec/fixtures/solr_documents/README.md +40 -0
- data/spec/fixtures/solr_documents/actual-papermap1.json +23 -0
- data/spec/fixtures/solr_documents/actual-point1.json +37 -0
- data/spec/fixtures/solr_documents/actual-polygon1.json +23 -0
- data/spec/fixtures/solr_documents/actual-raster1.json +38 -0
- data/spec/fixtures/solr_documents/baruch_ancestor1.json +46 -0
- data/spec/fixtures/solr_documents/baruch_ancestor2.json +46 -0
- data/spec/fixtures/solr_documents/baruch_documentation_download.json +49 -0
- data/spec/fixtures/solr_documents/bbox-spans-180.json +20 -0
- data/spec/fixtures/solr_documents/cornell_html_metadata.json +42 -0
- data/spec/fixtures/solr_documents/esri-dynamic-layer-all-layers.json +38 -0
- data/spec/fixtures/solr_documents/esri-dynamic-layer-single-layer.json +40 -0
- data/spec/fixtures/solr_documents/esri-feature-layer.json +46 -0
- data/spec/fixtures/solr_documents/esri-image-map-layer.json +42 -0
- data/spec/fixtures/solr_documents/esri-tiled_map_layer.json +22 -0
- data/spec/fixtures/solr_documents/esri-wms-layer.json +33 -0
- data/spec/fixtures/solr_documents/harvard_raster.json +44 -0
- data/spec/fixtures/solr_documents/iiif-eastern-hemisphere.json +30 -0
- data/spec/fixtures/solr_documents/index-map-polygon-no-downloadurl.json +37 -0
- data/spec/fixtures/solr_documents/index-map-polygon.json +37 -0
- data/spec/fixtures/solr_documents/index-map-stanford.json +37 -0
- data/spec/fixtures/solr_documents/index_map_point.json +27 -0
- data/spec/fixtures/solr_documents/metadata_no_dct_provenance_s.json +30 -0
- data/spec/fixtures/solr_documents/metadata_no_layer_geom_type_s.json +17 -0
- data/spec/fixtures/solr_documents/metadata_no_solr_geom.json +23 -0
- data/spec/fixtures/solr_documents/no_spatial.json +21 -0
- data/spec/fixtures/solr_documents/oembed.json +24 -0
- data/spec/fixtures/solr_documents/princeton-child1.json +30 -0
- data/spec/fixtures/solr_documents/princeton-child2.json +30 -0
- data/spec/fixtures/solr_documents/princeton-child3.json +30 -0
- data/spec/fixtures/solr_documents/princeton-child4.json +30 -0
- data/spec/fixtures/solr_documents/princeton-parent.json +25 -0
- data/spec/fixtures/solr_documents/public_direct_download.json +34 -0
- data/spec/fixtures/solr_documents/public_iiif_princeton.json +36 -0
- data/spec/fixtures/solr_documents/public_polygon_mit.json +27 -0
- data/spec/fixtures/solr_documents/restricted-line.json +37 -0
- data/spec/fixtures/solr_documents/umn_metro_result1.json +41 -0
- data/spec/fixtures/solr_documents/umn_state_result1.json +38 -0
- data/spec/fixtures/solr_documents/umn_state_result2.json +38 -0
- data/spec/fixtures/solr_documents/uva_slug_colon.json +25 -0
- data/spec/helpers/arcgis_helper_spec.rb +14 -0
- data/spec/helpers/carto_helper_spec.rb +11 -0
- data/spec/helpers/geoblacklight_helper_spec.rb +329 -0
- data/spec/javascripts/geoblacklight_spec.js +21 -0
- data/spec/javascripts/metadata_download_button_spec.js +14 -0
- data/spec/javascripts/spec_helper.js +32 -0
- data/spec/javascripts/util_spec.js +12 -0
- data/spec/lib/geoblacklight/bounding_box_spec.rb +27 -0
- data/spec/lib/geoblacklight/controller_override_spec.rb +1 -0
- data/spec/lib/geoblacklight/document_presenter_spec.rb +61 -0
- data/spec/lib/geoblacklight/download/geojson_download_spec.rb +19 -0
- data/spec/lib/geoblacklight/download/geotiff_download_spec.rb +20 -0
- data/spec/lib/geoblacklight/download/hgl_download_spec.rb +60 -0
- data/spec/lib/geoblacklight/download/kmz_download_spec.rb +20 -0
- data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +19 -0
- data/spec/lib/geoblacklight/download_spec.rb +177 -0
- data/spec/lib/geoblacklight/geoblacklight_helper_behavior_spec.rb +30 -0
- data/spec/lib/geoblacklight/item_viewer_spec.rb +63 -0
- data/spec/lib/geoblacklight/metadata/base_spec.rb +157 -0
- data/spec/lib/geoblacklight/metadata/html_spec.rb +18 -0
- data/spec/lib/geoblacklight/metadata_spec.rb +42 -0
- data/spec/lib/geoblacklight/metadata_transformer/base_spec.rb +35 -0
- data/spec/lib/geoblacklight/metadata_transformer/fgdc_spec.rb +23 -0
- data/spec/lib/geoblacklight/metadata_transformer/iso19139_spec.rb +23 -0
- data/spec/lib/geoblacklight/metadata_transformer_spec.rb +69 -0
- data/spec/lib/geoblacklight/reference_spec.rb +64 -0
- data/spec/lib/geoblacklight/references_spec.rb +216 -0
- data/spec/lib/geoblacklight/relation/ancestors_spec.rb +32 -0
- data/spec/lib/geoblacklight/relation/descendants_spec.rb +32 -0
- data/spec/lib/geoblacklight/relation/relation_response_spec.rb +43 -0
- data/spec/lib/geoblacklight/view_helper_override_spec.rb +37 -0
- data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +50 -0
- data/spec/lib/geoblacklight/wms_layer_spec.rb +99 -0
- data/spec/models/concerns/geoblacklight/solr_document/carto_spec.rb +61 -0
- data/spec/models/concerns/geoblacklight/solr_document/finder_spec.rb +40 -0
- data/spec/models/concerns/geoblacklight/solr_document/inspection_spec.rb +16 -0
- data/spec/models/concerns/geoblacklight/solr_document_spec.rb +251 -0
- data/spec/models/concerns/geoblacklight/spatial_search_behavior_spec.rb +84 -0
- data/spec/routing/catalog_routing_spec.rb +8 -0
- data/spec/spec_helper.rb +79 -0
- data/spec/support/backport_test_helpers.rb +45 -0
- data/spec/support/features.rb +5 -0
- data/spec/support/features/session_helpers.rb +20 -0
- data/spec/teaspoon_env.rb +213 -0
- data/spec/test_app_templates/Gemfile.extra +1 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +49 -0
- data/spec/test_app_templates/metadata/fgdc.html +129 -0
- data/spec/test_app_templates/metadata/fgdc.xml +145 -0
- data/spec/test_app_templates/metadata/iso.html +275 -0
- data/spec/test_app_templates/metadata/iso.xml +511 -0
- data/spec/test_app_templates/solr_documents +1 -0
- data/spec/views/catalog/_document_split.html.erb_spec.rb +5 -0
- data/spec/views/catalog/_index_split.html.erb_spec.rb +5 -0
- data/spec/views/catalog/_results_pagination.html.erb_spec.rb +9 -0
- data/spec/views/catalog/_show_downloads.html.erb_spec.rb +41 -0
- data/spec/views/catalog/_show_tools.html.erb_spec.rb +39 -0
- data/template.rb +19 -0
- data/vendor/assets/images/layers-2x.png +0 -0
- data/vendor/assets/images/layers.png +0 -0
- data/vendor/assets/images/marker-icon-2x.png +0 -0
- data/vendor/assets/images/marker-icon.png +0 -0
- data/vendor/assets/images/marker-shadow.png +0 -0
- data/vendor/assets/javascripts/esri-leaflet.js +5 -0
- data/vendor/assets/javascripts/esri-leaflet.js.map +1 -0
- data/vendor/assets/javascripts/leaflet-iiif.js +302 -0
- data/vendor/assets/javascripts/leaflet-src.js.map +1 -0
- data/vendor/assets/javascripts/leaflet.js.erb +13922 -0
- data/vendor/assets/javascripts/native.history.js +1 -0
- data/vendor/assets/javascripts/readmore.js +618 -0
- data/vendor/assets/javascripts/readmore.js.map +1 -0
- data/vendor/assets/stylesheets/leaflet-label.css +54 -0
- data/vendor/assets/stylesheets/leaflet.css +635 -0
- metadata +967 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe Geoblacklight::SpatialSearchBehavior do
|
|
4
|
+
subject { search_builder.with(user_params) }
|
|
5
|
+
|
|
6
|
+
let(:user_params) { Hash.new }
|
|
7
|
+
let(:solr_params) { Hash.new }
|
|
8
|
+
let(:blacklight_config) { CatalogController.blacklight_config.deep_copy }
|
|
9
|
+
let(:context) { CatalogController.new }
|
|
10
|
+
let(:search_builder_class) do
|
|
11
|
+
Class.new(Blacklight::SearchBuilder).tap do |klass|
|
|
12
|
+
include Blacklight::Solr::SearchBuilderBehavior
|
|
13
|
+
klass.include(described_class)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
let(:search_builder) { search_builder_class.new(context) }
|
|
17
|
+
|
|
18
|
+
describe '#add_spatial_params' do
|
|
19
|
+
it 'returns the solr_params when no bbox is given' do
|
|
20
|
+
expect(subject.add_spatial_params(solr_params)).to eq solr_params
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
context 'when given a bounding box' do
|
|
24
|
+
let(:params) do
|
|
25
|
+
{ bbox: '-180 -80 120 80' }
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
before do
|
|
29
|
+
subject.with(params)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
it 'returns a spatial search if bbox is given' do
|
|
33
|
+
expect(subject.add_spatial_params(solr_params)[:fq].to_s).to include('Intersects')
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
it 'applies boost based on configured Settings.BBOX_WITHIN_BOOST' do
|
|
37
|
+
allow(Settings).to receive(:BBOX_WITHIN_BOOST).and_return 99
|
|
38
|
+
expect(subject.add_spatial_params(solr_params)[:bq].to_s).to include('^99')
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
it 'applies default boost of 10 when Settings.BBOX_WITHIN_BOOST not configured' do
|
|
42
|
+
allow(Settings).to receive(:BBOX_WITHIN_BOOST).and_return nil
|
|
43
|
+
expect(subject.add_spatial_params(solr_params)[:bq].to_s).to include('^10')
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
it 'applies overlapRatio when Settings.OVERLAP_RATIO_BOOST is configured' do
|
|
47
|
+
allow(Settings).to receive(:OVERLAP_RATIO_BOOST).and_return 2
|
|
48
|
+
expect(subject.add_spatial_params(solr_params)[:bf].to_s).to include('$overlap^2')
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
it 'does not apply overlapRatio when Settings.OVERLAP_RATIO_BOOST not configured' do
|
|
52
|
+
allow(Settings).to receive(:OVERLAP_RATIO_BOOST).and_return nil
|
|
53
|
+
expect(subject.add_spatial_params(solr_params)).not_to have_key(:overlap)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
context 'when the wrong format for the bounding box is used' do
|
|
57
|
+
before do
|
|
58
|
+
allow(subject).to receive(:bounding_box).and_raise(Geoblacklight::Exceptions::WrongBoundingBoxFormat)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
it 'returns the spatial search without the boost or filter queries' do
|
|
62
|
+
expect(subject.add_spatial_params(solr_params)).to eq(bq: [])
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
describe '#envelope_bounds' do
|
|
68
|
+
let(:bbox) { instance_double(Geoblacklight::BoundingBox) }
|
|
69
|
+
before do
|
|
70
|
+
allow(bbox).to receive(:to_envelope).and_return('test')
|
|
71
|
+
end
|
|
72
|
+
it 'calls to_envelope on the bounding box' do
|
|
73
|
+
expect(subject).to receive(:bounding_box).and_return bbox
|
|
74
|
+
expect(subject.envelope_bounds).to eq 'test'
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
describe '#bounding_box' do
|
|
78
|
+
it 'creates a bounding box from a Solr lat-lon rectangle format' do
|
|
79
|
+
params = { bbox: '-120 -80 120 80' }
|
|
80
|
+
subject.with(params)
|
|
81
|
+
expect(subject.bounding_box).to be_an Geoblacklight::BoundingBox
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'Catalog Routes', type: :routing do
|
|
4
|
+
# Test paths for custom routes
|
|
5
|
+
it "maps { :controller => 'catalog', :action => 'opensearch', :format => 'xml' } to /catalog/opensearch.xml" do
|
|
6
|
+
expect(get: '/catalog/opensearch.xml').to route_to(controller: 'catalog', action: 'opensearch', format: 'xml')
|
|
7
|
+
end
|
|
8
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
ENV['RAILS_ENV'] ||= 'test'
|
|
2
|
+
|
|
3
|
+
require 'simplecov'
|
|
4
|
+
require 'coveralls'
|
|
5
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
|
|
6
|
+
[
|
|
7
|
+
SimpleCov::Formatter::HTMLFormatter,
|
|
8
|
+
Coveralls::SimpleCov::Formatter
|
|
9
|
+
]
|
|
10
|
+
)
|
|
11
|
+
SimpleCov.start 'rails' do
|
|
12
|
+
add_filter 'lib/generators/geoblacklight/install_generator.rb'
|
|
13
|
+
add_filter 'lib/geoblacklight/version.rb'
|
|
14
|
+
add_filter 'lib/generators/geoblacklight/templates'
|
|
15
|
+
add_filter '/spec'
|
|
16
|
+
add_filter '.internal_test_app/'
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
require 'factory_bot'
|
|
20
|
+
require 'database_cleaner'
|
|
21
|
+
|
|
22
|
+
require 'engine_cart'
|
|
23
|
+
EngineCart.load_application!
|
|
24
|
+
|
|
25
|
+
require 'rails-controller-testing' if Rails::VERSION::MAJOR >= 5
|
|
26
|
+
require 'rspec/rails'
|
|
27
|
+
require 'capybara/rspec'
|
|
28
|
+
require 'selenium-webdriver'
|
|
29
|
+
|
|
30
|
+
Capybara.register_driver(:headless_chrome) do |app|
|
|
31
|
+
Capybara::Selenium::Driver.load_selenium
|
|
32
|
+
browser_options = ::Selenium::WebDriver::Chrome::Options.new.tap do |opts|
|
|
33
|
+
opts.args << '--headless'
|
|
34
|
+
opts.args << '--disable-gpu'
|
|
35
|
+
opts.args << '--window-size=1280,1024'
|
|
36
|
+
end
|
|
37
|
+
http_client = Selenium::WebDriver::Remote::Http::Default.new
|
|
38
|
+
http_client.read_timeout = 120
|
|
39
|
+
http_client.open_timeout = 120
|
|
40
|
+
Capybara::Selenium::Driver.new(app,
|
|
41
|
+
browser: :chrome,
|
|
42
|
+
http_client: http_client,
|
|
43
|
+
options: browser_options)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
Capybara.javascript_driver = :headless_chrome
|
|
47
|
+
Capybara.default_max_wait_time = 120
|
|
48
|
+
|
|
49
|
+
require 'geoblacklight'
|
|
50
|
+
|
|
51
|
+
Dir['./spec/support/**/*.rb'].sort.each { |f| require f }
|
|
52
|
+
|
|
53
|
+
FactoryBot.definition_file_paths = [File.expand_path('../factories', __FILE__)]
|
|
54
|
+
FactoryBot.find_definitions
|
|
55
|
+
|
|
56
|
+
RSpec.configure do |config|
|
|
57
|
+
config.use_transactional_fixtures = false
|
|
58
|
+
|
|
59
|
+
config.before :each do
|
|
60
|
+
DatabaseCleaner.strategy = if Capybara.current_driver == :rack_test
|
|
61
|
+
:transaction
|
|
62
|
+
else
|
|
63
|
+
:truncation
|
|
64
|
+
end
|
|
65
|
+
DatabaseCleaner.start
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
config.after do
|
|
69
|
+
DatabaseCleaner.clean
|
|
70
|
+
end
|
|
71
|
+
if Rails::VERSION::MAJOR >= 5
|
|
72
|
+
config.include ::Rails.application.routes.url_helpers
|
|
73
|
+
config.include ::Rails.application.routes.mounted_helpers
|
|
74
|
+
else
|
|
75
|
+
config.include BackportTestHelpers, type: :controller
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
config.include Devise::Test::ControllerHelpers, type: :controller
|
|
79
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Backport the Rails 5 controller test methods to Rails 4
|
|
2
|
+
module BackportTestHelpers
|
|
3
|
+
def delete(*args)
|
|
4
|
+
(action, rest) = *args
|
|
5
|
+
rest ||= {}
|
|
6
|
+
|
|
7
|
+
@request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' if rest[:xhr]
|
|
8
|
+
|
|
9
|
+
super(action, rest[:params])
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def get(*args)
|
|
13
|
+
(action, rest) = *args
|
|
14
|
+
rest ||= {}
|
|
15
|
+
@request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' if rest[:xhr]
|
|
16
|
+
super(action, rest[:params])
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def post(*args)
|
|
20
|
+
(action, rest) = *args
|
|
21
|
+
rest ||= {}
|
|
22
|
+
body = rest[:body]
|
|
23
|
+
@request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' if rest[:xhr]
|
|
24
|
+
|
|
25
|
+
if body
|
|
26
|
+
super(action, body, rest.except(:params).merge(rest[:params]))
|
|
27
|
+
else
|
|
28
|
+
super(action, rest[:params])
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def put(*args)
|
|
33
|
+
(action, rest) = *args
|
|
34
|
+
rest ||= {}
|
|
35
|
+
@request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' if rest[:xhr]
|
|
36
|
+
super(action, rest[:params])
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def patch(*args)
|
|
40
|
+
(action, rest) = *args
|
|
41
|
+
rest ||= {}
|
|
42
|
+
@request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' if rest[:xhr]
|
|
43
|
+
super(action, rest[:params])
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Features
|
|
2
|
+
module SessionHelpers
|
|
3
|
+
def sign_up_with(email, password)
|
|
4
|
+
visit new_user_registration_path
|
|
5
|
+
fill_in 'Email', with: email
|
|
6
|
+
fill_in 'Password', with: password
|
|
7
|
+
click_button 'Sign up'
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def sign_in
|
|
11
|
+
user = FactoryBot.create(:user)
|
|
12
|
+
user.save
|
|
13
|
+
visit new_user_session_path
|
|
14
|
+
fill_in 'user_email', with: user.email
|
|
15
|
+
fill_in 'user_password', with: user.password
|
|
16
|
+
click_button 'Log in'
|
|
17
|
+
expect(page).to have_content 'Signed in successfully.'
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
unless defined?(Rails)
|
|
2
|
+
ENV['RAILS_ROOT'] = File.expand_path('../../', __FILE__)
|
|
3
|
+
require File.expand_path('../../config/environment', __FILE__)
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
# Teaspoon doesn't allow you to pass client driver options to the Selenium WebDriver. This monkey patch
|
|
7
|
+
# is a temporary fix until this PR is merged: https://github.com/jejacks0n/teaspoon/pull/519.
|
|
8
|
+
require 'teaspoon/driver/selenium'
|
|
9
|
+
|
|
10
|
+
Teaspoon::Driver::Selenium.class_eval do
|
|
11
|
+
def run_specs(runner, url)
|
|
12
|
+
driver = ::Selenium::WebDriver.for(
|
|
13
|
+
driver_options[:client_driver],
|
|
14
|
+
**driver_options[:selenium_options].to_hash.to_options
|
|
15
|
+
)
|
|
16
|
+
driver.navigate.to(url)
|
|
17
|
+
|
|
18
|
+
::Selenium::WebDriver::Wait.new(driver_options).until do
|
|
19
|
+
done = driver.execute_script('return window.Teaspoon && window.Teaspoon.finished')
|
|
20
|
+
driver.execute_script('return window.Teaspoon && window.Teaspoon.getMessages() || []').each do |line|
|
|
21
|
+
runner.process("#{line}\n")
|
|
22
|
+
end
|
|
23
|
+
done
|
|
24
|
+
end
|
|
25
|
+
ensure
|
|
26
|
+
driver&.quit
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
Teaspoon.configure do |config|
|
|
31
|
+
# Determines where the Teaspoon routes will be mounted. Changing this to "/jasmine" would allow you to browse to
|
|
32
|
+
# `http://localhost:3000/jasmine` to run your tests.
|
|
33
|
+
config.mount_at = '/teaspoon'
|
|
34
|
+
|
|
35
|
+
# Specifies the root where Teaspoon will look for files. If you're testing an engine using a dummy application it can
|
|
36
|
+
# be useful to set this to your engines root (e.g. `Teaspoon::Engine.root`).
|
|
37
|
+
# Note: Defaults to `Rails.root` if nil.
|
|
38
|
+
config.root = Geoblacklight::Engine.root
|
|
39
|
+
|
|
40
|
+
# Paths that will be appended to the Rails assets paths
|
|
41
|
+
# Note: Relative to `config.root`.
|
|
42
|
+
config.asset_paths = ['spec/javascripts', 'spec/javascripts/stylesheets']
|
|
43
|
+
|
|
44
|
+
# Fixtures are rendered through a controller, which allows using HAML, RABL/JBuilder, etc. Files in these paths will
|
|
45
|
+
# be rendered as fixtures.
|
|
46
|
+
config.fixture_paths = ['spec/javascripts/fixtures']
|
|
47
|
+
|
|
48
|
+
# SUITES
|
|
49
|
+
#
|
|
50
|
+
# You can modify the default suite configuration and create new suites here. Suites are isolated from one another.
|
|
51
|
+
#
|
|
52
|
+
# When defining a suite you can provide a name and a block. If the name is left blank, :default is assumed. You can
|
|
53
|
+
# omit various directives and the ones defined in the default suite will be used.
|
|
54
|
+
#
|
|
55
|
+
# To run a specific suite
|
|
56
|
+
# - in the browser: http://localhost/teaspoon/[suite_name]
|
|
57
|
+
# - with the rake task: rake teaspoon suite=[suite_name]
|
|
58
|
+
# - with the cli: teaspoon --suite=[suite_name]
|
|
59
|
+
config.suite do |suite|
|
|
60
|
+
# Specify the framework you would like to use. This allows you to select versions, and will do some basic setup for
|
|
61
|
+
# you -- which you can override with the directives below. This should be specified first, as it can override other
|
|
62
|
+
# directives.
|
|
63
|
+
# Note: If no version is specified, the latest is assumed.
|
|
64
|
+
#
|
|
65
|
+
# Versions: 1.3.1, 2.0.3, 2.1.3, 2.2.0
|
|
66
|
+
suite.use_framework :jasmine, '2.2.0'
|
|
67
|
+
|
|
68
|
+
# Specify a file matcher as a regular expression and all matching files will be loaded when the suite is run. These
|
|
69
|
+
# files need to be within an asset path. You can add asset paths using the `config.asset_paths`.
|
|
70
|
+
suite.matcher = '{spec/javascripts,app/assets}/**/*_spec.{js,js.coffee,coffee}'
|
|
71
|
+
|
|
72
|
+
# Load additional JS files, but requiring them in your spec helper is the preferred way to do this.
|
|
73
|
+
# suite.javascripts = []
|
|
74
|
+
|
|
75
|
+
# You can include your own stylesheets if you want to change how Teaspoon looks.
|
|
76
|
+
# Note: Spec related CSS can and should be loaded using fixtures.
|
|
77
|
+
# suite.stylesheets = ["teaspoon"]
|
|
78
|
+
|
|
79
|
+
# This suites spec helper, which can require additional support files. This file is loaded before any of your test
|
|
80
|
+
# files are loaded.
|
|
81
|
+
suite.helper = 'spec_helper'
|
|
82
|
+
|
|
83
|
+
# Partial to be rendered in the head tag of the runner. You can use the provided ones or define your own by creating
|
|
84
|
+
# a `_boot.html.erb` in your fixtures path, and adjust the config to `"/boot"` for instance.
|
|
85
|
+
#
|
|
86
|
+
# Available: boot, boot_require_js
|
|
87
|
+
suite.boot_partial = 'boot'
|
|
88
|
+
|
|
89
|
+
# Partial to be rendered in the body tag of the runner. You can define your own to create a custom body structure.
|
|
90
|
+
suite.body_partial = 'body'
|
|
91
|
+
|
|
92
|
+
# Hooks allow you to use `Teaspoon.hook("fixtures")` before, after, or during your spec run. This will make a
|
|
93
|
+
# synchronous Ajax request to the server that will call all of the blocks you've defined for that hook name.
|
|
94
|
+
# suite.hook :fixtures, &proc{}
|
|
95
|
+
|
|
96
|
+
# Determine whether specs loaded into the test harness should be embedded as individual script tags or concatenated
|
|
97
|
+
# into a single file. Similar to Rails' asset `debug: true` and `config.assets.debug = true` options. By default,
|
|
98
|
+
# Teaspoon expands all assets to provide more valuable stack traces that reference individual source files.
|
|
99
|
+
# suite.expand_assets = true
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Example suite. Since we're just filtering to files already within the root test/javascripts, these files will also
|
|
103
|
+
# be run in the default suite -- but can be focused into a more specific suite.
|
|
104
|
+
# config.suite :targeted do |suite|
|
|
105
|
+
# suite.matcher = "spec/javascripts/targeted/*_spec.{js,js.coffee,coffee}"
|
|
106
|
+
# end
|
|
107
|
+
|
|
108
|
+
# CONSOLE RUNNER SPECIFIC
|
|
109
|
+
#
|
|
110
|
+
# These configuration directives are applicable only when running via the rake task or command line interface. These
|
|
111
|
+
# directives can be overridden using the command line interface arguments or with ENV variables when using the rake
|
|
112
|
+
# task.
|
|
113
|
+
#
|
|
114
|
+
# Command Line Interface:
|
|
115
|
+
# teaspoon --driver=phantomjs --server-port=31337 --fail-fast=true --format=junit --suite=my_suite /spec/file_spec.js
|
|
116
|
+
#
|
|
117
|
+
# Rake:
|
|
118
|
+
# teaspoon DRIVER=phantomjs SERVER_PORT=31337 FAIL_FAST=true FORMATTERS=junit suite=my_suite
|
|
119
|
+
|
|
120
|
+
# Specify which headless driver to use. Supports PhantomJS and Selenium Webdriver.
|
|
121
|
+
#
|
|
122
|
+
# Available: :phantomjs, :selenium, :capybara_webkit
|
|
123
|
+
# PhantomJS: https://github.com/modeset/teaspoon/wiki/Using-PhantomJS
|
|
124
|
+
# Selenium Webdriver: https://github.com/modeset/teaspoon/wiki/Using-Selenium-WebDriver
|
|
125
|
+
# Capybara Webkit: https://github.com/modeset/teaspoon/wiki/Using-Capybara-Webkit
|
|
126
|
+
config.driver = :selenium
|
|
127
|
+
config.driver_options = {
|
|
128
|
+
client_driver: :chrome,
|
|
129
|
+
selenium_options: {
|
|
130
|
+
options: Selenium::WebDriver::Chrome::Options.new(args: ['headless', 'disable-gpu'])
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
# Specify additional options for the driver.
|
|
135
|
+
#
|
|
136
|
+
# PhantomJS: https://github.com/modeset/teaspoon/wiki/Using-PhantomJS
|
|
137
|
+
# Selenium Webdriver: https://github.com/modeset/teaspoon/wiki/Using-Selenium-WebDriver
|
|
138
|
+
# Capybara Webkit: https://github.com/modeset/teaspoon/wiki/Using-Capybara-Webkit
|
|
139
|
+
# config.driver_options = nil
|
|
140
|
+
|
|
141
|
+
# Specify the timeout for the driver. Specs are expected to complete within this time frame or the run will be
|
|
142
|
+
# considered a failure. This is to avoid issues that can arise where tests stall.
|
|
143
|
+
# config.driver_timeout = 180
|
|
144
|
+
|
|
145
|
+
# Specify a server to use with Rack (e.g. thin, mongrel). If nil is provided Rack::Server is used.
|
|
146
|
+
# config.server = nil
|
|
147
|
+
|
|
148
|
+
# Specify a port to run on a specific port, otherwise Teaspoon will use a random available port.
|
|
149
|
+
# config.server_port = nil
|
|
150
|
+
|
|
151
|
+
# Timeout for starting the server in seconds. If your server is slow to start you may have to bump this, or you may
|
|
152
|
+
# want to lower this if you know it shouldn't take long to start.
|
|
153
|
+
# config.server_timeout = 20
|
|
154
|
+
|
|
155
|
+
# Force Teaspoon to fail immediately after a failing suite. Can be useful to make Teaspoon fail early if you have
|
|
156
|
+
# several suites, but in environments like CI this may not be desirable.
|
|
157
|
+
# config.fail_fast = true
|
|
158
|
+
|
|
159
|
+
# Specify the formatters to use when outputting the results.
|
|
160
|
+
# Note: Output files can be specified by using `"junit>/path/to/output.xml"`.
|
|
161
|
+
#
|
|
162
|
+
# Available: :dot, :clean, :documentation, :json, :junit, :pride, :rspec_html, :snowday, :swayze_or_oprah, :tap, :tap_y, :teamcity
|
|
163
|
+
# config.formatters = [:dot]
|
|
164
|
+
|
|
165
|
+
# Specify if you want color output from the formatters.
|
|
166
|
+
# config.color = true
|
|
167
|
+
|
|
168
|
+
# Teaspoon pipes all console[log/debug/error] to $stdout. This is useful to catch places where you've forgotten to
|
|
169
|
+
# remove them, but in verbose applications this may not be desirable.
|
|
170
|
+
# config.suppress_log = false
|
|
171
|
+
|
|
172
|
+
# COVERAGE REPORTS / THRESHOLD ASSERTIONS
|
|
173
|
+
#
|
|
174
|
+
# Coverage reports requires Istanbul (https://github.com/gotwarlost/istanbul) to add instrumentation to your code and
|
|
175
|
+
# display coverage statistics.
|
|
176
|
+
#
|
|
177
|
+
# Coverage configurations are similar to suites. You can define several, and use different ones under different
|
|
178
|
+
# conditions.
|
|
179
|
+
#
|
|
180
|
+
# To run with a specific coverage configuration
|
|
181
|
+
# - with the rake task: rake teaspoon USE_COVERAGE=[coverage_name]
|
|
182
|
+
# - with the cli: teaspoon --coverage=[coverage_name]
|
|
183
|
+
|
|
184
|
+
# Specify that you always want a coverage configuration to be used. Otherwise, specify that you want coverage
|
|
185
|
+
# on the CLI.
|
|
186
|
+
# Set this to "true" or the name of your coverage config.
|
|
187
|
+
# config.use_coverage = nil
|
|
188
|
+
|
|
189
|
+
# You can have multiple coverage configs by passing a name to config.coverage.
|
|
190
|
+
# e.g. config.coverage :ci do |coverage|
|
|
191
|
+
# The default coverage config name is :default.
|
|
192
|
+
config.coverage do |coverage|
|
|
193
|
+
# Which coverage reports Istanbul should generate. Correlates directly to what Istanbul supports.
|
|
194
|
+
#
|
|
195
|
+
# Available: text-summary, text, html, lcov, lcovonly, cobertura, teamcity
|
|
196
|
+
# coverage.reports = ["text-summary", "html"]
|
|
197
|
+
|
|
198
|
+
# The path that the coverage should be written to - when there's an artifact to write to disk.
|
|
199
|
+
# Note: Relative to `config.root`.
|
|
200
|
+
# coverage.output_path = "coverage"
|
|
201
|
+
|
|
202
|
+
# Assets to be ignored when generating coverage reports. Accepts an array of filenames or regular expressions. The
|
|
203
|
+
# default excludes assets from vendor, gems and support libraries.
|
|
204
|
+
# coverage.ignore = [%r{/lib/ruby/gems/}, %r{/vendor/assets/}, %r{/support/}, %r{/(.+)_helper.}]
|
|
205
|
+
|
|
206
|
+
# Various thresholds requirements can be defined, and those thresholds will be checked at the end of a run. If any
|
|
207
|
+
# aren't met the run will fail with a message. Thresholds can be defined as a percentage (0-100), or nil.
|
|
208
|
+
# coverage.statements = nil
|
|
209
|
+
# coverage.functions = nil
|
|
210
|
+
# coverage.branches = nil
|
|
211
|
+
# coverage.lines = nil
|
|
212
|
+
end
|
|
213
|
+
end
|