geoblacklight 4.0.0 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (225) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +21 -6
  3. data/.solr_wrapper +1 -0
  4. data/.standard.yml +1 -0
  5. data/Gemfile +13 -11
  6. data/README.md +1 -1
  7. data/Rakefile +42 -50
  8. data/app/assets/images/blacklight/american-geographical-society-library-uwm-libraries.svg +26 -0
  9. data/app/assets/images/blacklight/arizona.svg +4 -0
  10. data/app/assets/images/blacklight/circle-info-solid.svg +1 -0
  11. data/app/assets/images/blacklight/fire-solid.svg +1 -0
  12. data/app/assets/images/blacklight/lightbulb-solid.svg +1 -0
  13. data/app/assets/images/blacklight/nebraska.svg +4 -0
  14. data/app/assets/images/blacklight/rutgers.svg +5 -0
  15. data/app/assets/images/blacklight/triangle-exclamation-solid.svg +1 -0
  16. data/app/assets/stylesheets/geoblacklight/modules/sidebar.scss +8 -0
  17. data/app/components/geoblacklight/display_note_component.html.erb +1 -0
  18. data/app/components/geoblacklight/display_note_component.rb +47 -0
  19. data/app/components/geoblacklight/icon_facet_item_component.rb +2 -2
  20. data/app/controllers/download_controller.rb +36 -37
  21. data/app/controllers/relation_controller.rb +1 -0
  22. data/app/controllers/wms_controller.rb +1 -0
  23. data/app/helpers/arcgis_helper.rb +2 -1
  24. data/app/helpers/blacklight_helper.rb +2 -1
  25. data/app/helpers/carto_helper.rb +3 -2
  26. data/app/helpers/geoblacklight/geoblacklight_helper_behavior.rb +2 -1
  27. data/app/helpers/geoblacklight_helper.rb +44 -36
  28. data/app/models/concerns/geoblacklight/bbox_filter_query.rb +1 -1
  29. data/app/models/concerns/geoblacklight/solr_document/arcgis.rb +1 -0
  30. data/app/models/concerns/geoblacklight/solr_document/carto.rb +1 -0
  31. data/app/models/concerns/geoblacklight/solr_document/citation.rb +3 -2
  32. data/app/models/concerns/geoblacklight/solr_document/finder.rb +1 -0
  33. data/app/models/concerns/geoblacklight/solr_document/inspection.rb +1 -0
  34. data/app/models/concerns/geoblacklight/solr_document.rb +17 -9
  35. data/app/models/concerns/geoblacklight/suppressed_records_search_behavior.rb +2 -1
  36. data/app/presenters/geoblacklight/document_presenter.rb +3 -2
  37. data/app/views/catalog/_show_default_display_note.html.erb +7 -0
  38. data/app/views/catalog/_show_sidebar.html.erb +1 -0
  39. data/app/views/catalog/_show_sidebar_static_map.html.erb +10 -0
  40. data/app/views/relation/index.json.jbuilder +1 -1
  41. data/config/initializers/new_gbl_settings_defaults_4.1.yml +104 -0
  42. data/config/initializers/rails_config.rb +5 -1
  43. data/config/locales/geoblacklight.en.yml +18 -10
  44. data/geoblacklight.gemspec +36 -40
  45. data/lib/generators/geoblacklight/assets_generator.rb +15 -15
  46. data/lib/generators/geoblacklight/install_generator.rb +24 -23
  47. data/lib/generators/geoblacklight/templates/catalog_controller.rb +66 -71
  48. data/lib/generators/geoblacklight/templates/settings.yml +74 -22
  49. data/lib/geoblacklight/bounding_box.rb +1 -0
  50. data/lib/geoblacklight/constants.rb +26 -25
  51. data/lib/geoblacklight/download/geojson_download.rb +10 -9
  52. data/lib/geoblacklight/download/geotiff_download.rb +6 -5
  53. data/lib/geoblacklight/download/hgl_download.rb +4 -3
  54. data/lib/geoblacklight/download/kmz_download.rb +11 -10
  55. data/lib/geoblacklight/download/shapefile_download.rb +10 -9
  56. data/lib/geoblacklight/download.rb +12 -11
  57. data/lib/geoblacklight/engine.rb +10 -9
  58. data/lib/geoblacklight/exceptions.rb +3 -0
  59. data/lib/geoblacklight/faraday_middleware/follow_redirects.rb +12 -11
  60. data/lib/geoblacklight/geometry.rb +6 -5
  61. data/lib/geoblacklight/item_viewer.rb +4 -3
  62. data/lib/geoblacklight/metadata/base.rb +4 -3
  63. data/lib/geoblacklight/metadata/fgdc.rb +1 -0
  64. data/lib/geoblacklight/metadata/html.rb +5 -4
  65. data/lib/geoblacklight/metadata/iso19139.rb +1 -0
  66. data/lib/geoblacklight/metadata.rb +1 -0
  67. data/lib/geoblacklight/metadata_transformer/base.rb +5 -4
  68. data/lib/geoblacklight/metadata_transformer/fgdc.rb +1 -0
  69. data/lib/geoblacklight/metadata_transformer/iso19139.rb +1 -0
  70. data/lib/geoblacklight/metadata_transformer.rb +6 -2
  71. data/lib/geoblacklight/reference.rb +3 -2
  72. data/lib/geoblacklight/references.rb +11 -6
  73. data/lib/geoblacklight/relation/ancestors.rb +4 -3
  74. data/lib/geoblacklight/relation/descendants.rb +4 -3
  75. data/lib/geoblacklight/relation/relation_response.rb +3 -2
  76. data/lib/geoblacklight/routes/downloadable.rb +3 -2
  77. data/lib/geoblacklight/routes/exportable.rb +4 -3
  78. data/lib/geoblacklight/routes/wms.rb +2 -1
  79. data/lib/geoblacklight/routes.rb +4 -3
  80. data/lib/geoblacklight/version.rb +2 -1
  81. data/lib/geoblacklight/view_helper_override.rb +3 -2
  82. data/lib/geoblacklight/wms_layer/feature_info_response.rb +5 -4
  83. data/lib/geoblacklight/wms_layer.rb +4 -3
  84. data/lib/geoblacklight.rb +32 -31
  85. data/lib/tasks/geoblacklight.rake +45 -44
  86. data/schema/geoblacklight-schema-aardvark.json +6 -0
  87. data/spec/components/geoblacklight/display_note_component_spec.rb +27 -0
  88. data/spec/components/geoblacklight/homepage_feature_facet_component_spec.rb +11 -10
  89. data/spec/components/geoblacklight/icon_facet_item_component_spec.rb +8 -7
  90. data/spec/config/initializers/rails_config_spec.rb +10 -9
  91. data/spec/controllers/catalog_controller_spec.rb +27 -26
  92. data/spec/controllers/download_controller_spec.rb +50 -49
  93. data/spec/controllers/relation_controller_spec.rb +5 -4
  94. data/spec/controllers/wms_controller_spec.rb +10 -9
  95. data/spec/factories/user.rb +3 -2
  96. data/spec/features/bookmarks_spec.rb +7 -6
  97. data/spec/features/configurable_basemap_spec.rb +12 -11
  98. data/spec/features/data_dictionary_download_spec.rb +11 -10
  99. data/spec/features/download_layer_spec.rb +64 -63
  100. data/spec/features/empty_search_spec.rb +6 -5
  101. data/spec/features/esri_viewer_spec.rb +33 -32
  102. data/spec/features/exports_spec.rb +18 -17
  103. data/spec/features/full_screen_controll_spec.rb +8 -8
  104. data/spec/features/help_text_spec.rb +6 -5
  105. data/spec/features/home_page_spec.rb +30 -29
  106. data/spec/features/iiif_viewer_spec.rb +6 -5
  107. data/spec/features/index_map_spec.rb +17 -16
  108. data/spec/features/layer_inspection_spec.rb +8 -7
  109. data/spec/features/layer_opacity_spec.rb +15 -14
  110. data/spec/features/layer_preview_spec.rb +11 -10
  111. data/spec/features/layer_with_no_references_spec.rb +5 -4
  112. data/spec/features/linkified_attribute_table_spec.rb +8 -7
  113. data/spec/features/metadata_panel_spec.rb +32 -31
  114. data/spec/features/missing_metadata_spec.rb +18 -17
  115. data/spec/features/multiple_downloads_spec.rb +11 -10
  116. data/spec/features/oembed_spec.rb +6 -5
  117. data/spec/features/relations_spec.rb +51 -26
  118. data/spec/features/saved_searches_spec.rb +7 -6
  119. data/spec/features/search_bar_spec.rb +9 -8
  120. data/spec/features/search_results_complex_geometry_spec.rb +12 -11
  121. data/spec/features/search_results_icons_spec.rb +10 -9
  122. data/spec/features/search_results_map_spec.rb +21 -20
  123. data/spec/features/search_results_overlap_ratio_spec.rb +17 -16
  124. data/spec/features/search_spec.rb +19 -18
  125. data/spec/features/show_page_download_spec.rb +15 -14
  126. data/spec/features/show_page_metadata_spec.rb +9 -8
  127. data/spec/features/show_page_sidebar_static_map_spec.rb +21 -0
  128. data/spec/features/sms_spec.rb +12 -11
  129. data/spec/features/split_view.html.erb_spec.rb +56 -55
  130. data/spec/features/suppressed_records_spec.rb +10 -9
  131. data/spec/features/tilejson_spec.rb +9 -8
  132. data/spec/features/tms_spec.rb +6 -5
  133. data/spec/features/web_services_modal_spec.rb +37 -36
  134. data/spec/features/wmts_spec.rb +16 -15
  135. data/spec/features/xyz_spec.rb +6 -5
  136. data/spec/fixtures/solr_documents/actual-papermap1.json +1 -1
  137. data/spec/fixtures/solr_documents/actual-point1.json +1 -1
  138. data/spec/fixtures/solr_documents/actual-polygon1.json +1 -1
  139. data/spec/fixtures/solr_documents/actual-raster1.json +1 -1
  140. data/spec/fixtures/solr_documents/baruch_ancestor1.json +1 -1
  141. data/spec/fixtures/solr_documents/baruch_ancestor2.json +1 -1
  142. data/spec/fixtures/solr_documents/baruch_documentation_download.json +2 -2
  143. data/spec/fixtures/solr_documents/cornell_html_metadata.json +1 -1
  144. data/spec/fixtures/solr_documents/display-note.json +52 -0
  145. data/spec/fixtures/solr_documents/esri-dynamic-layer-all-layers.json +1 -1
  146. data/spec/fixtures/solr_documents/esri-dynamic-layer-single-layer.json +1 -1
  147. data/spec/fixtures/solr_documents/esri-feature-layer.json +1 -1
  148. data/spec/fixtures/solr_documents/esri-image-map-layer.json +1 -1
  149. data/spec/fixtures/solr_documents/esri-tiled_map_layer.json +1 -1
  150. data/spec/fixtures/solr_documents/esri-wms-layer.json +1 -1
  151. data/spec/fixtures/solr_documents/harvard_raster.json +1 -1
  152. data/spec/fixtures/solr_documents/iiif-eastern-hemisphere.json +1 -1
  153. data/spec/fixtures/solr_documents/index-map-polygon-no-downloadurl.json +1 -1
  154. data/spec/fixtures/solr_documents/index-map-polygon.json +1 -1
  155. data/spec/fixtures/solr_documents/index-map-stanford.json +1 -1
  156. data/spec/fixtures/solr_documents/index_map_point.json +1 -1
  157. data/spec/fixtures/solr_documents/princeton-parent.json +1 -1
  158. data/spec/fixtures/solr_documents/public_direct_download.json +1 -1
  159. data/spec/fixtures/solr_documents/public_iiif_princeton.json +1 -1
  160. data/spec/fixtures/solr_documents/restricted-line.json +1 -1
  161. data/spec/fixtures/solr_documents/tilejson.json +2 -2
  162. data/spec/fixtures/solr_documents/umn_metro_result1.json +2 -2
  163. data/spec/fixtures/solr_documents/umn_state_result1.json +1 -1
  164. data/spec/fixtures/solr_documents/umn_state_result2.json +1 -1
  165. data/spec/fixtures/solr_documents/uva_slug_colon.json +1 -1
  166. data/spec/fixtures/solr_documents/wmts-multiple.json +1 -1
  167. data/spec/fixtures/solr_documents/wmts-single-layer.json +6 -6
  168. data/spec/fixtures/solr_documents/xyz.json +3 -3
  169. data/spec/helpers/arcgis_helper_spec.rb +8 -7
  170. data/spec/helpers/carto_helper_spec.rb +6 -5
  171. data/spec/helpers/geoblacklight/geoblacklight_helper_behavior_spec.rb +10 -15
  172. data/spec/helpers/geoblacklight_helper_spec.rb +139 -138
  173. data/spec/lib/geoblacklight/bounding_box_spec.rb +14 -13
  174. data/spec/lib/geoblacklight/document_presenter_spec.rb +26 -25
  175. data/spec/lib/geoblacklight/download/geojson_download_spec.rb +8 -7
  176. data/spec/lib/geoblacklight/download/geotiff_download_spec.rb +8 -7
  177. data/spec/lib/geoblacklight/download/hgl_download_spec.rb +16 -15
  178. data/spec/lib/geoblacklight/download/kmz_download_spec.rb +9 -8
  179. data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +8 -7
  180. data/spec/lib/geoblacklight/download_spec.rb +61 -60
  181. data/spec/lib/geoblacklight/geometry_spec.rb +29 -28
  182. data/spec/lib/geoblacklight/item_viewer_spec.rb +25 -24
  183. data/spec/lib/geoblacklight/metadata/base_spec.rb +44 -43
  184. data/spec/lib/geoblacklight/metadata/html_spec.rb +7 -6
  185. data/spec/lib/geoblacklight/metadata_spec.rb +15 -14
  186. data/spec/lib/geoblacklight/metadata_transformer/base_spec.rb +13 -12
  187. data/spec/lib/geoblacklight/metadata_transformer/fgdc_spec.rb +8 -7
  188. data/spec/lib/geoblacklight/metadata_transformer/iso19139_spec.rb +8 -7
  189. data/spec/lib/geoblacklight/metadata_transformer_spec.rb +15 -14
  190. data/spec/lib/geoblacklight/reference_spec.rb +28 -27
  191. data/spec/lib/geoblacklight/references_spec.rb +89 -76
  192. data/spec/lib/geoblacklight/relation/ancestors_spec.rb +17 -16
  193. data/spec/lib/geoblacklight/relation/descendants_spec.rb +17 -16
  194. data/spec/lib/geoblacklight/relation/relation_response_spec.rb +29 -28
  195. data/spec/lib/geoblacklight/view_helper_override_spec.rb +14 -13
  196. data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +19 -18
  197. data/spec/lib/geoblacklight/wms_layer_spec.rb +31 -30
  198. data/spec/models/concerns/geoblacklight/bbox_filter_field_spec.rb +31 -31
  199. data/spec/models/concerns/geoblacklight/bbox_filter_query_spec.rb +32 -32
  200. data/spec/models/concerns/geoblacklight/solr_document/carto_spec.rb +16 -15
  201. data/spec/models/concerns/geoblacklight/solr_document/citation_spec.rb +7 -6
  202. data/spec/models/concerns/geoblacklight/solr_document/finder_spec.rb +16 -17
  203. data/spec/models/concerns/geoblacklight/solr_document/inspection_spec.rb +7 -6
  204. data/spec/models/concerns/geoblacklight/solr_document_spec.rb +121 -107
  205. data/spec/models/concerns/geoblacklight/suppressed_records_search_behavior_spec.rb +8 -7
  206. data/spec/presenters/geoblacklight/bbox_item_presenter_spec.rb +10 -10
  207. data/spec/routing/catalog_routing_spec.rb +4 -3
  208. data/spec/spec_helper.rb +34 -33
  209. data/spec/support/backport_test_helpers.rb +6 -5
  210. data/spec/support/features/session_helpers.rb +8 -7
  211. data/spec/support/features.rb +2 -1
  212. data/spec/support/fixtures.rb +2 -1
  213. data/spec/tasks/geoblacklight_spec.rb +10 -9
  214. data/spec/test_app_templates/lib/generators/test_app_generator.rb +16 -15
  215. data/spec/views/catalog/_document_split.html.erb_spec.rb +3 -2
  216. data/spec/views/catalog/_index_split.html.erb_spec.rb +3 -2
  217. data/spec/views/catalog/_results_pagination.html.erb_spec.rb +5 -4
  218. data/spec/views/catalog/_show_downloads.html.erb_spec.rb +11 -10
  219. data/spec/views/catalog/_show_tools.html.erb_spec.rb +13 -12
  220. data/template.rb +9 -8
  221. metadata +29 -212
  222. data/.gitmodules +0 -0
  223. data/.rubocop.yml +0 -111
  224. data/.rubocop_todo.yml +0 -437
  225. data/config/initializers/new_gbl_settings_defaults_3_4.yml +0 -6
@@ -1,11 +1,12 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  # Backport the Rails 5 controller test methods to Rails 4
3
4
  module BackportTestHelpers
4
5
  def delete(*args)
5
6
  (action, rest) = *args
6
7
  rest ||= {}
7
8
 
8
- @request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' if rest[:xhr]
9
+ @request.env["HTTP_X_REQUESTED_WITH"] = "XMLHttpRequest" if rest[:xhr]
9
10
 
10
11
  super(action, rest[:params])
11
12
  end
@@ -13,7 +14,7 @@ module BackportTestHelpers
13
14
  def get(*args)
14
15
  (action, rest) = *args
15
16
  rest ||= {}
16
- @request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' if rest[:xhr]
17
+ @request.env["HTTP_X_REQUESTED_WITH"] = "XMLHttpRequest" if rest[:xhr]
17
18
  super(action, rest[:params])
18
19
  end
19
20
 
@@ -21,7 +22,7 @@ module BackportTestHelpers
21
22
  (action, rest) = *args
22
23
  rest ||= {}
23
24
  body = rest[:body]
24
- @request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' if rest[:xhr]
25
+ @request.env["HTTP_X_REQUESTED_WITH"] = "XMLHttpRequest" if rest[:xhr]
25
26
 
26
27
  if body
27
28
  super(action, body, rest.except(:params).merge(rest[:params]))
@@ -33,14 +34,14 @@ module BackportTestHelpers
33
34
  def put(*args)
34
35
  (action, rest) = *args
35
36
  rest ||= {}
36
- @request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' if rest[:xhr]
37
+ @request.env["HTTP_X_REQUESTED_WITH"] = "XMLHttpRequest" if rest[:xhr]
37
38
  super(action, rest[:params])
38
39
  end
39
40
 
40
41
  def patch(*args)
41
42
  (action, rest) = *args
42
43
  rest ||= {}
43
- @request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' if rest[:xhr]
44
+ @request.env["HTTP_X_REQUESTED_WITH"] = "XMLHttpRequest" if rest[:xhr]
44
45
  super(action, rest[:params])
45
46
  end
46
47
  end
@@ -1,21 +1,22 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Features
3
4
  module SessionHelpers
4
5
  def sign_up_with(email, password)
5
6
  visit new_user_registration_path
6
- fill_in 'Email', with: email
7
- fill_in 'Password', with: password
8
- click_button 'Sign up'
7
+ fill_in "Email", with: email
8
+ fill_in "Password", with: password
9
+ click_button "Sign up"
9
10
  end
10
11
 
11
12
  def sign_in
12
13
  user = FactoryBot.create(:user)
13
14
  user.save
14
15
  visit new_user_session_path
15
- fill_in 'user_email', with: user.email
16
- fill_in 'user_password', with: user.password
17
- click_button 'Log in'
18
- expect(page).to have_content 'Signed in successfully.'
16
+ fill_in "user_email", with: user.email
17
+ fill_in "user_password", with: user.password
18
+ click_button "Log in"
19
+ expect(page).to have_content "Signed in successfully."
19
20
  end
20
21
  end
21
22
  end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
- require File.expand_path('../features/session_helpers.rb', __FILE__)
2
+
3
+ require File.expand_path("../features/session_helpers.rb", __FILE__)
3
4
 
4
5
  RSpec.configure do |config|
5
6
  config.include Features::SessionHelpers, type: :feature
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  def read_fixture(fname)
3
4
  File.read(File.join(fixture_dir, fname))
4
5
  end
5
6
 
6
7
  def fixture_dir
7
- @fixture_dir ||= File.join(File.dirname(__FILE__), '../fixtures')
8
+ @fixture_dir ||= File.join(File.dirname(__FILE__), "../fixtures")
8
9
  end
@@ -1,18 +1,19 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
- require 'rake'
4
- require 'fileutils'
5
2
 
6
- describe 'geoblacklight.rake' do
7
- describe 'geoblacklight:downloads:mkdir' do
3
+ require "spec_helper"
4
+ require "rake"
5
+ require "fileutils"
6
+
7
+ describe "geoblacklight.rake" do
8
+ describe "geoblacklight:downloads:mkdir" do
8
9
  before do
9
10
  Rails.application.load_tasks
10
- FileUtils.rm_rf Rails.root.join('tmp', 'cache', 'downloads')
11
+ FileUtils.rm_rf Rails.root.join("tmp", "cache", "downloads")
11
12
  end
12
13
 
13
- it 'creates the tmp/cache/downloads directory' do
14
- Rake::Task['geoblacklight:downloads:mkdir'].invoke
15
- expect(File.directory?(Rails.root.join('tmp', 'cache', 'downloads')))
14
+ it "creates the tmp/cache/downloads directory" do
15
+ Rake::Task["geoblacklight:downloads:mkdir"].invoke
16
+ expect(File.directory?(Rails.root.join("tmp", "cache", "downloads")))
16
17
  .to be true
17
18
  end
18
19
  end
@@ -1,43 +1,44 @@
1
1
  # frozen_string_literal: true
2
- require 'rails/generators'
2
+
3
+ require "rails/generators"
3
4
 
4
5
  class TestAppGenerator < Rails::Generators::Base
5
- source_root File.expand_path('../../../../spec/test_app_templates', __FILE__)
6
+ source_root File.expand_path("../../../../spec/test_app_templates", __FILE__)
6
7
 
7
8
  def fix_sqlite3_version_requirement
8
- return unless Gem.loaded_specs['rails'].version.to_s <= '5.2.2'
9
+ return unless Gem.loaded_specs["rails"].version.to_s <= "5.2.2"
9
10
 
10
11
  # Hack for https://github.com/rails/rails/issues/35153
11
12
  # Adapted from https://github.com/projectblacklight/blacklight/pull/2065
12
- gsub_file('Gemfile', /^gem 'sqlite3'$/, 'gem "sqlite3", "~> 1.3.6"')
13
+ gsub_file("Gemfile", /^gem 'sqlite3'$/, 'gem "sqlite3", "~> 1.3.6"')
13
14
  end
14
15
 
15
16
  def add_gems
16
- gem 'blacklight'
17
- gem 'webpacker' unless Rails.version.to_s.start_with? '6.1.'
17
+ gem "blacklight"
18
+ gem "webpacker" unless Rails.version.to_s.start_with? "6.1."
18
19
  Bundler.with_clean_env do
19
- run 'bundle install'
20
+ run "bundle install"
20
21
  end
21
22
  end
22
23
 
23
24
  def install_webpacker
24
- run 'bundle exec rails webpacker:install'
25
+ run "bundle exec rails webpacker:install"
25
26
  end
26
27
 
27
28
  def run_blacklight_generator
28
- say_status('warning', 'GENERATING BL', :yellow)
29
+ say_status("warning", "GENERATING BL", :yellow)
29
30
 
30
- generate 'blacklight:install', '--devise'
31
+ generate "blacklight:install", "--devise"
31
32
  end
32
33
 
33
34
  def install_engine
34
- generate 'geoblacklight:install', '-f'
35
+ generate "geoblacklight:install", "-f"
35
36
  end
36
37
 
37
38
  def fixtures
38
- FileUtils.mkdir_p 'spec/fixtures/solr_documents'
39
- directory 'solr_documents', 'spec/fixtures/solr_documents'
40
- FileUtils.mkdir_p 'spec/fixtures/metadata'
41
- directory 'metadata', 'spec/fixtures/metadata'
39
+ FileUtils.mkdir_p "spec/fixtures/solr_documents"
40
+ directory "solr_documents", "spec/fixtures/solr_documents"
41
+ FileUtils.mkdir_p "spec/fixtures/metadata"
42
+ directory "metadata", "spec/fixtures/metadata"
42
43
  end
43
44
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- describe 'catalog/_document_split.html.erb', type: :view do
3
+ require "spec_helper"
4
+
5
+ describe "catalog/_document_split.html.erb", type: :view do
5
6
  # TODO: js plugin refactor really needs to be redone so that the views can be testable
6
7
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- describe 'catalog/_document_split.html.erb', type: :view do
3
+ require "spec_helper"
4
+
5
+ describe "catalog/_document_split.html.erb", type: :view do
5
6
  # TODO: js plugin refactor really needs to be redone so that the views can be testable
6
7
  end
@@ -1,10 +1,11 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- describe 'catalog/_results_pagination', type: :view do
5
- it 'will have a #pagination wrapping div' do
3
+ require "spec_helper"
4
+
5
+ describe "catalog/_results_pagination", type: :view do
6
+ it "will have a #pagination wrapping div" do
6
7
  allow(view).to receive_messages(show_pagination?: false)
7
8
  render
8
- expect(rendered).to have_css '#pagination'
9
+ expect(rendered).to have_css "#pagination"
9
10
  end
10
11
  end
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- describe 'catalog/_show_downloads', type: :view do
5
- context 'document is downloadable' do
3
+ require "spec_helper"
4
+
5
+ describe "catalog/_show_downloads", type: :view do
6
+ context "document is downloadable" do
6
7
  let(:document) { instance_double(SolrDocument) }
7
8
  before do
8
9
  assign :document, document
@@ -14,28 +15,28 @@ describe 'catalog/_show_downloads', type: :view do
14
15
  allow(document).to receive(:download_types).and_return(shapefile: {})
15
16
  end
16
17
 
17
- it 'renders the downloads collapse partial' do
18
+ it "renders the downloads collapse partial" do
18
19
  expect(view).to receive(:document_downloadable?).and_return(true)
19
20
 
20
- stub_template 'catalog/_downloads_collapse.html.erb' => 'stubbed_downloads_collapse'
21
+ stub_template "catalog/_downloads_collapse.html.erb" => "stubbed_downloads_collapse"
21
22
 
22
23
  render
23
24
 
24
- expect(rendered).to have_content 'stubbed_downloads_collapse'
25
+ expect(rendered).to have_content "stubbed_downloads_collapse"
25
26
  end
26
27
  end
27
28
 
28
- context 'document is not downloadable' do
29
+ context "document is not downloadable" do
29
30
  let(:document) { instance_double(SolrDocument, restricted?: true, same_institution?: true) }
30
31
  before do
31
32
  expect(view).to receive(:document_downloadable?).and_return(false)
32
33
  end
33
34
 
34
- context 'when restricted & same institution' do
35
- it 'renders login link' do
35
+ context "when restricted & same institution" do
36
+ it "renders login link" do
36
37
  assign :document, document
37
38
  render
38
- expect(rendered).to have_css '.card-header a'
39
+ expect(rendered).to have_css ".card-header a"
39
40
  end
40
41
  end
41
42
  end
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
- require 'spec_helper'
3
2
 
4
- describe 'catalog/_show_tools.html.erb', type: :view do
5
- let(:document) { SolrDocument.new id: 'xyz', format: 'a' }
3
+ require "spec_helper"
4
+
5
+ describe "catalog/_show_tools.html.erb", type: :view do
6
+ let(:document) { SolrDocument.new id: "xyz", format: "a" }
6
7
  let(:blacklight_config) { Blacklight::Configuration.new }
7
8
  let(:context) { Blacklight::Configuration::Context.new(controller) }
8
9
 
@@ -12,23 +13,23 @@ describe 'catalog/_show_tools.html.erb', type: :view do
12
13
  allow(view).to receive(:blacklight_configuration_context).and_return context
13
14
  end
14
15
 
15
- describe 'document actions' do
16
+ describe "document actions" do
16
17
  let(:document_actions) { blacklight_config.show.document_actions }
17
18
 
18
- it 'renders a document action' do
19
- allow(view).to receive(:some_action_solr_document_path).with(document, any_args).and_return 'x'
20
- document_actions[:some_action] = Blacklight::Configuration::ToolConfig.new key: :some_action, name: :some_action, partial: 'document_action'
21
- render partial: 'catalog/show_tools'
22
- expect(rendered).to have_link 'Some action', href: 'x'
19
+ it "renders a document action" do
20
+ allow(view).to receive(:some_action_solr_document_path).with(document, any_args).and_return "x"
21
+ document_actions[:some_action] = Blacklight::Configuration::ToolConfig.new key: :some_action, name: :some_action, partial: "document_action"
22
+ render partial: "catalog/show_tools"
23
+ expect(rendered).to have_link "Some action", href: "x"
23
24
  end
24
25
 
25
- context 'without any document actions defined' do
26
+ context "without any document actions defined" do
26
27
  before do
27
28
  document_actions.clear
28
29
  end
29
30
 
30
- it 'does not display the tools' do
31
- render partial: 'catalog/show_tools'
31
+ it "does not display the tools" do
32
+ render partial: "catalog/show_tools"
32
33
 
33
34
  expect(rendered).to be_blank
34
35
  end
data/template.rb CHANGED
@@ -1,19 +1,20 @@
1
1
  # frozen_string_literal: true
2
- gem 'blacklight', '~> 7.0'
3
- gem 'geoblacklight', '~> 4.0.0.pre.rc3'
4
- gem 'sprockets', '< 4.0' # Use sprockets less than 4.0, let webpacker users set this up themselves
2
+
3
+ gem "blacklight", "~> 7.0"
4
+ gem "geoblacklight", "~> 4.0"
5
+ gem "sprockets", "< 4.0" # Use sprockets less than 4.0, let webpacker users set this up themselves
5
6
 
6
7
  # Hack for https://github.com/rails/rails/issues/35153
7
8
  # Adapted from https://github.com/projectblacklight/blacklight/pull/2065
8
- gemfile = File.expand_path('Gemfile')
9
+ gemfile = File.expand_path("Gemfile")
9
10
  File.write(gemfile, File.open(gemfile) do |f|
10
11
  text = f.read
11
12
  text.gsub(/^gem 'sqlite3'$/, 'gem "sqlite3", "~> 1.3.6"')
12
13
  end)
13
14
 
14
- run 'bundle install'
15
+ run "bundle install"
15
16
 
16
- generate 'blacklight:install', '--devise'
17
- generate 'geoblacklight:install', '-f'
17
+ generate "blacklight:install", "--devise"
18
+ generate "geoblacklight:install", "-f"
18
19
 
19
- rake 'db:migrate'
20
+ rake "db:migrate"