blacklight-gallery 0.12.0 → 1.0.0

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.
@@ -21,25 +21,25 @@ describe Blacklight::GalleryHelper, :type => :helper do
21
21
  allow(helper).to receive(:blacklight_config).and_return(CatalogController.blacklight_config)
22
22
  helper.lookup_context.prefixes << "catalog"
23
23
  end
24
-
24
+
25
25
  subject { helper.gallery_wrapper_template SolrDocument.new }
26
26
 
27
27
  it "should be the default template" do
28
28
  expect(subject.virtual_path).to eq 'catalog/_index_gallery'
29
29
  end
30
30
  end
31
-
31
+
32
32
  describe "render_slideshow_tag" do
33
33
  let(:document) { instance_double(SolrDocument) }
34
34
 
35
35
  it "calls the provided slideshow method" do
36
- allow(helper).to receive_messages(:blacklight_config => Blacklight::Configuration.new(:index => Blacklight::OpenStructWithHashAccess.new(:slideshow_method => :xyz) ))
36
+ allow(helper).to receive_messages(:blacklight_config => Blacklight::Configuration.new.tap { |config| config.index.slideshow_method = :xyz })
37
37
  expect(helper).to receive_messages(:xyz => "some-slideshow")
38
38
  expect(helper.render_slideshow_tag(document)).to eq 'some-slideshow'
39
39
  end
40
40
 
41
41
  it "creates an image tag from the given field" do
42
- allow(helper).to receive_messages(:blacklight_config => Blacklight::Configuration.new(:index => Blacklight::OpenStructWithHashAccess.new(:slideshow_field => :xyz) ))
42
+ allow(helper).to receive_messages(:blacklight_config => Blacklight::Configuration.new.tap { |config| config.index.slideshow_field = :xyz })
43
43
 
44
44
  allow(document).to receive(:has?).with(:xyz).and_return(true)
45
45
  allow(document).to receive(:first).with(:xyz).and_return("http://example.com/some.jpg")
@@ -47,7 +47,7 @@ describe Blacklight::GalleryHelper, :type => :helper do
47
47
  end
48
48
 
49
49
  it "does not link to the document if the url options are false" do
50
- allow(helper).to receive_messages(:blacklight_config => Blacklight::Configuration.new(:index => Blacklight::OpenStructWithHashAccess.new(:slideshow_method => :xyz) ))
50
+ allow(helper).to receive_messages(:blacklight_config => Blacklight::Configuration.new.tap { |config| config.index.slideshow_method = :xyz })
51
51
  allow(helper).to receive_messages(:xyz => "some-slideshow")
52
52
 
53
53
  result = helper.render_slideshow_tag document, {}, false
@@ -55,7 +55,7 @@ describe Blacklight::GalleryHelper, :type => :helper do
55
55
  end
56
56
 
57
57
  it "does not link to the document if the url options have :suppress_link" do
58
- allow(helper).to receive_messages(:blacklight_config => Blacklight::Configuration.new(:index => Blacklight::OpenStructWithHashAccess.new(:slideshow_method => :xyz) ))
58
+ allow(helper).to receive_messages(:blacklight_config => Blacklight::Configuration.new.tap { |config| config.index.slideshow_method = :xyz })
59
59
  allow(helper).to receive_messages(:xyz => "some-slideshow")
60
60
 
61
61
  result = helper.render_slideshow_tag document, {}, suppress_link: true
@@ -64,27 +64,27 @@ describe Blacklight::GalleryHelper, :type => :helper do
64
64
 
65
65
 
66
66
  it "returns nil if no slideshow is available" do
67
- allow(helper).to receive_messages(:blacklight_config => Blacklight::Configuration.new(:index => Blacklight::OpenStructWithHashAccess.new() ))
67
+ allow(helper).to receive_messages(:blacklight_config => Blacklight::Configuration.new)
68
68
  expect(helper.render_slideshow_tag document).to be_nil
69
69
  end
70
70
 
71
71
  it "returns nil if no slideshow is returned from the slideshow method" do
72
- allow(helper).to receive_messages(:blacklight_config => Blacklight::Configuration.new(:index => Blacklight::OpenStructWithHashAccess.new(:slideshow_method => :xyz) ))
72
+ allow(helper).to receive_messages(:blacklight_config => Blacklight::Configuration.new.tap { |config| config.index.slideshow_method = :xyz })
73
73
  allow(helper).to receive_messages(:xyz => nil)
74
74
 
75
75
  expect(helper.render_slideshow_tag document).to be_nil
76
76
  end
77
77
 
78
78
  it "returns nil if no slideshow is in the document" do
79
- allow(helper).to receive_messages(:blacklight_config => Blacklight::Configuration.new(:index => Blacklight::OpenStructWithHashAccess.new(:slideshow_field => :xyz) ))
79
+ allow(helper).to receive_messages(:blacklight_config => Blacklight::Configuration.new.tap { |config| config.index.slideshow_field = :xyz })
80
80
 
81
81
  allow(document).to receive(:has?).with(:xyz).and_return(false)
82
82
 
83
83
  expect(helper.render_slideshow_tag document).to be_nil
84
84
  end
85
-
85
+
86
86
  it "falls back to a thumbnail" do
87
- allow(helper).to receive_messages(:blacklight_config => Blacklight::Configuration.new(:index => Blacklight::OpenStructWithHashAccess.new(:thumbnail_method => :xyz) ))
87
+ allow(helper).to receive_messages(:blacklight_config => Blacklight::Configuration.new.tap { |config| config.index.thumbnail_method = :xyz })
88
88
  allow(helper).to receive(:xyz).and_return('thumbnail-image')
89
89
 
90
90
  expect(helper.render_slideshow_tag document).to eq 'thumbnail-image'
@@ -93,7 +93,7 @@ describe Blacklight::GalleryHelper, :type => :helper do
93
93
 
94
94
  describe "slideshow_url" do
95
95
  it "pulls the configured slideshow field out of the document" do
96
- allow(helper).to receive_messages(:blacklight_config => Blacklight::Configuration.new(:index => Blacklight::OpenStructWithHashAccess.new(:slideshow_field => :xyz) ))
96
+ allow(helper).to receive_messages(:blacklight_config => Blacklight::Configuration.new.tap { |config| config.index.slideshow_field = :xyz })
97
97
  document = instance_double(SolrDocument)
98
98
  allow(document).to receive(:has?).with(:xyz).and_return(true)
99
99
  allow(document).to receive(:first).with(:xyz).and_return("asdf")
@@ -101,7 +101,7 @@ describe Blacklight::GalleryHelper, :type => :helper do
101
101
  end
102
102
 
103
103
  it "returns nil if the slideshow field doesn't exist" do
104
- allow(helper).to receive_messages(:blacklight_config => Blacklight::Configuration.new(:index => Blacklight::OpenStructWithHashAccess.new(:slideshow_field => :xyz) ))
104
+ allow(helper).to receive_messages(:blacklight_config => Blacklight::Configuration.new.tap { |config| config.index.slideshow_field = :xyz })
105
105
  document = instance_double(SolrDocument)
106
106
  allow(document).to receive(:has?).with(:xyz).and_return(false)
107
107
  expect(helper.slideshow_image_url document).to be_nil
@@ -8,13 +8,26 @@ require 'rspec/its'
8
8
  require 'rspec/rails'
9
9
  require 'rspec/active_model/mocks'
10
10
 
11
- require 'capybara/poltergeist'
12
- Capybara.javascript_driver = :poltergeist
11
+ require 'selenium-webdriver'
12
+ require 'chromedriver-helper'
13
+
14
+ Capybara.javascript_driver = :headless_chrome
15
+
16
+ Capybara.register_driver :headless_chrome do |app|
17
+ capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
18
+ chromeOptions: { args: %w[headless disable-gpu no-sandbox] }
19
+ )
20
+
21
+ Capybara::Selenium::Driver.new(app,
22
+ browser: :chrome,
23
+ desired_capabilities: capabilities)
24
+ end
13
25
 
14
26
  require 'blacklight'
15
27
  require 'blacklight/gallery'
16
28
 
17
29
  RSpec.configure do |c|
18
30
  c.infer_spec_type_from_file_location!
31
+ c.full_backtrace = true
32
+ #onfig.assets.precompile += %w(spotlight/default_thumbnail.jpg spotlight/default_browse_thumbnail.jpg)
19
33
  end
20
-
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-gallery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
@@ -30,28 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '6.3'
33
+ version: '7.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '6.3'
40
+ version: '7.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: bootstrap-sass
42
+ name: bootstrap
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.0'
47
+ version: '4.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.0'
54
+ version: '4.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: openseadragon
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -66,20 +66,6 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.2.0
69
- - !ruby/object:Gem::Dependency
70
- name: bundler
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '1.5'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '1.5'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: rake
85
71
  requirement: !ruby/object:Gem::Requirement
@@ -184,14 +170,14 @@ dependencies:
184
170
  requirements:
185
171
  - - "~>"
186
172
  - !ruby/object:Gem::Version
187
- version: '1.1'
173
+ version: '2.0'
188
174
  type: :development
189
175
  prerelease: false
190
176
  version_requirements: !ruby/object:Gem::Requirement
191
177
  requirements:
192
178
  - - "~>"
193
179
  - !ruby/object:Gem::Version
194
- version: '1.1'
180
+ version: '2.0'
195
181
  - !ruby/object:Gem::Dependency
196
182
  name: capybara
197
183
  requirement: !ruby/object:Gem::Requirement
@@ -207,19 +193,33 @@ dependencies:
207
193
  - !ruby/object:Gem::Version
208
194
  version: '0'
209
195
  - !ruby/object:Gem::Dependency
210
- name: poltergeist
196
+ name: chromedriver-helper
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ">="
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
209
+ - !ruby/object:Gem::Dependency
210
+ name: selenium-webdriver
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
213
  - - ">="
214
214
  - !ruby/object:Gem::Version
215
- version: 1.5.0
215
+ version: 3.13.1
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - ">="
221
221
  - !ruby/object:Gem::Version
222
- version: 1.5.0
222
+ version: 3.13.1
223
223
  description:
224
224
  email:
225
225
  - cabeer@stanford.edu
@@ -233,8 +233,11 @@ files:
233
233
  - LICENSE.txt
234
234
  - README.md
235
235
  - Rakefile
236
+ - app/assets/images/blacklight/gallery.svg
236
237
  - app/assets/images/blacklight/gallery/view-icon-masonry.png
237
238
  - app/assets/images/blacklight/gallery/view-icon-masonry@2x.png
239
+ - app/assets/images/blacklight/masonry.svg
240
+ - app/assets/images/blacklight/slideshow.svg
238
241
  - app/assets/javascripts/blacklight_gallery/default.js
239
242
  - app/assets/javascripts/blacklight_gallery/masonry.js
240
243
  - app/assets/javascripts/blacklight_gallery/osd_viewer.js
@@ -292,6 +295,7 @@ files:
292
295
  - spec/helpers/blacklight/gallery_helper_spec.rb
293
296
  - spec/models/concerns/openseadragon_solr_document_spec.rb
294
297
  - spec/spec_helper.rb
298
+ - spec/test_app_templates/Gemfile.extra
295
299
  - spec/test_app_templates/lib/generators/test_app_generator.rb
296
300
  - spec/views/catalog/_document_slideshow.html.erb_spec.rb
297
301
  - spec/views/catalog/_index_gallery.html.erb_spec.rb
@@ -329,6 +333,7 @@ test_files:
329
333
  - spec/helpers/blacklight/gallery_helper_spec.rb
330
334
  - spec/models/concerns/openseadragon_solr_document_spec.rb
331
335
  - spec/spec_helper.rb
336
+ - spec/test_app_templates/Gemfile.extra
332
337
  - spec/test_app_templates/lib/generators/test_app_generator.rb
333
338
  - spec/views/catalog/_document_slideshow.html.erb_spec.rb
334
339
  - spec/views/catalog/_index_gallery.html.erb_spec.rb