blacklight-spotlight 0.18.0 → 0.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (159) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -9
  3. data/app/assets/javascripts/spotlight/blocks/browse_block.js +1 -0
  4. data/app/assets/stylesheets/spotlight/_bootstrap_overrides.scss +1 -1
  5. data/app/assets/stylesheets/spotlight/_multi_up_item_grid.scss +2 -0
  6. data/app/assets/stylesheets/spotlight/_pages.scss +7 -1
  7. data/app/controllers/spotlight/contact_forms_controller.rb +1 -5
  8. data/app/controllers/spotlight/searches_controller.rb +7 -1
  9. data/app/helpers/spotlight/browse_helper.rb +16 -1
  10. data/app/helpers/spotlight/searches_helper.rb +8 -0
  11. data/app/mailers/spotlight/contact_mailer.rb +9 -0
  12. data/app/models/spotlight/analytics/ga.rb +14 -16
  13. data/app/models/spotlight/blacklight_configuration.rb +6 -6
  14. data/app/models/spotlight/contact_form.rb +12 -10
  15. data/app/services/spotlight/carrierwave_file_resolver.rb +8 -0
  16. data/app/views/spotlight/browse/show.html.erb +5 -1
  17. data/app/views/spotlight/contact_mailer/report_problem.html.erb +14 -0
  18. data/app/views/spotlight/dashboards/analytics.html.erb +1 -3
  19. data/app/views/spotlight/searches/_form.html.erb +5 -0
  20. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb +4 -3
  21. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb +3 -2
  22. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb +3 -2
  23. data/config/locales/spotlight.en.yml +1 -0
  24. data/db/migrate/20160711121314_add_default_view_to_spotlight_searches.rb +5 -0
  25. data/lib/generators/spotlight/install_generator.rb +6 -0
  26. data/lib/generators/spotlight/templates/config/initializers/riiif.rb +7 -0
  27. data/lib/spotlight/version.rb +1 -1
  28. data/spec/controllers/application_controller_spec.rb +0 -2
  29. data/spec/controllers/spotlight/about_pages_controller_spec.rb +0 -2
  30. data/spec/controllers/spotlight/admin_users_controller_spec.rb +0 -2
  31. data/spec/controllers/spotlight/appearances_controller_spec.rb +0 -1
  32. data/spec/controllers/spotlight/application_controller_spec.rb +0 -2
  33. data/spec/controllers/spotlight/attachments_controller_spec.rb +0 -2
  34. data/spec/controllers/spotlight/browse_controller_spec.rb +0 -2
  35. data/spec/controllers/spotlight/catalog_controller_spec.rb +0 -2
  36. data/spec/controllers/spotlight/confirmations_controller_spec.rb +0 -2
  37. data/spec/controllers/spotlight/contact_forms_controller_spec.rb +5 -2
  38. data/spec/controllers/spotlight/contacts_controller_spec.rb +0 -2
  39. data/spec/controllers/spotlight/custom_fields_controller_spec.rb +0 -1
  40. data/spec/controllers/spotlight/dashboards_controller_spec.rb +0 -1
  41. data/spec/controllers/spotlight/exhibits_controller_spec.rb +1 -1
  42. data/spec/controllers/spotlight/feature_pages_controller_spec.rb +0 -1
  43. data/spec/controllers/spotlight/filters_controller_spec.rb +0 -2
  44. data/spec/controllers/spotlight/home_pages_controller_spec.rb +0 -2
  45. data/spec/controllers/spotlight/metadata_configurations_controller_spec.rb +0 -1
  46. data/spec/controllers/spotlight/resources_controller_spec.rb +0 -2
  47. data/spec/controllers/spotlight/roles_controller_spec.rb +0 -2
  48. data/spec/controllers/spotlight/search_configurations_controller_spec.rb +0 -1
  49. data/spec/controllers/spotlight/searches_controller_spec.rb +0 -2
  50. data/spec/controllers/spotlight/sites_controller_spec.rb +0 -2
  51. data/spec/controllers/spotlight/solr_controller_spec.rb +0 -2
  52. data/spec/controllers/spotlight/tags_controller_spec.rb +0 -2
  53. data/spec/controllers/spotlight/versions_controller_spec.rb +0 -2
  54. data/spec/controllers/spotlight/view_configurations_controller_spec.rb +0 -1
  55. data/spec/features/about_page_spec.rb +0 -2
  56. data/spec/features/add_contacts_spec.rb +0 -2
  57. data/spec/features/add_custom_field_metadata_spec.rb +0 -2
  58. data/spec/features/add_items_spec.rb +0 -2
  59. data/spec/features/browse_category_admin_spec.rb +13 -2
  60. data/spec/features/browse_category_spec.rb +27 -2
  61. data/spec/features/catalog_spec.rb +0 -2
  62. data/spec/features/confirm_email_spec.rb +0 -2
  63. data/spec/features/create_exhibit_spec.rb +0 -2
  64. data/spec/features/create_page_spec.rb +0 -2
  65. data/spec/features/curator_items.rb +0 -3
  66. data/spec/features/dashboard_spec.rb +0 -2
  67. data/spec/features/edit_contact_spec.rb +0 -3
  68. data/spec/features/edit_search_fields_spec.rb +0 -2
  69. data/spec/features/exhibit_masthead_spec.rb +0 -2
  70. data/spec/features/exhibits/add_tags_spec.rb +0 -1
  71. data/spec/features/exhibits/administration_spec.rb +0 -1
  72. data/spec/features/exhibits/custom_metadata_fields_spec.rb +0 -1
  73. data/spec/features/exhibits/edit_metadata_fields_spec.rb +0 -1
  74. data/spec/features/exhibits_index_spec.rb +0 -2
  75. data/spec/features/feature_page_spec.rb +0 -2
  76. data/spec/features/home_page_spec.rb +0 -1
  77. data/spec/features/import_exhibit_spec.rb +0 -1
  78. data/spec/features/item_admin_spec.rb +0 -2
  79. data/spec/features/javascript/about_page_admin_spec.rb +0 -2
  80. data/spec/features/javascript/block_controls_spec.rb +0 -2
  81. data/spec/features/javascript/blocks/featured_browse_categories_block_spec.rb +8 -0
  82. data/spec/features/javascript/edit_in_place_spec.rb +0 -2
  83. data/spec/features/javascript/feature_page_admin_spec.rb +0 -2
  84. data/spec/features/javascript/home_page_edit_spec.rb +0 -2
  85. data/spec/features/javascript/metadata_admin_spec.rb +0 -2
  86. data/spec/features/javascript/multi_image_select_spec.rb +0 -2
  87. data/spec/features/javascript/preview_block_spec.rb +0 -2
  88. data/spec/features/javascript/reindex_monitor_spec.rb +0 -2
  89. data/spec/features/javascript/roles_admin_spec.rb +0 -2
  90. data/spec/features/javascript/rule_block_spec.rb +0 -2
  91. data/spec/features/javascript/search_config_admin_spec.rb +0 -2
  92. data/spec/features/javascript/search_context_spec.rb +0 -2
  93. data/spec/features/main_navigation_spec.rb +0 -2
  94. data/spec/features/metadata_admin_spec.rb +0 -2
  95. data/spec/features/report_a_problem_spec.rb +0 -2
  96. data/spec/features/site_admin_management_spec.rb +0 -2
  97. data/spec/features/site_masthead_spec.rb +0 -6
  98. data/spec/features/slideshow_spec.rb +0 -2
  99. data/spec/features/tags_admin_spec.rb +0 -2
  100. data/spec/features/user_admin_spec.rb +0 -2
  101. data/spec/helpers/spotlight/application_helper_spec.rb +0 -1
  102. data/spec/helpers/spotlight/browse_helper_spec.rb +0 -1
  103. data/spec/helpers/spotlight/crud_link_helpers_spec.rb +0 -1
  104. data/spec/helpers/spotlight/jcrop_helper_spec.rb +0 -1
  105. data/spec/helpers/spotlight/main_app_helpers_spec.rb +0 -1
  106. data/spec/helpers/spotlight/navbar_helper_spec.rb +0 -1
  107. data/spec/helpers/spotlight/pages_helper_spec.rb +0 -1
  108. data/spec/helpers/spotlight/roles_helper_spec.rb +0 -1
  109. data/spec/helpers/spotlight/search_configurations_helper_spec.rb +0 -1
  110. data/spec/helpers/spotlight/title_helper_spec.rb +0 -1
  111. data/spec/jobs/spotlight/default_thumbnail_job_spec.rb +0 -1
  112. data/spec/jobs/spotlight/reindex_job_spec.rb +0 -1
  113. data/spec/jobs/spotlight/rename_sidecar_field_job_spec.rb +0 -1
  114. data/spec/lib/spotlight/controller_spec.rb +0 -1
  115. data/spec/mailers/spotlight/indexing_complete_mailer_spec.rb +0 -1
  116. data/spec/models/solr_document_spec.rb +0 -2
  117. data/spec/models/spotlight/ability_spec.rb +0 -1
  118. data/spec/models/spotlight/about_page_spec.rb +0 -2
  119. data/spec/models/spotlight/access_controls_enforcement_search_builder_spec.rb +0 -2
  120. data/spec/models/spotlight/blacklight_configuration_spec.rb +10 -2
  121. data/spec/models/spotlight/contact_email_spec.rb +0 -8
  122. data/spec/models/spotlight/contact_form_spec.rb +0 -2
  123. data/spec/models/spotlight/contact_spec.rb +0 -2
  124. data/spec/models/spotlight/custom_field_spec.rb +0 -1
  125. data/spec/models/spotlight/default_thumbnailable_concern_spec.rb +0 -2
  126. data/spec/models/spotlight/exhibit_spec.rb +0 -2
  127. data/spec/models/spotlight/feature_page_spec.rb +0 -2
  128. data/spec/models/spotlight/featured_image_spec.rb +0 -2
  129. data/spec/models/spotlight/field_metadata_spec.rb +0 -2
  130. data/spec/models/spotlight/filter_spec.rb +0 -2
  131. data/spec/models/spotlight/home_page_spec.rb +0 -2
  132. data/spec/models/spotlight/image_derivatives_spec.rb +0 -2
  133. data/spec/models/spotlight/main_navigation_spec.rb +0 -2
  134. data/spec/models/spotlight/masthead_spec.rb +0 -2
  135. data/spec/models/spotlight/page_spec.rb +0 -2
  136. data/spec/models/spotlight/reindex_progress_spec.rb +0 -2
  137. data/spec/models/spotlight/resource_spec.rb +0 -2
  138. data/spec/models/spotlight/role_spec.rb +0 -2
  139. data/spec/models/spotlight/search_spec.rb +0 -2
  140. data/spec/models/spotlight/site_spec.rb +0 -2
  141. data/spec/models/spotlight/sitemap_spec.rb +0 -1
  142. data/spec/models/spotlight/solr_document_sidecar_spec.rb +0 -2
  143. data/spec/models/spotlight/user_spec.rb +0 -2
  144. data/spec/routing/spotlight/exhibit_catalog_spec.rb +0 -1
  145. data/spec/routing/spotlight/pages_routing_spec.rb +30 -34
  146. data/spec/serializers/spotlight/exhibit_export_serializer_spec.rb +0 -2
  147. data/spec/services/spotlight/carrierwave_file_resolver_spec.rb +14 -0
  148. data/spec/spec_helper.rb +8 -2
  149. data/spec/uploaders/spotlight/item_uploader_spec.rb +0 -1
  150. data/spec/views/_user_util_links.html.erb_spec.rb +70 -74
  151. data/spec/views/shared/_analytics.html.erb_spec.rb +10 -15
  152. data/spec/views/shared/_exhibit_navbar.html.erb_spec.rb +0 -2
  153. data/spec/views/shared/_footer.html.erb_spec.rb +15 -19
  154. data/spec/views/shared/_header_navbar.html.erb_spec.rb +7 -12
  155. data/spec/views/shared/_masthead.html.erb_spec.rb +0 -13
  156. data/spec/views/spotlight/roles/index.html.erb_spec.rb +6 -5
  157. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb_spec.rb +1 -1
  158. metadata +37 -30
  159. data/app/views/spotlight/contact_forms/show.html.erb +0 -4
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  describe 'Add and update the site masthead', type: :feature do
4
2
  let(:exhibit) { FactoryGirl.create(:exhibit) }
5
3
  let(:user) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) }
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  describe 'Add tags to an item in an exhibit', type: :feature do
4
3
  let(:exhibit) { FactoryGirl.create(:exhibit) }
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  describe 'Exhibit Administration', type: :feature do
4
3
  let(:exhibit) { FactoryGirl.create(:exhibit) }
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  describe 'Adding custom metadata fields', type: :feature do
4
3
  let(:exhibit) { FactoryGirl.create(:exhibit) }
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  describe 'Editing metadata fields', type: :feature do
4
3
  let(:exhibit) { FactoryGirl.create(:exhibit) }
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  describe 'Exhibits index page', type: :feature do
4
2
  context 'with multiple exhibits' do
5
3
  let!(:exhibit) { FactoryGirl.create(:exhibit, title: 'Some Exhibit Title') }
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  describe 'Feature page', type: :feature do
4
2
  let(:exhibit) { FactoryGirl.create(:exhibit) }
5
3
  let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) }
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
  describe 'Home page', type: :feature do
3
2
  let(:exhibit) { FactoryGirl.create(:exhibit) }
4
3
  let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) }
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
  require 'tempfile'
3
2
 
4
3
  describe 'Allow exhibit admins to import and export content from an exhibit', type: :feature, js: true do
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  describe 'Item Administration', type: :feature do
4
2
  let(:exhibit) { FactoryGirl.create(:exhibit) }
5
3
  let(:curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) }
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  feature 'About Pages Adminstration', js: true do
4
2
  let(:exhibit) { FactoryGirl.create(:exhibit) }
5
3
  let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) }
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  feature 'Block controls' do
4
2
  let(:exhibit) { FactoryGirl.create(:exhibit) }
5
3
  let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) }
@@ -33,4 +33,12 @@ describe 'Featured Browse Category Block', type: :feature, js: true do
33
33
  expect(page).to have_css('.category-title', text: search2.title)
34
34
  expect(page).to have_css('.item-count', text: /\d+ items/i)
35
35
  end
36
+
37
+ it 'allows the curator to omit document counts' do
38
+ uncheck 'Include item counts?'
39
+ fill_in_typeahead_field with: 'Title1'
40
+ save_page
41
+
42
+ expect(page).not_to have_css('.item-count', text: /\d+ items/i)
43
+ end
36
44
  end
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  describe 'Edit in place', type: :feature, js: true do
4
2
  let(:exhibit) { FactoryGirl.create(:exhibit) }
5
3
  let(:admin) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) }
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  feature 'Feature Pages Adminstration', js: true do
4
2
  let(:exhibit) { FactoryGirl.create(:exhibit) }
5
3
  let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) }
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  feature 'Editing the Home Page', js: true do
4
2
  let(:exhibit) { FactoryGirl.create(:exhibit) }
5
3
  let(:admin) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) }
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  feature 'Metadata Administration', js: true do
4
2
  let(:exhibit) { FactoryGirl.create(:exhibit) }
5
3
  let(:admin) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) }
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  describe 'Multi image selector', type: :feature, js: true do
4
2
  let(:exhibit) { FactoryGirl.create(:exhibit) }
5
3
  let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) }
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  feature 'Block preview' do
4
2
  let(:exhibit) { FactoryGirl.create(:exhibit) }
5
3
  let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) }
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  feature 'Reindex Monitor', js: true do
4
2
  let(:resources) do
5
3
  [FactoryGirl.create(:resource, updated_at: Time.zone.now, index_status: 1)]
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  describe 'Roles Admin', type: :feature, js: true do
4
2
  let(:exhibit) { FactoryGirl.create(:exhibit) }
5
3
  let(:exhibit_admin) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) }
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  describe 'Horizontal rule block', type: :feature, js: true do
4
2
  let(:exhibit) { FactoryGirl.create(:exhibit) }
5
3
  let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) }
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  feature 'Search Configuration Administration', js: true do
4
2
  let(:exhibit) { FactoryGirl.create(:exhibit) }
5
3
  let(:user) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) }
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  feature 'Search contexts' do
4
2
  let(:exhibit) { FactoryGirl.create(:exhibit) }
5
3
  let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) }
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  describe 'Main navigation labels are settable', type: :feature do
4
2
  let!(:exhibit) { FactoryGirl.create(:exhibit) }
5
3
  let!(:about) { FactoryGirl.create(:about_page, exhibit: exhibit, published: true) }
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  describe 'Metadata Administration', type: :feature do
4
2
  let(:exhibit) { FactoryGirl.create(:exhibit) }
5
3
  let(:user) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) }
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  describe 'Report a Problem', type: :feature do
4
2
  let!(:exhibit) { FactoryGirl.create(:exhibit) }
5
3
  it 'does not have a header link' do
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  describe 'Site admin management', js: true do
4
2
  let(:user) { FactoryGirl.create(:site_admin) }
5
3
  let(:existing_user) { FactoryGirl.create(:exhibit_visitor) }
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  describe 'Add and update the site masthead', type: :feature do
4
2
  let(:user) { FactoryGirl.create(:site_admin) }
5
3
 
@@ -60,9 +58,7 @@ describe 'Add and update the site masthead', type: :feature do
60
58
  end
61
59
 
62
60
  click_button 'Save changes'
63
-
64
61
  expect(page).to have_content('The site was successfully updated.')
65
-
66
62
  expect(page).to have_css('.image-masthead .background-container')
67
63
  end
68
64
  it 'does not display an uploaded masthead if configured to not display' do
@@ -77,9 +73,7 @@ describe 'Add and update the site masthead', type: :feature do
77
73
  end
78
74
 
79
75
  click_button 'Save changes'
80
-
81
76
  expect(page).to have_content('The site was successfully updated.')
82
-
83
77
  expect(page).to_not have_css('.image-masthead .background-container')
84
78
  end
85
79
  end
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  describe 'Slideshow', type: :feature, js: true do
4
2
  let(:exhibit) { FactoryGirl.create(:exhibit) }
5
3
  let(:user) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) }
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  describe 'Tags Administration', type: :feature do
4
2
  let(:exhibit) { FactoryGirl.create(:exhibit) }
5
3
  let!(:tagging) { FactoryGirl.create(:tagging, tagger: exhibit) }
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  describe 'User Administration', type: :feature do
4
2
  let!(:exhibit) { FactoryGirl.create(:exhibit) }
5
3
  let!(:user) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) }
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  describe Spotlight::ApplicationHelper, type: :helper do
4
3
  describe '#application_name' do
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  describe Spotlight::BrowseHelper, type: :helper do
4
3
  it 'defaults to the gallery' do
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  module Spotlight
4
3
  describe CrudLinkHelpers, type: :helper do
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  describe Spotlight::JcropHelper do
4
3
  describe '.default_thumbnail_jcrop_options' do
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  describe Spotlight::MainAppHelpers, type: :helper do
4
3
  describe '#show_contact_form?' do
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  module Spotlight
4
3
  describe NavbarHelper, type: :helper do
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  module Spotlight
4
3
  describe PagesHelper, type: :helper do
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  describe Spotlight::RolesHelper, type: :helper do
4
3
  it 'is a list of options' do
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  describe Spotlight::SearchConfigurationsHelper, type: :helper do
4
3
  describe '#translate_sort_fields' do
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  describe Spotlight::TitleHelper, type: :helper do
4
3
  before do
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  describe Spotlight::DefaultThumbnailJob do
4
3
  let(:thumbnailable) { double('Thumbnailable') }
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  describe Spotlight::ReindexJob do
4
3
  let(:exhibit) { FactoryGirl.create(:exhibit) }
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  describe Spotlight::RenameSidecarFieldJob do
4
3
  let(:exhibit) { FactoryGirl.create(:exhibit) }
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  describe Spotlight::Controller do
4
3
  class MockController < ActionController::Base
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  describe Spotlight::IndexingCompleteMailer do
4
3
  let(:user) { double(email: 'test@example.com') }
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  describe SolrDocument, type: :model do
4
2
  subject { described_class.new(id: 'abcd123') }
5
3
  its(:to_key) { should == ['abcd123'] }
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
  require 'cancan/matchers'
3
2
 
4
3
  describe Spotlight::Ability, type: :model do
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  describe Spotlight::AboutPage, type: :model do
4
2
  let(:page) { described_class.create! exhibit: FactoryGirl.create(:exhibit) }
5
3
  it { is_expected.not_to be_feature_page }
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  describe Spotlight::AccessControlsEnforcementSearchBuilder do
4
2
  class MockSearchBuilder < Blacklight::SearchBuilder
5
3
  attr_reader :blacklight_params, :scope
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  describe Spotlight::BlacklightConfiguration, type: :model do
4
2
  subject { described_class.new }
5
3
  let(:blacklight_config) { Blacklight::Configuration.new }
@@ -79,6 +77,11 @@ describe Spotlight::BlacklightConfiguration, type: :model do
79
77
  expect(subject.blacklight_config.facet_fields['b'].sort).to eq 'index'
80
78
  end
81
79
 
80
+ it 'respects upstream configuration that disables the field entirely' do
81
+ blacklight_config.add_facet_field 'a', if: false
82
+ expect(subject.blacklight_config.facet_fields['a'].if).to eq false
83
+ end
84
+
82
85
  context 'custom fields' do
83
86
  it 'includes any custom fields' do
84
87
  allow(subject).to receive_messages(custom_facet_fields: { 'a' => double(if: nil, :if= => true, merge!: true, validate!: true, normalize!: true) })
@@ -346,6 +349,11 @@ describe Spotlight::BlacklightConfiguration, type: :model do
346
349
  expect(subject.blacklight_config.search_fields.select { |_k, v| v.enabled == true }).to include('a', 'c')
347
350
  expect(subject.blacklight_config.search_fields.select { |_k, v| v.enabled == true }).not_to include('b', 'd')
348
351
  end
352
+
353
+ it 'respects upstream configuration that disables the field entirely' do
354
+ blacklight_config.add_search_field 'a', if: false
355
+ expect(subject.blacklight_config.search_fields['a'].if).to eq false
356
+ end
349
357
  end
350
358
 
351
359
  describe 'per page' do
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  describe Spotlight::ContactEmail, type: :model do
4
2
  let(:exhibit) { FactoryGirl.create(:exhibit) }
5
3
  subject { described_class.new(exhibit: exhibit) }
@@ -18,12 +16,6 @@ describe Spotlight::ContactEmail, type: :model do
18
16
  before { subject.email = 'foo@example.com' }
19
17
  it { is_expected.to be_valid }
20
18
 
21
- describe 'when saved' do
22
- it 'sends a confirmation' do
23
- expect(subject).to receive(:send_devise_notification)
24
- subject.save
25
- end
26
- end
27
19
  describe '#send_devise_notification' do
28
20
  it 'sends stuff' do
29
21
  expect do
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  describe Spotlight::ContactForm do
4
2
  subject { described_class.new(name: 'Root', email: 'user@example.com').tap { |c| c.current_exhibit = exhibit } }
5
3
  let(:exhibit) { FactoryGirl.create(:exhibit) }
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  describe Spotlight::Contact, type: :model do
4
2
  context '#show_in_sidebar' do
5
3
  it 'is an attribute' do
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  describe Spotlight::CustomField, type: :model do
4
3
  describe '#label' do