blacklight-spotlight 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c321ae7af7b5264e59eff345211ac2760a96cb5b
4
- data.tar.gz: 2048a70d4aac48da5effa59328e3e7f73e132b2b
3
+ metadata.gz: 2ab14cc0712b4681b53a8dcc7da496e98eb998bf
4
+ data.tar.gz: c0984a3fd7962447722ee604902e86a8925a4a23
5
5
  SHA512:
6
- metadata.gz: 95dd157f70fd3b9f4d670a17c611d6e649d004a5fee7fa71d526c2b7f75fab528a21326e66ac3c45c2268152c7e7f0cb57f5a6a620ccea2ca84e912e1c2f842d
7
- data.tar.gz: 7e43fa7eca9cacee4e224e8a5974732578bbd00df20130b7df44f464b58d66505e568aeca905440abeaff6afe87459c2059710c6db0e94f15a8f9275f975e5d9
6
+ metadata.gz: 6c8155d4a110a73a98f51db66953a026abfbe412d6e0da24532b52bcf2933476ec085d6a31d98606eab91abdde8b1e81b6b8abe06f5a2fa6d1d9b3b8dcf6cd0d
7
+ data.tar.gz: a644d893ed4f6a8848318b646803f23fc98ad7827758b9ab37f0c8552e8da35e0209f9ca7aba651e8aae840bddb91d805799e0195ef39f26cc2e36a6555e0e06
@@ -1,6 +1,3 @@
1
- # -*- encoding : utf-8 -*-
2
- require 'blacklight/catalog'
3
-
4
1
  ##
5
2
  # Simplified catalog controller
6
3
  class CatalogController < ApplicationController
@@ -72,7 +72,7 @@ module Spotlight
72
72
  def exhibit_search_facet_url(*args)
73
73
  options = args.extract_options!
74
74
  only_path = options[:only_path]
75
- options.except! :exhibit_id, :only_path
75
+ options = params.merge(options).except(:exhibit_id, :only_path)
76
76
 
77
77
  if only_path
78
78
  spotlight.exhibit_catalog_facet_url(current_exhibit, *args, options)
@@ -1,4 +1,4 @@
1
1
  #
2
2
  module Spotlight
3
- VERSION = '0.7.0'
3
+ VERSION = '0.7.1'
4
4
  end
@@ -47,6 +47,8 @@ namespace :spotlight do
47
47
 
48
48
  exhibit.save!
49
49
 
50
+ exhibit.reindex_later
51
+
50
52
  puts Spotlight::ExhibitExportSerializer.new(exhibit.reload).to_json
51
53
  end
52
54
 
@@ -260,4 +260,36 @@ describe Spotlight::CatalogController, type: :controller do
260
260
  end
261
261
  end
262
262
  end
263
+
264
+ describe '.exhibit_search_facet_url' do
265
+ before do
266
+ allow(subject).to receive(:current_exhibit).and_return(exhibit)
267
+ end
268
+
269
+ it 'routes to the facet page' do
270
+ url = subject.exhibit_search_facet_url(id: 'x').sub('http://test.host/spotlight/', '/')
271
+ route = Spotlight::Engine.routes.recognize_path(url)
272
+ expect(route).to include controller: 'spotlight/catalog',
273
+ action: 'facet',
274
+ id: 'x'
275
+ end
276
+
277
+ it 'preserves the current exhibit context' do
278
+ url = subject.exhibit_search_facet_url(id: 'x').sub('http://test.host/spotlight/', '/')
279
+ route = Spotlight::Engine.routes.recognize_path(url)
280
+ expect(route).to include exhibit_id: exhibit.slug
281
+ end
282
+
283
+ context 'with search parameters' do
284
+ before do
285
+ allow(subject).to receive(:search_results).and_return([])
286
+ end
287
+
288
+ it 'preserves query parameters' do
289
+ get :index, q: 'xyz', exhibit_id: exhibit
290
+ url = subject.exhibit_search_facet_url(id: 'x')
291
+ expect(url).to include '?q=xyz'
292
+ end
293
+ end
294
+ end
263
295
  end
@@ -1,6 +1,3 @@
1
- # -*- encoding : utf-8 -*-
2
- require 'blacklight/catalog'
3
-
4
1
  class CatalogController < ApplicationController
5
2
  include Blacklight::Catalog
6
3
  helper Openseadragon::OpenseadragonHelper
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-spotlight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-11-11 00:00:00.000000000 Z
14
+ date: 2015-11-13 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails