blacklight-spotlight 3.1.0 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,8 @@
3
3
  describe SirTrevorRails::Blocks::FeaturedPagesBlock do
4
4
  subject { described_class.new({ type: '', data: block_data }, page) }
5
5
 
6
- let(:page) { FactoryBot.create(:feature_page) }
6
+ let(:page) { FactoryBot.create(:feature_page, exhibit: exhibit) }
7
+ let(:exhibit) { FactoryBot.create(:exhibit) }
7
8
  let(:block_data) { {} }
8
9
 
9
10
  describe '#items' do
@@ -21,6 +22,23 @@ describe SirTrevorRails::Blocks::FeaturedPagesBlock do
21
22
  end
22
23
  end
23
24
 
25
+ describe '#pages' do
26
+ let!(:page_a) { FactoryBot.create(:feature_page, slug: 'a', exhibit: exhibit) }
27
+ let!(:translated_page_a) { page_a.clone_for_locale('a').tap { |x| x.update(published: true) && x.save } }
28
+ let!(:page_b) { FactoryBot.create(:feature_page, slug: 'b', exhibit: exhibit) }
29
+
30
+ before do
31
+ block_data[:item] = {
32
+ '0': { id: 'a', display: 'true' },
33
+ '1': { id: 'b', display: 'true' }
34
+ }
35
+ end
36
+
37
+ it 'retrieves the pages from the default locale' do
38
+ expect(subject.pages.length).to eq 2
39
+ end
40
+ end
41
+
24
42
  describe '#as_json' do
25
43
  context 'when no items are present' do
26
44
  it 'returns an empty items value' do
@@ -36,6 +36,7 @@ describe 'spotlight/pages/show', type: :view do
36
36
  context 'when rendering with layout' do
37
37
  before do
38
38
  allow(page).to receive_messages(title: 'Abbott & Costello')
39
+ allow_any_instance_of(Spotlight::Exhibit).to receive(:searchable?).and_return(true)
39
40
  stub_template 'shared/_analytics.html.erb' => 'analytics'
40
41
  stub_template 'shared/_user_util_links.html.erb' => ''
41
42
  stub_template 'shared/_masthead.html.erb' => ''
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-spotlight
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
8
8
  - Jessie Keck
9
9
  - Gary Geisler
10
10
  - Justin Coyne
11
- autorequire:
11
+ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2021-06-11 00:00:00.000000000 Z
14
+ date: 2021-10-08 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activejob-status
@@ -867,7 +867,7 @@ dependencies:
867
867
  - - ">="
868
868
  - !ruby/object:Gem::Version
869
869
  version: '0'
870
- description:
870
+ description:
871
871
  email:
872
872
  - exhibits-feedback@lists.stanford.edu
873
873
  executables: []
@@ -1820,7 +1820,7 @@ files:
1820
1820
  homepage: https://github.com/projectblacklight/spotlight
1821
1821
  licenses: []
1822
1822
  metadata: {}
1823
- post_install_message:
1823
+ post_install_message:
1824
1824
  rdoc_options: []
1825
1825
  require_paths:
1826
1826
  - lib
@@ -1836,7 +1836,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1836
1836
  version: '0'
1837
1837
  requirements: []
1838
1838
  rubygems_version: 3.2.3
1839
- signing_key:
1839
+ signing_key:
1840
1840
  specification_version: 4
1841
1841
  summary: Enable librarians, curators, and others who are responsible for digital collections
1842
1842
  to create attractive, feature-rich websites that feature these collections.