blacklight-spotlight 0.34.0 → 0.34.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,6 +20,14 @@ describe 'Report a Problem', type: :feature do
20
20
  end
21
21
  end
22
22
 
23
+ it 'allows the link to be opened w/o javascript (or in a new tab/window)' do
24
+ visit spotlight.exhibit_solr_document_path(exhibit, id: 'dq287tq6352')
25
+
26
+ click_on 'Feedback'
27
+
28
+ expect(page).to have_css('h2', text: 'Contact Us', visible: true)
29
+ end
30
+
23
31
  it 'accepts a problem report', js: true do
24
32
  visit spotlight.exhibit_solr_document_path(exhibit, id: 'dq287tq6352')
25
33
  click_on 'Feedback'
@@ -45,6 +45,28 @@ RSpec.describe Migration::IIIF do
45
45
  end
46
46
  end
47
47
 
48
+ describe '#migrate_upload_images' do
49
+ let(:file) { double }
50
+ let(:exhibit) { FactoryGirl.create(:exhibit) }
51
+ let!(:upload) { Spotlight::Resources::Upload.create(exhibit: exhibit) }
52
+
53
+ before do
54
+ allow(File).to receive(:exist?).and_return(true)
55
+ allow(File).to receive(:new).and_return(file)
56
+ expect_any_instance_of(Spotlight::Resources::Upload).to receive('read_attribute_before_type_cast').with('url').and_return('file1.jpg')
57
+ # allow other calls (from rails 4)
58
+ allow_any_instance_of(Spotlight::Resources::Upload).to receive('read_attribute_before_type_cast').with(anything).and_call_original
59
+ end
60
+
61
+ it 'migrates and saves' do
62
+ expect_any_instance_of(Spotlight::Resources::Upload).to receive(:save_and_index)
63
+ expect do
64
+ instance.send :migrate_upload_images
65
+ end.to change { Spotlight::FeaturedImage.count }.by(1)
66
+ expect(Spotlight::FeaturedImage.all.pluck(:id)).to include Spotlight::Resources::Upload.last.id
67
+ end
68
+ end
69
+
48
70
  describe '#migrate_contact_avatars' do
49
71
  let(:file) { double }
50
72
  let!(:contact1) { Spotlight::Contact.create }
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.34.0
4
+ version: 0.34.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: 2017-02-10 00:00:00.000000000 Z
14
+ date: 2017-02-16 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -1485,7 +1485,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1485
1485
  version: '0'
1486
1486
  requirements: []
1487
1487
  rubyforge_project:
1488
- rubygems_version: 2.5.2
1488
+ rubygems_version: 2.6.8
1489
1489
  signing_key:
1490
1490
  specification_version: 4
1491
1491
  summary: Enable librarians, curators, and others who are responsible for digital collections