geo_concerns 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.fcrepo_wrapper +3 -0
  3. data/.gitignore +1 -0
  4. data/.solr_wrapper +7 -0
  5. data/.travis.yml +7 -1
  6. data/Gemfile +15 -11
  7. data/README.md +2 -2
  8. data/Rakefile +10 -7
  9. data/app/assets/javascripts/geo_concerns/bounding_box_selector.js +12 -4
  10. data/app/assets/stylesheets/geo_concerns/bounding_box.scss +5 -0
  11. data/app/controllers/concerns/geo_concerns/download_behavior.rb +2 -1
  12. data/app/helpers/geo_concerns/bounding_box_helper.rb +49 -2
  13. data/app/processors/geo_concerns/processors/ogr.rb +1 -1
  14. data/app/renderers/geo_concerns/coverage_renderer.rb +15 -12
  15. data/app/schemas/geo_concerns/basic_geo_metadata_optional.rb +1 -1
  16. data/app/schemas/geo_concerns/basic_geo_metadata_required.rb +1 -1
  17. data/app/services/geo_concerns/derivative_path.rb +1 -1
  18. data/app/views/geo_concerns/_attributes.html.erb +2 -2
  19. data/app/views/geo_concerns/file_sets/media_display/_geo.html.erb +18 -13
  20. data/geo_concerns.gemspec +7 -4
  21. data/lib/generators/geo_concerns/install_generator.rb +4 -0
  22. data/lib/geo_concerns/version.rb +1 -1
  23. data/solr/config/solrconfig.xml +11 -2
  24. data/spec/controllers/image_works_controller_spec.rb +2 -2
  25. data/spec/controllers/raster_works_controller_spec.rb +1 -1
  26. data/spec/controllers/vector_works_controller_spec.rb +3 -3
  27. data/spec/features/create_raster_work_spec.rb +2 -4
  28. data/spec/forms/geo_concerns/raster_work_form_spec.rb +4 -2
  29. data/spec/forms/geo_concerns/vector_work_form_spec.rb +4 -2
  30. data/spec/helpers/bounding_box_helper_spec.rb +5 -0
  31. data/spec/models/image_file_spec.rb +1 -1
  32. data/spec/models/image_work_spec.rb +2 -2
  33. data/spec/models/raster_file_spec.rb +1 -1
  34. data/spec/models/raster_work_spec.rb +3 -3
  35. data/spec/models/solr_document_spec.rb +2 -2
  36. data/spec/models/vector_file_spec.rb +1 -1
  37. data/spec/models/vector_work_spec.rb +2 -2
  38. data/spec/processors/geo_concerns/processors/ogr_spec.rb +1 -1
  39. data/spec/renderers/geo_concerns/coverage_renderer_spec.rb +1 -1
  40. data/spec/services/derivative_path_spec.rb +5 -5
  41. data/spec/spec_helper.rb +22 -0
  42. data/spec/support/backport_test.rb +14 -0
  43. data/spec/support/helpers/controller_level_helpers.rb +27 -0
  44. data/spec/support/views/test_view_helpers.rb +10 -0
  45. data/tasks/geo_concerns.rake +39 -0
  46. data/template.rb +2 -2
  47. metadata +43 -19
  48. data/spec/support/devise.rb +0 -10
  49. data/spec/support/devise_helpers.rb +0 -6
  50. data/tasks/ci.rake +0 -49
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3cf1d76ece3afbe31d08c30a02dd05876fad50e1
4
- data.tar.gz: ffd2bd3a01ea694c65df13ff3bc2f2055b0d0430
3
+ metadata.gz: 255bdd173366bc1acb75b272d840a49da4880844
4
+ data.tar.gz: 785b290a3b6d94dd1d972b7c7e1e42cbd5e2f2ca
5
5
  SHA512:
6
- metadata.gz: a7a89521739103364461925d683859f226b03f495be20c98dfc803d4fe1e584cea3b0ac084b550c19cb8d509dd693078a942deb5c6ca741ebd9a63e58f661a24
7
- data.tar.gz: c08799ec54e6448954be8b61b57dfb729074d6930f30f3088786762b528b2b1443b3ba1498c66ec1f59c09ae1120fdd3768dc15bb396e50831e0a46ae42f7c40
6
+ metadata.gz: 69859a3c2e3909cbefc8f48d6acf52c6a781d18163744f2d9d1bb81e688fcdb0fbb782f85b58fcca2c5a8a3edf0ce7afb9e05298b0b126b6228f07a56eda277e
7
+ data.tar.gz: f205a24f9e51d3dcbd47a1fe803d2d0a530b98f3cd370a9c878ddc5a8045ad723d1043c559037ab8ab83fea06dfbc53acaa5a0b6daf1a03646e1a215baf09e86
data/.fcrepo_wrapper ADDED
@@ -0,0 +1,3 @@
1
+ # Place any default configuration for fcrepo_wrapper here
2
+ port: 8984
3
+ enable_jms: false
data/.gitignore CHANGED
@@ -11,3 +11,4 @@ test/dummy/.sass-cache
11
11
  fcrepo4-data
12
12
  Gemfile.lock
13
13
  coverage
14
+ fcrepo4-test-data/
data/.solr_wrapper ADDED
@@ -0,0 +1,7 @@
1
+ # Place any default configuration for solr_wrapper here
2
+ version: 6.2.0
3
+ port: 8983
4
+ collection:
5
+ persist: true
6
+ dir: solr/config/
7
+ name: hydra-development
data/.travis.yml CHANGED
@@ -1,11 +1,17 @@
1
1
  language: ruby
2
2
  sudo: true
3
3
  rvm:
4
- - 2.3.0
4
+ - 2.2.2 # oldest version supported by Rails 5
5
+ - 2.3.1 # latest release
5
6
  env:
6
7
  global:
7
8
  - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
8
9
  - MAPNIK_VERSION="2.3"
10
+ matrix:
11
+ - RAILS_VERSION=4.2.7
12
+ RDF_VERSION=1.99.1
13
+ - RAILS_VERSION=5.0.0
14
+ RDF_VERSION=2.1.0
9
15
  before_install:
10
16
  - sudo apt-add-repository --yes ppa:mapnik/nightly-${MAPNIK_VERSION}
11
17
  - sudo apt-get update -y
data/Gemfile CHANGED
@@ -6,15 +6,17 @@ source 'https://rubygems.org'
6
6
  gemspec
7
7
 
8
8
  group :development, :test do
9
+ # Peg simplecov to < 0.8 until this is resolved:
10
+ # https://github.com/colszowka/simplecov/issues/281
9
11
  gem 'simplecov', '~> 0.9', require: false
10
12
  gem 'coveralls', require: false
11
13
  end
12
14
 
13
15
  # BEGIN ENGINE_CART BLOCK
14
- # engine_cart: 0.8.2
15
- # engine_cart stanza: 0.8.0
16
+ # engine_cart: 0.10.0
17
+ # engine_cart stanza: 0.10.0
16
18
  # the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
17
- file = File.expand_path("Gemfile", ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path(".internal_test_app", File.dirname(__FILE__)))
19
+ file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app', File.dirname(__FILE__)))
18
20
  if File.exist?(file)
19
21
  begin
20
22
  eval_gemfile file
@@ -28,19 +30,21 @@ else
28
30
  if ENV['RAILS_VERSION']
29
31
  if ENV['RAILS_VERSION'] == 'edge'
30
32
  gem 'rails', github: 'rails/rails'
31
- ENV['ENGINE_CART_RAILS_OPTIONS']= "--edge --skip-turbolinks"
33
+ ENV['ENGINE_CART_RAILS_OPTIONS'] = '--edge --skip-turbolinks'
32
34
  else
33
35
  gem 'rails', ENV['RAILS_VERSION']
34
36
  end
35
37
  end
36
38
 
37
- if ENV['RAILS_VERSION'].nil? || ENV['RAILS_VERSION'] =~ /^4.2/
38
- gem 'responders', "~> 2.0"
39
- gem 'sass-rails', ">= 5.0"
40
- elsif ENV['RAILS_VERSION'] =~ /^5.0/ || ENV['RAILS_VERSION'] == 'edge'
41
- # nop
42
- else
43
- gem 'sass-rails', "< 5.0"
39
+ case ENV['RAILS_VERSION']
40
+ when /^4.2/
41
+ gem 'responders', '~> 2.0'
42
+ gem 'sass-rails', '>= 5.0'
43
+ gem 'coffee-rails', '~> 4.1.0'
44
+ when /^4.[01]/
45
+ gem 'sass-rails', '< 5.0'
44
46
  end
45
47
  end
46
48
  # END ENGINE_CART BLOCK
49
+
50
+ gem 'rails-controller-testing' if !ENV['RAILS_VERSION'] || ENV['RAILS_VERSION'] =~ /^5\./
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Geo Concerns
2
- [![Build Status](https://travis-ci.org/projecthydra-labs/geo_concerns.svg)](https://travis-ci.org/projecthydra-labs/geo_concerns)
2
+ [![Build Status](https://travis-ci.org/projecthydra-labs/geo_concerns.svg?branch=master)](https://travis-ci.org/projecthydra-labs/geo_concerns)
3
3
  [![Coverage Status](https://coveralls.io/repos/github/projecthydra-labs/geo_concerns/badge.svg?branch=master)](https://coveralls.io/github/projecthydra-labs/geo_concerns?branch=master)
4
4
  [![API Docs](http://img.shields.io/badge/API-docs-blue.svg)](http://www.rubydoc.info/github/projecthydra-labs/geo_concerns)
5
5
  [![Gem Version](https://img.shields.io/gem/v/geo_concerns.svg)](https://github.com/projecthydra-labs/geo_concerns/releases)
@@ -7,7 +7,7 @@
7
7
  Rails application for developing Hydra Geo models. Built around Curation Concerns engine.
8
8
 
9
9
  * [Poster from Hydra Connect 2015](https://drive.google.com/file/d/0B5fLh2mc4FCbOUpWaTFOVmI4Nkk/view?pli=1)
10
- * [Current GeoConcerns diagram](https://github.com/projecthydra-labs/geo_concerns/raw/master/docs/pcdm-geo-model.pdf)
10
+ * [Current GeoConcerns diagram](https://wiki.duraspace.org/download/attachments/69012114/pcdm-geo-model.pdf?version=1&modificationDate=1463590066822&api=v2)
11
11
 
12
12
 
13
13
  ## Dependencies
data/Rakefile CHANGED
@@ -6,16 +6,19 @@ end
6
6
  require 'engine_cart/rake_task'
7
7
  require 'rspec/core/rake_task'
8
8
  require 'rubocop/rake_task'
9
- RuboCop::RakeTask.new(:rubocop) do |task|
10
- task.requires << 'rubocop-rspec'
11
- task.fail_on_error = true
12
- end
13
- task spec: :rubocop do
14
- RSpec::Core::RakeTask.new(:spec)
15
- end
9
+ require 'active_fedora/rake_support'
10
+
16
11
  Dir.glob('tasks/*.rake').each { |r| import r }
17
12
 
18
13
  Bundler::GemHelper.install_tasks
19
14
 
15
+ desc 'Run test suite and style checker'
16
+ task spec: ['geo_concerns:spec']
17
+
18
+ desc 'Spin up Solr & Fedora and run the test suite'
19
+ task ci: ['geo_concerns:rubocop', 'engine_cart:generate'] do
20
+ Rake::Task['spec'].invoke
21
+ end
22
+
20
23
  task clean: 'engine_cart:clean'
21
24
  task default: :ci
@@ -18,7 +18,9 @@ function boundingBoxSelector(options) {
18
18
  scrollWheelZoom: false
19
19
  }).fitBounds(initialBounds);
20
20
 
21
- L.tileLayer('https://otile1-s.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', {
21
+ updateBboxInputs(initialBounds);
22
+
23
+ L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png', {
22
24
  maxZoom: 18
23
25
  }).addTo(map);
24
26
  L.Control.geocoder({ position: 'topleft' }).addTo(map);
@@ -28,12 +30,10 @@ function boundingBoxSelector(options) {
28
30
  } else {
29
31
  boundingBox = new L.BoundingBox({ bounds: initialBounds,
30
32
  buttonPosition: 'topright', }).addTo(map);
31
- boundingBox.on('change', function() {
32
- $(inputId).val(boundsToCoverage(this.getBounds()));
33
- });
34
33
 
35
34
  boundingBox.on('change', function() {
36
35
  $(inputId).val(boundsToCoverage(this.getBounds()));
36
+ updateBboxInputs(this.getBounds())
37
37
  });
38
38
 
39
39
  boundingBox.enable();
@@ -98,3 +98,11 @@ function boundsToCoverage(bounds) {
98
98
  return '';
99
99
  }
100
100
  };
101
+
102
+ function updateBboxInputs(bounds) {
103
+ bounds = clampBounds(bounds);
104
+ $('#bbox-north').val(bounds.getNorth().toFixed(6));
105
+ $('#bbox-east').val(bounds.getEast().toFixed(6));
106
+ $('#bbox-south').val(bounds.getSouth().toFixed(6));
107
+ $('#bbox-west').val(bounds.getWest().toFixed(6));
108
+ };
@@ -5,3 +5,8 @@
5
5
  .leaflet-control-attribution {
6
6
  display: none;
7
7
  }
8
+
9
+ .bbox-inputs {
10
+ margin-top: 10px;
11
+ margin-bottom: 10px;
12
+ }
@@ -12,7 +12,8 @@ module GeoConcerns
12
12
  def load_file
13
13
  file_reference = params[:file]
14
14
  return default_file unless file_reference
15
- file_path = GeoConcerns::DerivativePath.derivative_path_for_reference(asset, file_reference)
15
+ file_path = GeoConcerns::DerivativePath.derivative_path_for_reference(params[asset_param_key],
16
+ file_reference)
16
17
  File.exist?(file_path) ? file_path : nil
17
18
  end
18
19
  end
@@ -7,12 +7,59 @@ module GeoConcerns
7
7
  # @param [Symbol] name of property that holds bounding box string
8
8
  # @return[String]
9
9
  def bbox(property)
10
+ markup = ''
11
+ markup << %(<div id='bbox'></div>)
12
+ markup << bbox_display_inputs
13
+ markup << bbox_script_tag(property)
14
+ markup.html_safe
15
+ end
16
+
17
+ ##
18
+ # Returns markup for a row of read only bounding box inputs.
19
+ # @return[String]
20
+ # rubocop:disable MethodLength
21
+ def bbox_display_inputs
22
+ %(
23
+ <div class="row bbox-inputs">
24
+ <div class="col-lg-3">
25
+ <div class="input-group">
26
+ <span class="input-group-addon">North</span>
27
+ <input readonly id="bbox-north" type="text" class="form-control bbox-input">
28
+ </div>
29
+ </div>
30
+ <div class="col-lg-3">
31
+ <div class="input-group">
32
+ <span class="input-group-addon">East</span>
33
+ <input readonly id="bbox-east" type="text" class="form-control bbox-input">
34
+ </div>
35
+ </div>
36
+ <div class="col-lg-3">
37
+ <div class="input-group">
38
+ <span class="input-group-addon">South</span>
39
+ <input readonly id="bbox-south" type="text" class="form-control bbox-input">
40
+ </div>
41
+ </div>
42
+ <div class="col-lg-3">
43
+ <div class="input-group">
44
+ <span class="input-group-addon">West</span>
45
+ <input readonly id="bbox-west" type="text" class="form-control bbox-input">
46
+ </div>
47
+ </div>
48
+ </div>
49
+ )
50
+ end
51
+ # rubocop:enable MethodLength
52
+
53
+ ##
54
+ # Returns script tag markup for loading the bounding box selector.
55
+ # @param[Symbol] name of property that holds bounding box string
56
+ # @return[String] script tag
57
+ def bbox_script_tag(property)
10
58
  %(
11
- <div id='bbox'></div>
12
59
  <script>
13
60
  boundingBoxSelector({inputId: #{bbox_input_id(property)}});
14
61
  </script>
15
- ).html_safe
62
+ )
16
63
  end
17
64
 
18
65
  ##
@@ -11,7 +11,7 @@ module GeoConcerns
11
11
  # @param out_path [String] processor output file path
12
12
  def self.reproject(in_path, out_path, options)
13
13
  execute "env SHAPE_ENCODING= ogr2ogr -q -nln #{options[:basename]} -f 'ESRI Shapefile'"\
14
- " -t_srs #{options[:output_srid]} '#{out_path}' '#{in_path}'"
14
+ " -t_srs #{options[:output_srid]} -preserve_fid '#{out_path}' '#{in_path}'"
15
15
  end
16
16
  end
17
17
  end
@@ -1,5 +1,7 @@
1
1
  module GeoConcerns
2
2
  class CoverageRenderer < CurationConcerns::Renderers::AttributeRenderer
3
+ include BoundingBoxHelper
4
+
3
5
  def render
4
6
  coverage = values.first if values
5
7
  return '' unless coverage
@@ -11,26 +13,27 @@ module GeoConcerns
11
13
  def markup(coverage)
12
14
  markup = ''
13
15
  markup << %(<tr><th>#{label}</th>\n<td id='accordion'><ul class='tabular'>)
14
- markup << value(coverage)
16
+ markup << %(<div id='bbox' class='collapse in'></div>)
17
+ markup << bbox_display_inputs
18
+ markup << bbox_script_tag(coverage)
15
19
  markup << toggle_button
16
- markup << map(coverage)
17
20
  markup << %(</ul></td></tr>)
18
21
  markup
19
22
  end
20
23
 
21
- def value(coverage)
22
- attributes = microdata_object_attributes(field).merge(class: "attribute #{field}")
23
- %(<li#{html_attributes(attributes)}>#{attribute_value_to_html(coverage.to_s)})
24
- end
25
-
26
24
  def toggle_button
27
- %( <a data-toggle='collapse' data-parent='accordion' href='#bbox' class='btn btn-default'>
28
- Toggle Map</a>)
25
+ %(
26
+ <a data-toggle='collapse' data-parent='accordion' href='#bbox' class='btn btn-default'>
27
+ Toggle Map</a>
28
+ )
29
29
  end
30
30
 
31
- def map(coverage)
32
- %(<div id='bbox' class='collapse in'></div>
33
- <script>boundingBoxSelector({coverage: '#{coverage}', readonly: true});</script>)
31
+ def bbox_script_tag(coverage)
32
+ %(
33
+ <script>
34
+ boundingBoxSelector({coverage: '#{coverage}', readonly: true});
35
+ </script>
36
+ )
34
37
  end
35
38
  end
36
39
  end
@@ -3,7 +3,7 @@ module GeoConcerns
3
3
  #
4
4
  # The following properties are inherited from Curation Concerns' metadata
5
5
  #
6
- # @see https://github.com/projecthydra-labs/curation_concerns/blob/master/curation_concerns-models/app/models/concerns/curation_concerns/basic_metadata.rb
6
+ # @see https://github.com/projecthydra/curation_concerns/blob/v1.5.0/app/models/concerns/curation_concerns/basic_metadata.rb
7
7
  # Optional:
8
8
  # :contributor
9
9
  # :creator
@@ -3,7 +3,7 @@ module GeoConcerns
3
3
  #
4
4
  # The following properties are inherited from Curation Concerns' metadata
5
5
  #
6
- # @see https://github.com/projecthydra-labs/curation_concerns/blob/master/curation_concerns-models/app/models/concerns/curation_concerns/required_metadata.rb
6
+ # @see https://github.com/projecthydra/curation_concerns/blob/v1.5.0/app/models/concerns/curation_concerns/required_metadata.rb
7
7
  # Required:
8
8
  # :title
9
9
  # :date_uploaded (DC.dateSubmitted)
@@ -1,6 +1,6 @@
1
1
  module GeoConcerns
2
2
  class DerivativePath < CurationConcerns::DerivativePath
3
- def self.extension_for(destination_name)
3
+ def self.extension(destination_name)
4
4
  case destination_name
5
5
  when 'thumbnail'
6
6
  ".#{MIME::Types.type_for('jpg').first.extensions.first}"
@@ -6,8 +6,8 @@
6
6
  <tbody>
7
7
  <%= render 'geo_concerns/attribute_rows', presenter: presenter %>
8
8
  <%= presenter.attribute_to_html(:permission_badge, label: 'Visibility') %>
9
- <%= presenter.attribute_to_html(:embargo_release_date) %>
10
- <%= presenter.attribute_to_html(:lease_expiration_date) %>
9
+ <%= presenter.attribute_to_html(:embargo_release_date, render_as: :date) %>
10
+ <%= presenter.attribute_to_html(:lease_expiration_date, render_as: :date) %>
11
11
  <%= presenter.attribute_to_html(:rights, render_as: :rights) %>
12
12
  </tbody>
13
13
  </table>
@@ -1,16 +1,21 @@
1
1
  <% if CurationConcerns.config.display_media_download_link %>
2
- <%= link_to main_app.download_path(file_set), target: "_new", title: "Download the data" do %>
3
- <figure>
4
- <%= image_tag main_app.download_path(file_set, file: 'thumbnail'),
5
- class: "img-responsive",
6
- alt: "Download the data for #{file_set.to_s}" %>
7
- <figcaption>Download the data</figcaption>
8
- </figure>
9
- <% end %>
2
+ <div>
3
+ <h2 class="sr-only"><%= t('curation_concerns.show.downloadable_content.heading') %></h2>
4
+ <%= image_tag thumbnail_url(file_set),
5
+ class: "representative-media",
6
+ alt: "",
7
+ role: "presentation" %>
8
+ <%= link_to main_app.download_path(file_set),
9
+ target: "_new",
10
+ class: "btn btn-default" do %>
11
+ <%= 'Download data' %>
12
+ <% end %>
13
+ </div>
10
14
  <% else %>
11
- <figure>
12
- <%= image_tag main_app.download_path(file_set, file: 'thumbnail'),
13
- class: "img-responsive",
14
- alt: "Thumbnail of #{file_set.to_s}" %>
15
- </figure>
15
+ <div>
16
+ <%= image_tag thumbnail_url(file_set),
17
+ class: "representative-media",
18
+ alt: "",
19
+ role: "presentation" %>
20
+ </div>
16
21
  <% end %>
data/geo_concerns.gemspec CHANGED
@@ -18,15 +18,18 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.add_dependency 'curation_concerns', '1.0.0.beta7'
21
+ spec.required_ruby_version = '>= 2.2.2' # same as Rails 5
22
+
23
+ spec.add_dependency 'curation_concerns', '1.5.0'
22
24
  spec.add_dependency 'leaflet-rails', '~> 0.7'
23
- spec.add_dependency 'simple_mapnik', '0.0.9'
25
+ spec.add_dependency 'simple_mapnik', '0.1.0'
24
26
  spec.add_dependency 'json-schema'
25
27
 
26
28
  spec.add_development_dependency 'sqlite3'
29
+ spec.add_development_dependency 'devise', '>= 3.0', '< 5'
27
30
  spec.add_development_dependency 'rspec-rails'
28
- spec.add_development_dependency 'engine_cart', '~> 0.8'
29
- spec.add_development_dependency 'solr_wrapper', '~> 0.10'
31
+ spec.add_development_dependency 'engine_cart', '~> 0.10'
32
+ spec.add_development_dependency 'solr_wrapper', '>= 0.13.1'
30
33
  spec.add_development_dependency 'fcrepo_wrapper', '~> 0.1'
31
34
  spec.add_development_dependency 'pry-byebug'
32
35
  spec.add_development_dependency 'database_cleaner', '< 1.1.0'
@@ -134,6 +134,10 @@ module GeoConcerns
134
134
  def install_assets
135
135
  copy_file 'geo_concerns.js', 'app/assets/javascripts/geo_concerns.js'
136
136
  copy_file 'geo_concerns.scss', 'app/assets/stylesheets/geo_concerns.scss'
137
+ file_path = 'app/assets/javascripts/application.js'
138
+ inject_into_file file_path, before: %r{\/\/= require_tree \..*$} do
139
+ "//= require geo_concerns\n"
140
+ end
137
141
  end
138
142
 
139
143
  private
@@ -1,3 +1,3 @@
1
1
  module GeoConcerns
2
- VERSION = "0.0.6".freeze
2
+ VERSION = "0.0.7".freeze
3
3
  end
@@ -102,7 +102,6 @@
102
102
  -->
103
103
  <str name="qf">
104
104
  id
105
- active_fedora_model_ssi
106
105
  title_tesim
107
106
  author_tesim
108
107
  subject_tesim
@@ -188,6 +187,17 @@
188
187
  </lst>
189
188
  </requestHandler>
190
189
 
190
+ <searchComponent name="termsComponent" class="solr.TermsComponent" />
191
+
192
+ <requestHandler name="/terms" class="solr.SearchHandler">
193
+ <lst name="defaults">
194
+ <bool name="terms">true</bool>
195
+ </lst>
196
+ <arr name="components">
197
+ <str>termsComponent</str>
198
+ </arr>
199
+ </requestHandler>
200
+
191
201
  <!-- Spell Check
192
202
 
193
203
  The spell check component can return a list of alternative spelling
@@ -309,4 +319,3 @@
309
319
  <!-- </lst> -->
310
320
  </requestHandler>
311
321
  </config>
312
-
@@ -17,7 +17,7 @@ describe CurationConcerns::ImageWorksController, type: :controller do
17
17
  it "is a success" do
18
18
  image = FactoryGirl.create(:image_work, user: user)
19
19
 
20
- get :show, id: image.id
20
+ get :show, params: { id: image.id }
21
21
  expect(response).to be_success
22
22
  end
23
23
  end
@@ -33,7 +33,7 @@ describe CurationConcerns::ImageWorksController, type: :controller do
33
33
  let(:work) { FactoryGirl.create(:image_work, user: user) }
34
34
  it 'creates an image work' do
35
35
  allow(controller).to receive(:curation_concern).and_return(work)
36
- post :create, image_work: { title: ['a title'] }
36
+ post :create, params: { image_work: { title: ['a title'] } }
37
37
  expect(response).to redirect_to main_app.curation_concerns_image_work_path(work)
38
38
  end
39
39
  end
@@ -17,7 +17,7 @@ describe CurationConcerns::RasterWorksController, type: :controller do
17
17
  image.save
18
18
  raster.update_index
19
19
 
20
- get :show, id: raster.id
20
+ get :show, params: { id: raster.id }
21
21
  expect(response).to be_success
22
22
  end
23
23
  end
@@ -17,7 +17,7 @@ describe CurationConcerns::VectorWorksController, type: :controller do
17
17
  raster.save
18
18
  vector.update_index
19
19
 
20
- get :show, id: vector.id
20
+ get :show, params: { id: vector.id }
21
21
  expect(response).to be_success
22
22
  end
23
23
  end
@@ -44,7 +44,7 @@ describe CurationConcerns::VectorWorksController, type: :controller do
44
44
  end
45
45
 
46
46
  it 'renders the document' do
47
- get :geoblacklight, id: vector_work.id, format: :json
47
+ get :geoblacklight, params: { id: vector_work.id, format: :json }
48
48
  expect(response).to be_success
49
49
  end
50
50
  end
@@ -55,7 +55,7 @@ describe CurationConcerns::VectorWorksController, type: :controller do
55
55
  end
56
56
 
57
57
  it 'returns an error message with a 404 status' do
58
- get :geoblacklight, id: vector_work.id, format: :json
58
+ get :geoblacklight, params: { id: vector_work.id, format: :json }
59
59
  expect(response.body).to include('problem')
60
60
  expect(response.status).to eq(404)
61
61
  end
@@ -6,7 +6,7 @@ RSpec.feature 'RasterWorkController', type: :feature do
6
6
 
7
7
  context "an authorized user" do
8
8
  before do
9
- expect(CharacterizeJob).to receive(:perform_later)
9
+ allow(CharacterizeJob).to receive(:perform_later)
10
10
  sign_in user
11
11
  end
12
12
 
@@ -46,9 +46,7 @@ RSpec.feature 'RasterWorkController', type: :feature do
46
46
  click_button 'Attach to Vector Work'
47
47
 
48
48
  expect(page).to have_text 'zipcodes_fgdc.xml'
49
-
50
- click_link 'Download'
51
- expect(page).to have_text '7F6FAACA-6BBB-4199-BDC5-51D038E4431C'
49
+ expect(page).to have_selector(:link_or_button, 'Download')
52
50
  end
53
51
  end
54
52
  end
@@ -9,7 +9,9 @@ describe GeoConcerns::RasterWorkForm do
9
9
 
10
10
  describe '.model_attributes' do
11
11
  subject { described_class.model_attributes(raw_attributes) }
12
- it { is_expected.to include('coverage' => coverage.to_s) }
13
- it { is_expected.to include('cartographic_projection' => 'urn:ogc:def:crs:EPSG:6.3:26986') }
12
+ it 'has the correct attributes' do
13
+ expect(subject['coverage']).to eq coverage.to_s
14
+ expect(subject['cartographic_projection']).to eq 'urn:ogc:def:crs:EPSG:6.3:26986'
15
+ end
14
16
  end
15
17
  end
@@ -9,7 +9,9 @@ describe GeoConcerns::VectorWorkForm do
9
9
 
10
10
  describe '.model_attributes' do
11
11
  subject { described_class.model_attributes(raw_attributes) }
12
- it { is_expected.to include('coverage' => coverage.to_s) }
13
- it { is_expected.to include('cartographic_projection' => 'urn:ogc:def:crs:EPSG:6.3:26986') }
12
+ it 'has the correct attributes' do
13
+ expect(subject['coverage']).to eq coverage.to_s
14
+ expect(subject['cartographic_projection']).to eq 'urn:ogc:def:crs:EPSG:6.3:26986'
15
+ end
14
16
  end
15
17
  end
@@ -26,6 +26,11 @@ describe GeoConcerns::BoundingBoxHelper do
26
26
  end
27
27
  end
28
28
 
29
+ describe '#bbox_display_inputs' do
30
+ subject { helper.bbox_display_inputs }
31
+ it { is_expected.to include('North', 'East', 'South', 'West') }
32
+ end
33
+
29
34
  describe '#base_input_id' do
30
35
  it 'returns the id of the bounding box input element' do
31
36
  expect(helper.bbox_input_id(property)).to eq('vector_work_coverage')
@@ -21,7 +21,7 @@ describe FileSet do
21
21
  let(:work) { FactoryGirl.create(:image_work_with_one_file) }
22
22
  subject { work.file_sets.first.reload }
23
23
  it 'belongs to image work' do
24
- expect(subject.image_work).to eq [work]
24
+ expect(subject.image_work).to match_array [work]
25
25
  end
26
26
  end
27
27
 
@@ -29,8 +29,8 @@ describe ImageWork do
29
29
  subject.members << raster1
30
30
  subject.members << raster2
31
31
  expect(subject.image_file).to eq image_file1
32
- expect(subject.metadata_files).to eq [ext_metadata_file1, ext_metadata_file2]
33
- expect(subject.raster_works).to eq [raster1, raster2]
32
+ expect(subject.metadata_files).to match_array [ext_metadata_file1, ext_metadata_file2]
33
+ expect(subject.raster_works).to match_array [raster1, raster2]
34
34
  end
35
35
  it 'defines what type of object it is' do
36
36
  expect(subject.image_work?).to be_truthy
@@ -17,7 +17,7 @@ describe FileSet do
17
17
  let(:work) { FactoryGirl.create(:raster_work_with_one_file) }
18
18
  subject { work.file_sets.first.reload }
19
19
  it 'belongs to raster work' do
20
- expect(subject.raster_work).to eq [work]
20
+ expect(subject.raster_work).to match_array [work]
21
21
  end
22
22
  end
23
23
 
@@ -39,9 +39,9 @@ describe RasterWork do
39
39
  subject.members << ext_metadata_file2
40
40
  subject.members << vector1
41
41
  subject.members << vector2
42
- expect(subject.raster_files).to eq [raster_file1, raster_file2]
43
- expect(subject.metadata_files).to eq [ext_metadata_file1, ext_metadata_file2]
44
- expect(subject.vector_works).to eq [vector1, vector2]
42
+ expect(subject.raster_files).to match_array [raster_file1, raster_file2]
43
+ expect(subject.metadata_files).to match_array [ext_metadata_file1, ext_metadata_file2]
44
+ expect(subject.vector_works).to match_array [vector1, vector2]
45
45
  end
46
46
  it 'defines what type of object it is' do
47
47
  expect(subject.raster_work?).to be_truthy
@@ -6,13 +6,13 @@ describe SolrDocument do
6
6
  describe "spatial" do
7
7
  let(:attributes) { { Solrizer.solr_name('spatial') => ['one', 'two'] } }
8
8
  subject { document.spatial }
9
- it { is_expected.to eq ['one', 'two'] }
9
+ it { is_expected.to match_array ['one', 'two'] }
10
10
  end
11
11
 
12
12
  describe "temporal" do
13
13
  let(:attributes) { { Solrizer.solr_name('temporal') => ['one', 'two'] } }
14
14
  subject { document.temporal }
15
- it { is_expected.to eq ['one', 'two'] }
15
+ it { is_expected.to match_array ['one', 'two'] }
16
16
  end
17
17
 
18
18
  describe "issued" do
@@ -17,7 +17,7 @@ describe FileSet do
17
17
  let(:work) { FactoryGirl.create(:vector_work_with_one_file) }
18
18
  subject { work.file_sets.first.reload }
19
19
  it 'belongs to vector work' do
20
- expect(subject.vector_work).to eq [work]
20
+ expect(subject.vector_work).to match_array [work]
21
21
  end
22
22
  end
23
23
 
@@ -15,8 +15,8 @@ describe VectorWork do
15
15
  subject.members << vector_file2
16
16
  subject.members << ext_metadata_file1
17
17
  subject.members << ext_metadata_file2
18
- expect(subject.vector_files).to eq [vector_file1, vector_file2]
19
- expect(subject.metadata_files).to eq [ext_metadata_file1, ext_metadata_file2]
18
+ expect(subject.vector_files).to match_array [vector_file1, vector_file2]
19
+ expect(subject.metadata_files).to match_array [ext_metadata_file1, ext_metadata_file2]
20
20
  end
21
21
 
22
22
  it 'defines what type of object it is' do
@@ -28,7 +28,7 @@ describe GeoConcerns::Processors::BaseGeoProcessor do
28
28
  describe '#reproject' do
29
29
  it 'executes a reproject command' do
30
30
  command = "env SHAPE_ENCODING= ogr2ogr -q -nln -f 'ESRI Shapefile' "\
31
- "-t_srs EPSG:4326 'output/geo.png' 'files/geo.zip'"
31
+ "-t_srs EPSG:4326 -preserve_fid 'output/geo.png' 'files/geo.zip'"
32
32
  expect(subject.class).to receive(:execute).with command
33
33
  subject.class.reproject(file_name, output_file, options)
34
34
  end
@@ -11,7 +11,7 @@ describe GeoConcerns::CoverageRenderer do
11
11
 
12
12
  it 'includes a map' do
13
13
  expect(subject).to include "<div id='bbox'"
14
- expect(subject).to include "<script>boundingBoxSelector"
14
+ expect(subject).to include "boundingBoxSelector"
15
15
  end
16
16
 
17
17
  it 'includes a toggle button' do
@@ -1,12 +1,12 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe GeoConcerns::DerivativePath do
4
- describe '#extension_for' do
4
+ describe '#extension' do
5
5
  it 'returns the appropriate file extension for a geo derivative' do
6
- expect(described_class.extension_for('thumbnail')).to eq('.jpeg')
7
- expect(described_class.extension_for('display_raster')).to eq('.tif')
8
- expect(described_class.extension_for('display_vector')).to eq('.zip')
9
- expect(described_class.extension_for('simplified')).to eq('.simplified')
6
+ expect(described_class.extension('thumbnail')).to eq('.jpeg')
7
+ expect(described_class.extension('display_raster')).to eq('.tif')
8
+ expect(described_class.extension('display_vector')).to eq('.zip')
9
+ expect(described_class.extension('simplified')).to eq('.simplified')
10
10
  end
11
11
  end
12
12
  end
data/spec/spec_helper.rb CHANGED
@@ -31,4 +31,26 @@ RSpec.configure do |config|
31
31
  mocks.verify_partial_doubles = true
32
32
  end
33
33
  config.fixture_path = File.expand_path("../fixtures", __FILE__)
34
+
35
+ config.include FactoryGirl::Syntax::Methods
36
+ if defined? Devise::Test::ControllerHelpers
37
+ config.include Devise::Test::ControllerHelpers, type: :controller
38
+ config.include Devise::Test::ControllerHelpers, type: :view
39
+ else
40
+ config.include Devise::TestHelpers, type: :controller
41
+ config.include Devise::TestHelpers, type: :view
42
+ end
43
+
44
+ config.include TestViewHelpers, type: :view
45
+
46
+ config.include(ControllerLevelHelpers, type: :helper)
47
+ config.before(:each, type: :helper) { initialize_controller_helpers(helper) }
48
+
49
+ config.include(ControllerLevelHelpers, type: :view)
50
+ config.before(:each, type: :view) { initialize_controller_helpers(view) }
51
+
52
+ config.include BackportTest, type: :controller unless Rails.version > '5'
53
+ config.include Controllers::EngineHelpers, type: :controller
54
+ config.include Controllers::EngineHelpers, type: :helper
55
+ config.include ::Rails.application.routes.url_helpers
34
56
  end
@@ -0,0 +1,14 @@
1
+ # Backport the Rails 5 controller test methods to Rails 4
2
+ module BackportTest
3
+ [:delete, :get, :post, :put, :patch].each do |http_action|
4
+ define_method(http_action) do |*args|
5
+ (action, rest) = *args
6
+ rest ||= {}
7
+ if rest[:xhr]
8
+ @request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest'
9
+ @request.env['HTTP_ACCEPT'] ||= [Mime::JS, Mime::HTML, Mime::XML, 'text/xml', Mime::ALL].join(', ')
10
+ end
11
+ super(action, rest[:params])
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,27 @@
1
+ module ControllerLevelHelpers
2
+ extend ActiveSupport::Concern
3
+ # def search_state
4
+ # @search_state ||= Blacklight::SearchState.new(params, blacklight_config)
5
+ # end
6
+
7
+ # def blacklight_configuration_context
8
+ # @blacklight_configuration_context ||= Blacklight::Configuration::Context.new(controller)
9
+ # end
10
+ #
11
+ included do
12
+ # fix for anonymous controllers (https://github.com/rspec/rspec-rails/issues/1321#issuecomment-239157093)
13
+ before { allow(controller).to receive(:_routes).and_return(Rails.application.routes) }
14
+ end
15
+
16
+ def initialize_controller_helpers(helper)
17
+ helper.extend ControllerLevelHelpers
18
+ initialize_routing_helpers(helper)
19
+ end
20
+
21
+ def initialize_routing_helpers(helper)
22
+ return unless Rails::VERSION::MAJOR >= 5
23
+
24
+ helper.class.include ::Rails.application.routes.url_helpers
25
+ helper.class.include ::Rails.application.routes.mounted_helpers if ::Rails.application.routes.respond_to?(:mounted_helpers)
26
+ end
27
+ end
@@ -0,0 +1,10 @@
1
+ module TestViewHelpers
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ before do
6
+ view.send(:extend, CurationConcerns::MainAppHelpers)
7
+ view.send(:extend, CatalogHelper)
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,39 @@
1
+ require 'solr_wrapper'
2
+ require 'fcrepo_wrapper'
3
+
4
+ namespace :geo_concerns do
5
+ desc 'Run style checker'
6
+ RuboCop::RakeTask.new(:rubocop) do |task|
7
+ task.requires << 'rubocop-rspec'
8
+ task.fail_on_error = true
9
+ end
10
+
11
+ RSpec::Core::RakeTask.new(:rspec)
12
+
13
+ desc 'Run test suite'
14
+ task :spec do
15
+ with_server 'test' do
16
+ Rake::Task['geo_concerns:rspec'].invoke
17
+ end
18
+ end
19
+ desc "Run development servers for Geo Concerns"
20
+ task :dev_servers do
21
+ with_server 'development' do
22
+ begin
23
+ sleep
24
+ rescue Interrupt
25
+ puts "Shutting down..."
26
+ end
27
+ end
28
+ end
29
+ desc "Run test servers for Geo Concerns"
30
+ task :test_servers do
31
+ with_server 'test' do
32
+ begin
33
+ sleep
34
+ rescue Interrupt
35
+ puts "Shutting down..."
36
+ end
37
+ end
38
+ end
39
+ end
data/template.rb CHANGED
@@ -1,5 +1,5 @@
1
- gem 'curation_concerns', '1.0.0.beta7'
2
- gem 'geo_concerns', '0.0.6'
1
+ gem 'curation_concerns', '1.5.0'
2
+ gem 'geo_concerns', '0.0.7'
3
3
 
4
4
  run 'bundle install'
5
5
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geo_concerns
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Griffin
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2016-06-06 00:00:00.000000000 Z
15
+ date: 2016-08-31 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: curation_concerns
@@ -20,14 +20,14 @@ dependencies:
20
20
  requirements:
21
21
  - - '='
22
22
  - !ruby/object:Gem::Version
23
- version: 1.0.0.beta7
23
+ version: 1.5.0
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
28
  - - '='
29
29
  - !ruby/object:Gem::Version
30
- version: 1.0.0.beta7
30
+ version: 1.5.0
31
31
  - !ruby/object:Gem::Dependency
32
32
  name: leaflet-rails
33
33
  requirement: !ruby/object:Gem::Requirement
@@ -48,14 +48,14 @@ dependencies:
48
48
  requirements:
49
49
  - - '='
50
50
  - !ruby/object:Gem::Version
51
- version: 0.0.9
51
+ version: 0.1.0
52
52
  type: :runtime
53
53
  prerelease: false
54
54
  version_requirements: !ruby/object:Gem::Requirement
55
55
  requirements:
56
56
  - - '='
57
57
  - !ruby/object:Gem::Version
58
- version: 0.0.9
58
+ version: 0.1.0
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: json-schema
61
61
  requirement: !ruby/object:Gem::Requirement
@@ -84,6 +84,26 @@ dependencies:
84
84
  - - ">="
85
85
  - !ruby/object:Gem::Version
86
86
  version: '0'
87
+ - !ruby/object:Gem::Dependency
88
+ name: devise
89
+ requirement: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: '3.0'
94
+ - - "<"
95
+ - !ruby/object:Gem::Version
96
+ version: '5'
97
+ type: :development
98
+ prerelease: false
99
+ version_requirements: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '3.0'
104
+ - - "<"
105
+ - !ruby/object:Gem::Version
106
+ version: '5'
87
107
  - !ruby/object:Gem::Dependency
88
108
  name: rspec-rails
89
109
  requirement: !ruby/object:Gem::Requirement
@@ -104,28 +124,28 @@ dependencies:
104
124
  requirements:
105
125
  - - "~>"
106
126
  - !ruby/object:Gem::Version
107
- version: '0.8'
127
+ version: '0.10'
108
128
  type: :development
109
129
  prerelease: false
110
130
  version_requirements: !ruby/object:Gem::Requirement
111
131
  requirements:
112
132
  - - "~>"
113
133
  - !ruby/object:Gem::Version
114
- version: '0.8'
134
+ version: '0.10'
115
135
  - !ruby/object:Gem::Dependency
116
136
  name: solr_wrapper
117
137
  requirement: !ruby/object:Gem::Requirement
118
138
  requirements:
119
- - - "~>"
139
+ - - ">="
120
140
  - !ruby/object:Gem::Version
121
- version: '0.10'
141
+ version: 0.13.1
122
142
  type: :development
123
143
  prerelease: false
124
144
  version_requirements: !ruby/object:Gem::Requirement
125
145
  requirements:
126
- - - "~>"
146
+ - - ">="
127
147
  - !ruby/object:Gem::Version
128
- version: '0.10'
148
+ version: 0.13.1
129
149
  - !ruby/object:Gem::Dependency
130
150
  name: fcrepo_wrapper
131
151
  requirement: !ruby/object:Gem::Requirement
@@ -235,8 +255,10 @@ executables: []
235
255
  extensions: []
236
256
  extra_rdoc_files: []
237
257
  files:
258
+ - ".fcrepo_wrapper"
238
259
  - ".gitignore"
239
260
  - ".rubocop.yml"
261
+ - ".solr_wrapper"
240
262
  - ".travis.yml"
241
263
  - Gemfile
242
264
  - LICENSE
@@ -490,17 +512,18 @@ files:
490
512
  - spec/services/geo_concerns/discovery/geoblacklight_document_spec.rb
491
513
  - spec/services/raster_format_service_spec.rb
492
514
  - spec/spec_helper.rb
515
+ - spec/support/backport_test.rb
493
516
  - spec/support/controllers/engine_helpers.rb
494
517
  - spec/support/database_cleaner.rb
495
- - spec/support/devise.rb
496
- - spec/support/devise_helpers.rb
497
518
  - spec/support/factory_girl.rb
498
519
  - spec/support/features.rb
499
520
  - spec/support/features/session_helpers.rb
500
521
  - spec/support/fixture_reader.rb
522
+ - spec/support/helpers/controller_level_helpers.rb
523
+ - spec/support/views/test_view_helpers.rb
501
524
  - spec/test_app_templates/lib/generators/test_app_generator.rb
502
525
  - spec/values/coverage_spec.rb
503
- - tasks/ci.rake
526
+ - tasks/geo_concerns.rake
504
527
  - template.rb
505
528
  homepage: https://github.com/projecthydra-labs/geo_concerns
506
529
  licenses:
@@ -514,7 +537,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
514
537
  requirements:
515
538
  - - ">="
516
539
  - !ruby/object:Gem::Version
517
- version: '0'
540
+ version: 2.2.2
518
541
  required_rubygems_version: !ruby/object:Gem::Requirement
519
542
  requirements:
520
543
  - - ">="
@@ -522,7 +545,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
522
545
  version: '0'
523
546
  requirements: []
524
547
  rubyforge_project:
525
- rubygems_version: 2.4.5
548
+ rubygems_version: 2.6.6
526
549
  signing_key:
527
550
  specification_version: 4
528
551
  summary: Rails engine for Hydra Geo models. Built around Curation Concerns engine.
@@ -589,13 +612,14 @@ test_files:
589
612
  - spec/services/geo_concerns/discovery/geoblacklight_document_spec.rb
590
613
  - spec/services/raster_format_service_spec.rb
591
614
  - spec/spec_helper.rb
615
+ - spec/support/backport_test.rb
592
616
  - spec/support/controllers/engine_helpers.rb
593
617
  - spec/support/database_cleaner.rb
594
- - spec/support/devise.rb
595
- - spec/support/devise_helpers.rb
596
618
  - spec/support/factory_girl.rb
597
619
  - spec/support/features.rb
598
620
  - spec/support/features/session_helpers.rb
599
621
  - spec/support/fixture_reader.rb
622
+ - spec/support/helpers/controller_level_helpers.rb
623
+ - spec/support/views/test_view_helpers.rb
600
624
  - spec/test_app_templates/lib/generators/test_app_generator.rb
601
625
  - spec/values/coverage_spec.rb
@@ -1,10 +0,0 @@
1
- require 'devise'
2
-
3
- RSpec.configure do |config|
4
- config.include Devise::TestHelpers, type: :controller
5
- config.include Devise::TestHelpers, type: :controller
6
- config.include Devise::TestHelpers, type: :view
7
- config.include Warden::Test::Helpers, type: :feature
8
- config.include Controllers::EngineHelpers, type: :controller
9
- config.include Rails.application.routes.url_helpers, type: :routing
10
- end
@@ -1,6 +0,0 @@
1
- RSpec.configure do |config|
2
- config.include Devise::TestHelpers, type: :controller
3
- config.include Devise::TestHelpers, type: :view
4
- config.include Warden::Test::Helpers, type: :feature
5
- config.after(:each, type: :feature) { Warden.test_reset! }
6
- end
data/tasks/ci.rake DELETED
@@ -1,49 +0,0 @@
1
- require 'solr_wrapper'
2
- require 'fcrepo_wrapper'
3
- task ci: ['engine_cart:generate'] do
4
- # TODO: set port to nil (random port)
5
- solr_params = { port: '8985', verbose: true, managed: true }
6
- fcrepo_params = { port: '8986', verbose: true, managed: true }
7
- SolrWrapper.wrap(solr_params) do |solr|
8
- ENV['SOLR_TEST_PORT'] = solr.port
9
- solr.with_collection(name: 'hydra-test', dir: File.join(File.expand_path('.', File.dirname(__FILE__)), '..', 'solr', 'config')) do
10
- FcrepoWrapper.wrap(fcrepo_params) do |fcrepo|
11
- ENV['FCREPO_TEST_PORT'] = fcrepo.port
12
- Rake::Task['spec'].invoke
13
- end
14
- end
15
- end
16
- end
17
-
18
- namespace :geo_concerns do
19
- desc "Run development servers for Geo Concerns"
20
- task :dev_servers do
21
- solr_params = { port: '8983', verbose: true, managed: true }
22
- fcrepo_params = { port: '8984', verbose: true, managed: true }
23
- SolrWrapper.wrap(solr_params) do |solr|
24
- ENV['SOLR_TEST_PORT'] = solr.port
25
- solr.with_collection(name: 'hydra-development', dir: File.join(File.expand_path('.', File.dirname(__FILE__)), '..', 'solr', 'config')) do
26
- FcrepoWrapper.wrap(fcrepo_params) do |fcrepo|
27
- ENV['FCREPO_TEST_PORT'] = fcrepo.port
28
- while true do
29
- end
30
- end
31
- end
32
- end
33
- end
34
- desc "Run test servers for Geo Concerns"
35
- task :test_servers do
36
- solr_params = { port: '8985', verbose: true, managed: true }
37
- fcrepo_params = { port: '8986', verbose: true, managed: true }
38
- SolrWrapper.wrap(solr_params) do |solr|
39
- ENV['SOLR_TEST_PORT'] = solr.port
40
- solr.with_collection(name: 'hydra-test', dir: File.join(File.expand_path('.', File.dirname(__FILE__)), '..', 'solr', 'config')) do
41
- FcrepoWrapper.wrap(fcrepo_params) do |fcrepo|
42
- ENV['FCREPO_TEST_PORT'] = fcrepo.port
43
- while true do
44
- end
45
- end
46
- end
47
- end
48
- end
49
- end