blacklight-spotlight 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/generators/spotlight/templates/catalog_controller.rb +0 -3
- data/lib/spotlight/controller.rb +1 -1
- data/lib/spotlight/version.rb +1 -1
- data/lib/tasks/spotlight_tasks.rake +2 -0
- data/spec/controllers/spotlight/catalog_controller_spec.rb +32 -0
- data/spec/test_app_templates/catalog_controller.rb +0 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ab14cc0712b4681b53a8dcc7da496e98eb998bf
|
4
|
+
data.tar.gz: c0984a3fd7962447722ee604902e86a8925a4a23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c8155d4a110a73a98f51db66953a026abfbe412d6e0da24532b52bcf2933476ec085d6a31d98606eab91abdde8b1e81b6b8abe06f5a2fa6d1d9b3b8dcf6cd0d
|
7
|
+
data.tar.gz: a644d893ed4f6a8848318b646803f23fc98ad7827758b9ab37f0c8552e8da35e0209f9ca7aba651e8aae840bddb91d805799e0195ef39f26cc2e36a6555e0e06
|
data/lib/spotlight/controller.rb
CHANGED
@@ -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
|
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)
|
data/lib/spotlight/version.rb
CHANGED
@@ -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
|
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.
|
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-
|
14
|
+
date: 2015-11-13 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|