blacklight-spotlight 0.34.1 → 1.0.0.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/assets/javascripts/spotlight/pages.js.erb +1 -1
  4. data/app/controllers/concerns/spotlight/controller.rb +0 -12
  5. data/app/helpers/spotlight/crop_helper.rb +1 -5
  6. data/app/models/concerns/spotlight/resources/open_graph.rb +1 -5
  7. data/app/models/concerns/spotlight/solr_document.rb +20 -23
  8. data/app/models/concerns/spotlight/solr_document/finder.rb +16 -0
  9. data/app/models/spotlight/blacklight_configuration.rb +5 -11
  10. data/app/models/spotlight/contact.rb +2 -2
  11. data/app/models/spotlight/custom_field.rb +1 -1
  12. data/app/models/spotlight/exhibit.rb +3 -3
  13. data/app/models/spotlight/feature_page.rb +2 -2
  14. data/app/models/spotlight/field_metadata.rb +12 -4
  15. data/app/models/spotlight/filter.rb +1 -8
  16. data/app/models/spotlight/lock.rb +1 -1
  17. data/app/models/spotlight/page.rb +3 -3
  18. data/app/models/spotlight/reindexing_log_entry.rb +1 -1
  19. data/app/models/spotlight/resource.rb +1 -1
  20. data/app/models/spotlight/resources/upload.rb +1 -1
  21. data/app/models/spotlight/role.rb +4 -11
  22. data/app/models/spotlight/search.rb +2 -2
  23. data/app/models/spotlight/site.rb +1 -1
  24. data/app/models/spotlight/solr_document_sidecar.rb +5 -1
  25. data/app/uploaders/spotlight/featured_image_uploader.rb +1 -1
  26. data/app/views/shared/_exhibit_navbar.html.erb +1 -1
  27. data/app/views/spotlight/catalog/_edit_default.html.erb +1 -1
  28. data/db/migrate/20131119213142_create_spotlight_pages.rb +1 -1
  29. data/db/migrate/20131120172811_create_spotlight_attachments.rb +1 -1
  30. data/db/migrate/20140128155151_create_exhibits.rb +1 -1
  31. data/db/migrate/20140128155152_create_roles.rb +1 -1
  32. data/db/migrate/20140130155151_create_spotlight_searches.rb +1 -1
  33. data/db/migrate/20140130215634_create_spotlight_blacklight_configurations.rb +1 -1
  34. data/db/migrate/20140206152809_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb +1 -1
  35. data/db/migrate/20140206152810_add_missing_unique_indices.acts_as_taggable_on_engine.rb +1 -1
  36. data/db/migrate/20140211203403_create_spotlight_custom_fields.rb +1 -1
  37. data/db/migrate/20140211212626_create_spotlight_solr_document_sidecars.rb +1 -1
  38. data/db/migrate/20140218155151_create_contacts.rb +1 -1
  39. data/db/migrate/20140225180948_create_contact_emails.rb +1 -1
  40. data/db/migrate/20140228131207_create_resources.rb +1 -1
  41. data/db/migrate/20140401232956_change_featured_image_to_featured_image_id.rb +1 -1
  42. data/db/migrate/20140403180324_create_spotlight_main_navigations.rb +1 -1
  43. data/db/migrate/20141117111311_create_locks.rb +1 -1
  44. data/db/migrate/20141118233735_change_contact_details.rb +1 -1
  45. data/db/migrate/20141126231820_add_avatar_to_contacts.rb +1 -1
  46. data/db/migrate/20141205005902_add_layout_options_to_exhibit.rb +1 -1
  47. data/db/migrate/20150116161616_add_published_to_exhibit.rb +1 -1
  48. data/db/migrate/20150127173245_add_featured_image_to_exhibit.rb +1 -1
  49. data/db/migrate/20150217111511_add_polymorphic_document_to_sidecars.rb +1 -1
  50. data/db/migrate/20150304071512_add_spotlight_featured_images.rb +1 -1
  51. data/db/migrate/20150304111111_add_featured_image_to_spotlight_classes.rb +1 -1
  52. data/db/migrate/20150306202300_add_display_to_spotlight_main_navigations.rb +1 -1
  53. data/db/migrate/20150313175432_add_field_type_to_custom_fields.rb +1 -1
  54. data/db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +1 -1
  55. data/db/migrate/20150410180015_add_missing_taggable_index.acts_as_taggable_on_engine.rb +1 -1
  56. data/db/migrate/20150410180016_change_collation_for_tag_names.acts_as_taggable_on_engine.rb +1 -1
  57. data/db/migrate/20150713160101_change_spotlight_searches_to_published.rb +1 -1
  58. data/db/migrate/20151016092343_remove_searchable_from_exhibit.rb +1 -1
  59. data/db/migrate/20151110082345_add_metadata_to_spotlight_resource.rb +1 -1
  60. data/db/migrate/20151117153210_change_spotlight_exhibit_published_default.rb +1 -1
  61. data/db/migrate/20151124101123_remove_default_from_spotlight_exhibit.rb +1 -1
  62. data/db/migrate/20151124105543_update_custom_field_names.rb +1 -1
  63. data/db/migrate/20151208085432_add_weight_to_exhibits.rb +1 -1
  64. data/db/migrate/20151210073829_create_spotlight_site.rb +1 -1
  65. data/db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb +1 -1
  66. data/db/migrate/20151215141516_change_roles_to_support_polymorphic_associations.rb +1 -1
  67. data/db/migrate/20151215192845_add_index_status_to_resources.rb +1 -1
  68. data/db/migrate/20151217211019_create_spotlight_exhibit_filters.rb +1 -1
  69. data/db/migrate/20160329215014_add_readonly_to_custom_fields.rb +1 -1
  70. data/db/migrate/20160711121314_add_default_view_to_spotlight_searches.rb +1 -1
  71. data/db/migrate/20160714144125_add_iiif_urls_to_featured_image.rb +1 -1
  72. data/db/migrate/20160718194010_add_iiif_url_to_contact.rb +1 -1
  73. data/db/migrate/20160805143841_add_upload_id_to_resources.rb +1 -1
  74. data/db/migrate/20160815165432_add_resource_to_solr_document_sidecar.rb +1 -1
  75. data/db/migrate/20160816165432_add_index_status_to_solr_document_sidecar.rb +1 -1
  76. data/db/migrate/20160929180534_add_document_index_to_solr_document_sidecar.rb +1 -1
  77. data/db/migrate/20170105222939_create_spotlight_reindexing_log_entries.rb +1 -1
  78. data/db/migrate/20170204091234_add_theme_to_spotlight_exhibits.rb +1 -1
  79. data/db/migrate/20170803152134_migrate_tags_to_sidecars.rb +17 -0
  80. data/lib/spotlight/version.rb +1 -1
  81. data/spec/controllers/spotlight/appearances_controller_spec.rb +4 -11
  82. data/spec/controllers/spotlight/catalog_controller_spec.rb +5 -3
  83. data/spec/controllers/spotlight/solr_controller_spec.rb +1 -1
  84. data/spec/controllers/spotlight/tags_controller_spec.rb +1 -1
  85. data/spec/examples.txt +1133 -1135
  86. data/spec/features/add_custom_field_metadata_spec.rb +1 -1
  87. data/spec/features/add_iiif_manifest_spec.rb +1 -1
  88. data/spec/features/add_items_spec.rb +6 -2
  89. data/spec/features/autocomplete_typeahead_spec.rb +1 -0
  90. data/spec/features/exhibit_themes_spec.rb +1 -1
  91. data/spec/features/tags_admin_spec.rb +1 -1
  92. data/spec/jobs/spotlight/rename_sidecar_field_job_spec.rb +8 -2
  93. data/spec/models/solr_document_spec.rb +5 -5
  94. data/spec/models/spotlight/blacklight_configuration_spec.rb +3 -2
  95. data/spec/models/spotlight/contact_spec.rb +6 -0
  96. data/spec/models/spotlight/exhibit_spec.rb +0 -10
  97. data/spec/models/spotlight/field_metadata_spec.rb +4 -4
  98. data/spec/models/spotlight/reindexing_log_entry_spec.rb +1 -9
  99. data/spec/models/spotlight/resource_spec.rb +2 -0
  100. data/spec/models/spotlight/role_spec.rb +1 -1
  101. data/spec/serializers/spotlight/exhibit_export_serializer_spec.rb +3 -9
  102. data/spec/services/spotlight/solr_document_builder_spec.rb +2 -2
  103. data/spec/spec_helper.rb +2 -6
  104. data/spec/support/helpers/controller_level_helpers.rb +0 -2
  105. data/spec/test_app_templates/fixture.css +0 -0
  106. data/spec/test_app_templates/fixture.png +0 -0
  107. data/spec/test_app_templates/lib/generators/test_app_generator.rb +14 -0
  108. data/spec/uploaders/spotlight/featured_image_uploader_spec.rb +2 -2
  109. data/spec/views/spotlight/searches/edit.html.erb_spec.rb +2 -0
  110. data/spec/views/spotlight/tags/index.html.erb_spec.rb +2 -2
  111. metadata +18 -29
  112. data/app/models/concerns/spotlight/ar_light.rb +0 -86
  113. data/app/models/concerns/spotlight/solr_document/active_model_concern.rb +0 -37
  114. data/spec/support/backport_test_helpers.rb +0 -45
@@ -20,7 +20,7 @@ describe 'Adding custom metadata field data', type: :feature do
20
20
 
21
21
  click_on 'Save changes'
22
22
 
23
- expect(::SolrDocument.find('dq287tq6352').sidecar(exhibit).data).to include 'field_name_tesim' => 'My new custom field value'
23
+ expect(::SolrDocument.new(id: 'dq287tq6352').sidecar(exhibit).data).to include 'field_name_tesim' => 'My new custom field value'
24
24
  sleep(1) # The data isn't commited to solr immediately.
25
25
 
26
26
  visit spotlight.exhibit_solr_document_path(exhibit, 'dq287tq6352')
@@ -17,7 +17,7 @@ describe 'adding IIIF Manifest', type: :feature do
17
17
 
18
18
  it 'submits the form to create a new item' do
19
19
  expect_any_instance_of(Spotlight::Resource).to receive(:reindex_later).and_return(true)
20
- url = 'https://purl.stanford.edu/vw754mr2281/iiif/manifest.json'
20
+ url = 'https://purl.stanford.edu/vw754mr2281/iiif/manifest'
21
21
  visit spotlight.admin_exhibit_catalog_path(exhibit)
22
22
 
23
23
  click_link 'Add items'
@@ -1,4 +1,6 @@
1
1
  describe 'Uploading a non-repository item', type: :feature do
2
+ include ActiveJob::TestHelper
3
+
2
4
  let!(:exhibit) { FactoryGirl.create(:exhibit) }
3
5
  let!(:custom_field) { FactoryGirl.create(:custom_field, exhibit: exhibit) }
4
6
  let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) }
@@ -85,8 +87,10 @@ describe 'Uploading a non-repository item', type: :feature do
85
87
  attach_file('resources_upload_url', File.join(FIXTURES_PATH, '800x600.png'))
86
88
  fill_in 'Title', with: '800x600'
87
89
 
88
- within '#new_resources_upload' do
89
- click_button 'Add item'
90
+ perform_enqueued_jobs do
91
+ within '#new_resources_upload' do
92
+ click_button 'Add item'
93
+ end
90
94
  end
91
95
 
92
96
  click_link '800x600'
@@ -37,6 +37,7 @@ describe 'Autocomplete typeahead', type: :feature, js: true do
37
37
  check 'Show background image in masthead'
38
38
 
39
39
  fill_in_typeahead_field(with: 'xd327cm9378', type: 'featured-image')
40
+ sleep 1 # HACK: that seems to mysteriously work.
40
41
 
41
42
  expect(page).to have_css('[data-panel-image-pagination]', text: /Image 1 of 2/, visible: true)
42
43
 
@@ -20,6 +20,6 @@ describe 'Update the site theme', type: :feature do
20
20
  click_link 'Exhibit masthead'
21
21
 
22
22
  expect(field_labeled('Modern')).to be_checked
23
- expect(page).to have_xpath('//link[contains(@href, "/stylesheets/application_modern.css")]', visible: false)
23
+ expect(page).to have_xpath('//link[contains(@href, "/assets/application_modern")]', visible: false)
24
24
  end
25
25
  end
@@ -1,6 +1,6 @@
1
1
  describe 'Tags Administration', type: :feature do
2
2
  let(:exhibit) { FactoryGirl.create(:exhibit) }
3
- let!(:tagging) { FactoryGirl.create(:tagging, tagger: exhibit) }
3
+ let!(:tagging) { FactoryGirl.create(:tagging, tagger: exhibit, taggable: exhibit) }
4
4
  let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) }
5
5
  before { login_as exhibit_curator }
6
6
 
@@ -1,5 +1,7 @@
1
1
 
2
2
  describe Spotlight::RenameSidecarFieldJob do
3
+ include ActiveJob::TestHelper
4
+
3
5
  let(:exhibit) { FactoryGirl.create(:exhibit) }
4
6
  let(:sidecar) { SolrDocument.new(id: 'test').sidecar(exhibit).tap(&:save!) }
5
7
 
@@ -9,7 +11,9 @@ describe Spotlight::RenameSidecarFieldJob do
9
11
  sidecar.data['old_field'] = 'some value'
10
12
  sidecar.save!
11
13
 
12
- described_class.perform_later(exhibit, 'old_field', 'new_field')
14
+ perform_enqueued_jobs do
15
+ described_class.perform_later(exhibit, 'old_field', 'new_field')
16
+ end
13
17
 
14
18
  sidecar.reload
15
19
  expect(sidecar.data['new_field']).to eq 'some value'
@@ -21,6 +25,8 @@ describe Spotlight::RenameSidecarFieldJob do
21
25
  sidecar.data['other_field'] = 'some value'
22
26
  sidecar.save!
23
27
 
24
- described_class.perform_later(exhibit, 'old_field', 'new_field')
28
+ perform_enqueued_jobs do
29
+ described_class.perform_later(exhibit, 'old_field', 'new_field')
30
+ end
25
31
  end
26
32
  end
@@ -21,14 +21,14 @@ describe SolrDocument, type: :model do
21
21
  end
22
22
 
23
23
  it 'has tags on the exhibit' do
24
- expect(subject.tags_from(exhibit)).to be_empty
24
+ expect(subject.sidecar(exhibit).tags_from(exhibit)).to be_empty
25
25
  end
26
26
 
27
27
  it 'is able to add tags' do
28
28
  expect do
29
- exhibit.tag(subject, with: 'paris, normandy', on: :tags)
29
+ exhibit.tag(subject.sidecar(exhibit), with: 'paris, normandy', on: :tags)
30
30
  end.to change { ActsAsTaggableOn::Tag.count }.by(2)
31
- expect(subject.tags_from(exhibit)).to eq %w(paris normandy)
31
+ expect(subject.sidecar(exhibit).tags_from(exhibit)).to eq %w(paris normandy)
32
32
  end
33
33
 
34
34
  it 'has find' do
@@ -72,7 +72,7 @@ describe SolrDocument, type: :model do
72
72
  end
73
73
  it 'stores tags' do
74
74
  subject.update exhibit, exhibit_tag_list: 'paris, normandy'
75
- expect(subject.tags_from(exhibit)).to eq %w(paris normandy)
75
+ expect(subject.sidecar(exhibit).tags_from(exhibit)).to eq %w(paris normandy)
76
76
  end
77
77
  end
78
78
 
@@ -87,7 +87,7 @@ describe SolrDocument, type: :model do
87
87
  end
88
88
 
89
89
  it 'includes exhibit-specific tags' do
90
- exhibit.tag(subject, with: 'paris', on: :tags)
90
+ exhibit.tag(subject.sidecar(exhibit), with: 'paris', on: :tags)
91
91
 
92
92
  expect(subject.to_solr).to include :"exhibit_#{exhibit.slug}_tags_ssim"
93
93
  expect(subject.to_solr[:"exhibit_#{exhibit.slug}_tags_ssim"]).to include 'paris'
@@ -89,8 +89,8 @@ describe Spotlight::BlacklightConfiguration, type: :model do
89
89
  end
90
90
 
91
91
  it 'defaults to not showing a custom field in the facets' do
92
- field = double('field', field: 'a', solr_field: 'a', configuration: {})
93
- custom_fields = double('custom_fields', vocab: [field])
92
+ field = double('field', new_record?: false, field: 'a', solr_field: 'a', configuration: {})
93
+ custom_fields = double('custom_fields', vocab: [field], reject: [])
94
94
  allow(custom_fields).to receive(:map) do |&block|
95
95
  block.call(field)
96
96
  end
@@ -99,6 +99,7 @@ describe Spotlight::BlacklightConfiguration, type: :model do
99
99
  expect(subject.blacklight_config.facet_fields['a'].show).to be_falsey
100
100
  expect(subject.blacklight_config.facet_fields['a'].if).to eq :field_enabled?
101
101
  expect(subject.blacklight_config.facet_fields['a'].enabled).to eq false
102
+ expect(subject.blacklight_config.facet_fields['a'].limit).to eq true
102
103
  end
103
104
  end
104
105
 
@@ -1,4 +1,10 @@
1
1
  describe Spotlight::Contact, type: :model do
2
+ let(:exhibit) { FactoryGirl.create(:exhibit) }
3
+
4
+ before do
5
+ subject.exhibit = exhibit
6
+ end
7
+
2
8
  context '#show_in_sidebar' do
3
9
  it 'is an attribute' do
4
10
  subject.show_in_sidebar = false
@@ -83,16 +83,6 @@ describe Spotlight::Exhibit, type: :model do
83
83
  subject.import 'title' => 'xyz'
84
84
  expect(subject.title).to eq 'xyz'
85
85
  end
86
-
87
- it 'munges taggings so they can be imported easily' do
88
- expect do
89
- subject.import('owned_taggings' => [{ 'taggable_id' => '1', 'taggable_type' => 'SolrDocument', 'context' => 'tags', 'tag' => 'xyz' }])
90
- subject.save
91
- end.to change { subject.owned_taggings.count }.by(1)
92
- tag = subject.owned_taggings.last
93
- expect(tag.taggable_id).to eq '1'
94
- expect(tag.tag.name).to eq 'xyz'
95
- end
96
86
  end
97
87
 
98
88
  describe '#blacklight_config' do
@@ -5,7 +5,7 @@ describe Spotlight::FieldMetadata do
5
5
  Blacklight::Configuration.new do |config|
6
6
  config.add_facet_field 'a'
7
7
  config.add_facet_field 'b'
8
- config.add_facet_field 'c'
8
+ config.add_facet_field 'some_key', field: 'c'
9
9
  end
10
10
  end
11
11
 
@@ -37,19 +37,19 @@ describe Spotlight::FieldMetadata do
37
37
  it 'has a document count' do
38
38
  expect(subject.field('a')[:document_count]).to eq 5
39
39
  expect(subject.field('b')[:document_count]).to eq 10
40
- expect(subject.field('c')[:document_count]).to eq 15
40
+ expect(subject.field('some_key')[:document_count]).to eq 15
41
41
  end
42
42
 
43
43
  it 'has a value count' do
44
44
  expect(subject.field('a')[:value_count]).to eq 3
45
45
  expect(subject.field('b')[:value_count]).to eq 1
46
- expect(subject.field('c')[:value_count]).to eq 3
46
+ expect(subject.field('some_key')[:value_count]).to eq 3
47
47
  end
48
48
 
49
49
  it 'gets a list of top terms' do
50
50
  expect(subject.field('a')[:terms]).to match_array %w(a b c)
51
51
  expect(subject.field('b')[:terms]).to match_array %w(b)
52
- expect(subject.field('c')[:terms]).to match_array [7, 8, 9]
52
+ expect(subject.field('some_key')[:terms]).to match_array [7, 8, 9]
53
53
  end
54
54
 
55
55
  context 'for a missing field' do
@@ -2,20 +2,12 @@ describe Spotlight::ReindexingLogEntry, type: :model do
2
2
  subject { FactoryGirl.build(:reindexing_log_entry) }
3
3
 
4
4
  describe 'scope' do
5
- before(:all) do
6
- # we only want to persist these rows for the duration a given test run...
7
- DatabaseCleaner.start
8
- # create (and save) entries in the log that can be queried, so that we can test our scopes
5
+ before do
9
6
  (0..10).to_a.each { FactoryGirl.create(:recent_reindexing_log_entry) }
10
7
  FactoryGirl.create(:unstarted_reindexing_log_entry)
11
8
  (0..10).to_a.each { FactoryGirl.create(:recent_reindexing_log_entry) }
12
9
  end
13
10
 
14
- after(:all) do
15
- # ...remove the entries we created, now that we're done with them
16
- DatabaseCleaner.clean
17
- end
18
-
19
11
  let(:sorted_log_entry_list) do
20
12
  unstarted_entries = Spotlight::ReindexingLogEntry.where(start_time: nil).to_a
21
13
  started_entries = Spotlight::ReindexingLogEntry.where.not(start_time: nil).to_a.sort_by(&:start_time).reverse
@@ -26,6 +26,8 @@ describe Spotlight::Resource, type: :model do
26
26
  expect(data.length).to eq 1
27
27
  doc = data.first
28
28
 
29
+ break if doc.first == :commit
30
+
29
31
  expect(doc).to include document_data: true
30
32
  end
31
33
 
@@ -5,7 +5,7 @@ describe Spotlight::Role, type: :model do
5
5
  let(:args) { { user_key: '' } }
6
6
  it 'does not be valid' do
7
7
  expect(subject).not_to be_valid
8
- expect(subject.errors.messages).to eq(role: ['is not included in the list'], user_key: ["can't be blank"])
8
+ expect(subject.errors.messages).to include(role: ['is not included in the list'], 'user.email': ["can't be blank"])
9
9
  end
10
10
  end
11
11
  describe 'with user_key' do
@@ -67,14 +67,14 @@ describe Spotlight::ExhibitExportSerializer do
67
67
  end
68
68
 
69
69
  it 'has tags' do
70
- source_exhibit.tag(SolrDocument.new(id: 1), with: 'xyz', on: :tags)
70
+ source_exhibit.tag(Spotlight::SolrDocumentSidecar.create(document_id: 1, document_type: 'SolrDocument'), with: 'xyz', on: :tags)
71
71
  expect(subject['owned_taggings']).to have(source_exhibit.owned_taggings.count).items
72
72
  end
73
73
 
74
74
  describe 'should round-trip data' do
75
75
  before do
76
- source_exhibit.solr_document_sidecars.create! document: SolrDocument.new(id: 1), public: false
77
- source_exhibit.tag(SolrDocument.new(id: 1), with: 'xyz', on: :tags)
76
+ sidecar = source_exhibit.solr_document_sidecars.create! document: SolrDocument.new(id: 1), public: false
77
+ source_exhibit.tag(sidecar, with: 'xyz', on: :tags)
78
78
  end
79
79
 
80
80
  let :export do
@@ -165,12 +165,6 @@ describe Spotlight::ExhibitExportSerializer do
165
165
  end
166
166
  end
167
167
 
168
- it 'has tags' do
169
- expect(subject.owned_taggings.length).to eq source_exhibit.owned_taggings.length
170
- expect(subject.owned_taggings.first).to be_persisted
171
- expect(subject.owned_taggings.first.tag.name).to eq 'xyz'
172
- end
173
-
174
168
  it 'deals with nested feature pages' do
175
169
  FactoryGirl.create :feature_subpage, exhibit: source_exhibit
176
170
  expect(subject.feature_pages.at_top_level.length).to eq 1
@@ -38,8 +38,8 @@ describe Spotlight::SolrDocumentBuilder do
38
38
  it 'creates a sidecar resource for the document' do
39
39
  resource.document_builder.documents_to_index.first
40
40
 
41
- expect(Spotlight::SolrDocumentSidecar.where(document_id: 'abc123', document_type: SolrDocument).size).to eq 2
42
- sidecar = resource.solr_document_sidecars.find_by(document_id: 'abc123', document_type: SolrDocument)
41
+ expect(Spotlight::SolrDocumentSidecar.where(document_id: 'abc123', document_type: 'SolrDocument').size).to eq 2
42
+ sidecar = resource.solr_document_sidecars.find_by(document_id: 'abc123', document_type: 'SolrDocument')
43
43
  expect(sidecar.exhibit).to eq resource.exhibit
44
44
  expect(sidecar.resource).to eq resource
45
45
  end
@@ -94,12 +94,8 @@ RSpec.configure do |config|
94
94
  config.after(:each, type: :feature) { Warden.test_reset! }
95
95
  config.include Controllers::EngineHelpers, type: :controller
96
96
  config.include Capybara::DSL
97
- if Rails::VERSION::MAJOR >= 5
98
- config.include ::Rails.application.routes.url_helpers
99
- config.include ::Rails.application.routes.mounted_helpers
100
- else
101
- config.include BackportTestHelpers, type: :controller
102
- end
97
+ config.include ::Rails.application.routes.url_helpers
98
+ config.include ::Rails.application.routes.mounted_helpers
103
99
  config.include Spotlight::TestFeaturesHelpers, type: :feature
104
100
 
105
101
  config.expect_with :rspec do |expectations|
@@ -17,8 +17,6 @@ module ControllerLevelHelpers
17
17
  end
18
18
 
19
19
  def initialize_routing_helpers(helper)
20
- return unless Rails::VERSION::MAJOR >= 5
21
-
22
20
  helper.class.include ::Rails.application.routes.url_helpers
23
21
  helper.class.include ::Rails.application.routes.mounted_helpers if ::Rails.application.routes.respond_to?(:mounted_helpers)
24
22
  end
File without changes
@@ -38,6 +38,20 @@ class TestAppGenerator < Rails::Generators::Base
38
38
  copy_file 'carrierwave.rb', 'config/initializers/carrierwave.rb'
39
39
  end
40
40
 
41
+ def fix_up_migration_versions
42
+ Dir.glob('db/migrate/*.rb') do |f|
43
+ gsub_file f, /< ActiveRecord::Migration$/, '< ActiveRecord::Migration[4.2]'
44
+ end
45
+ end
46
+
47
+ def add_theme_assets
48
+ copy_file 'fixture.png', 'app/assets/images/spotlight/themes/default_preview.png'
49
+ copy_file 'fixture.png', 'app/assets/images/spotlight/themes/modern_preview.png'
50
+
51
+ copy_file 'fixture.css', 'app/assets/stylesheets/application_modern.css'
52
+ append_to_file 'config/initializers/assets.rb', 'Rails.application.config.assets.precompile += %w( application_modern.css )'
53
+ end
54
+
41
55
  def disable_filter_resources_by_exhibit
42
56
  initializer 'disable_filter_resources_by_exhibit.rb' do
43
57
  <<-EOF
@@ -2,9 +2,9 @@ describe Spotlight::FeaturedImageUploader do
2
2
  let(:mounter) { FactoryGirl.create(:featured_image) }
3
3
  subject(:featured_image_uploader) { described_class.new(mounter, 'mounted_as') }
4
4
 
5
- describe '#extension_white_list' do
5
+ describe '#extension_whitelist' do
6
6
  it 'is the configured array of approved extension to be uploaded' do
7
- expect(featured_image_uploader.extension_white_list).to eq Spotlight::Engine.config.allowed_upload_extensions
7
+ expect(featured_image_uploader.extension_whitelist).to eq Spotlight::Engine.config.allowed_upload_extensions
8
8
  end
9
9
  end
10
10
 
@@ -17,6 +17,8 @@ describe 'spotlight/searches/edit.html.erb', type: :view do
17
17
  allow(view).to receive(:exhibit_search_path).and_return('/search')
18
18
  allow(view).to receive(:exhibit_searches_path).and_return('/searches')
19
19
  allow(view).to receive(:blacklight_config).and_return(blacklight_config)
20
+ allow(controller).to receive(:search_state_class).and_return(Blacklight::SearchState)
21
+
20
22
  assign(:exhibit, exhibit)
21
23
  assign(:search, search)
22
24
  allow(view).to receive(:current_exhibit).and_return(exhibit)
@@ -1,8 +1,8 @@
1
1
 
2
2
  describe 'spotlight/tags/index.html.erb', type: :view do
3
3
  let(:exhibit) { FactoryGirl.create(:exhibit) }
4
- let!(:tag1) { FactoryGirl.create(:tagging, tagger: exhibit) }
5
- let!(:tag2) { FactoryGirl.create(:tagging, tagger: exhibit) }
4
+ let!(:tag1) { FactoryGirl.create(:tagging, tagger: exhibit, taggable: exhibit) }
5
+ let!(:tag2) { FactoryGirl.create(:tagging, tagger: exhibit, taggable: exhibit) }
6
6
  before do
7
7
  assign(:exhibit, exhibit)
8
8
  assign(:tags, exhibit.owned_tags)
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.1
4
+ version: 1.0.0.alpha1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
@@ -11,28 +11,22 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2017-02-16 00:00:00.000000000 Z
14
+ date: 2017-08-03 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
18
18
  requirement: !ruby/object:Gem::Requirement
19
19
  requirements:
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 4.2.0
23
- - - "<"
20
+ - - "~>"
24
21
  - !ruby/object:Gem::Version
25
- version: '6'
22
+ version: '5.0'
26
23
  type: :runtime
27
24
  prerelease: false
28
25
  version_requirements: !ruby/object:Gem::Requirement
29
26
  requirements:
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 4.2.0
33
- - - "<"
27
+ - - "~>"
34
28
  - !ruby/object:Gem::Version
35
- version: '6'
29
+ version: '5.0'
36
30
  - !ruby/object:Gem::Dependency
37
31
  name: blacklight
38
32
  requirement: !ruby/object:Gem::Requirement
@@ -137,14 +131,14 @@ dependencies:
137
131
  requirements:
138
132
  - - "~>"
139
133
  - !ruby/object:Gem::Version
140
- version: '4.0'
134
+ version: '5.0'
141
135
  type: :runtime
142
136
  prerelease: false
143
137
  version_requirements: !ruby/object:Gem::Requirement
144
138
  requirements:
145
139
  - - "~>"
146
140
  - !ruby/object:Gem::Version
147
- version: '4.0'
141
+ version: '5.0'
148
142
  - !ruby/object:Gem::Dependency
149
143
  name: friendly_id
150
144
  requirement: !ruby/object:Gem::Requirement
@@ -389,20 +383,14 @@ dependencies:
389
383
  requirements:
390
384
  - - "~>"
391
385
  - !ruby/object:Gem::Version
392
- version: '5.0'
393
- - - ">="
394
- - !ruby/object:Gem::Version
395
- version: 5.2.1
386
+ version: '7.0'
396
387
  type: :runtime
397
388
  prerelease: false
398
389
  version_requirements: !ruby/object:Gem::Requirement
399
390
  requirements:
400
391
  - - "~>"
401
392
  - !ruby/object:Gem::Version
402
- version: '5.0'
403
- - - ">="
404
- - !ruby/object:Gem::Version
405
- version: 5.2.1
393
+ version: '7.0'
406
394
  - !ruby/object:Gem::Dependency
407
395
  name: openseadragon
408
396
  requirement: !ruby/object:Gem::Requirement
@@ -882,7 +870,6 @@ files:
882
870
  - app/mailers/spotlight/invitation_mailer.rb
883
871
  - app/models/ability.rb
884
872
  - app/models/concerns/spotlight/access_controls_enforcement_search_builder.rb
885
- - app/models/concerns/spotlight/ar_light.rb
886
873
  - app/models/concerns/spotlight/blacklight_configuration_defaults.rb
887
874
  - app/models/concerns/spotlight/exhibit_analytics.rb
888
875
  - app/models/concerns/spotlight/exhibit_defaults.rb
@@ -891,7 +878,6 @@ files:
891
878
  - app/models/concerns/spotlight/resources/web.rb
892
879
  - app/models/concerns/spotlight/sitemap.rb
893
880
  - app/models/concerns/spotlight/solr_document.rb
894
- - app/models/concerns/spotlight/solr_document/active_model_concern.rb
895
881
  - app/models/concerns/spotlight/solr_document/atomic_updates.rb
896
882
  - app/models/concerns/spotlight/solr_document/finder.rb
897
883
  - app/models/concerns/spotlight/solr_document/uploaded_resource.rb
@@ -1175,6 +1161,7 @@ files:
1175
1161
  - db/migrate/20160929180534_add_document_index_to_solr_document_sidecar.rb
1176
1162
  - db/migrate/20170105222939_create_spotlight_reindexing_log_entries.rb
1177
1163
  - db/migrate/20170204091234_add_theme_to_spotlight_exhibits.rb
1164
+ - db/migrate/20170803152134_migrate_tags_to_sidecars.rb
1178
1165
  - lib/blacklight/spotlight.rb
1179
1166
  - lib/generators/spotlight/install_generator.rb
1180
1167
  - lib/generators/spotlight/scaffold_resource_generator.rb
@@ -1366,7 +1353,6 @@ files:
1366
1353
  - spec/services/spotlight/iiif_resource_resolver_spec.rb
1367
1354
  - spec/services/spotlight/solr_document_builder_spec.rb
1368
1355
  - spec/spec_helper.rb
1369
- - spec/support/backport_test_helpers.rb
1370
1356
  - spec/support/controllers/engine_helpers.rb
1371
1357
  - spec/support/features/test_features_helpers.rb
1372
1358
  - spec/support/helpers/controller_level_helpers.rb
@@ -1375,6 +1361,8 @@ files:
1375
1361
  - spec/test_app_templates/Gemfile.extra
1376
1362
  - spec/test_app_templates/carrierwave.rb
1377
1363
  - spec/test_app_templates/catalog_controller.rb
1364
+ - spec/test_app_templates/fixture.css
1365
+ - spec/test_app_templates/fixture.png
1378
1366
  - spec/test_app_templates/lib/generators/test_app_generator.rb
1379
1367
  - spec/test_app_templates/spotlight_test.rake
1380
1368
  - spec/uploaders/spotlight/attachment_uploader_spec.rb
@@ -1480,12 +1468,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
1480
1468
  version: '2.2'
1481
1469
  required_rubygems_version: !ruby/object:Gem::Requirement
1482
1470
  requirements:
1483
- - - ">="
1471
+ - - ">"
1484
1472
  - !ruby/object:Gem::Version
1485
- version: '0'
1473
+ version: 1.3.1
1486
1474
  requirements: []
1487
1475
  rubyforge_project:
1488
- rubygems_version: 2.6.8
1476
+ rubygems_version: 2.6.11
1489
1477
  signing_key:
1490
1478
  specification_version: 4
1491
1479
  summary: Enable librarians, curators, and others who are responsible for digital collections
@@ -1665,7 +1653,6 @@ test_files:
1665
1653
  - spec/services/spotlight/iiif_resource_resolver_spec.rb
1666
1654
  - spec/services/spotlight/solr_document_builder_spec.rb
1667
1655
  - spec/spec_helper.rb
1668
- - spec/support/backport_test_helpers.rb
1669
1656
  - spec/support/controllers/engine_helpers.rb
1670
1657
  - spec/support/features/test_features_helpers.rb
1671
1658
  - spec/support/helpers/controller_level_helpers.rb
@@ -1673,6 +1660,8 @@ test_files:
1673
1660
  - spec/support/views/test_view_helpers.rb
1674
1661
  - spec/test_app_templates/carrierwave.rb
1675
1662
  - spec/test_app_templates/catalog_controller.rb
1663
+ - spec/test_app_templates/fixture.css
1664
+ - spec/test_app_templates/fixture.png
1676
1665
  - spec/test_app_templates/Gemfile.extra
1677
1666
  - spec/test_app_templates/lib/generators/test_app_generator.rb
1678
1667
  - spec/test_app_templates/spotlight_test.rake