blacklight-spotlight 1.4.1 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +5 -1
  3. data/app/assets/javascripts/spotlight/blocks/resources_block.js +3 -2
  4. data/app/assets/javascripts/spotlight/crop.es6 +2 -0
  5. data/app/assets/javascripts/spotlight/multi_image_selector.js +5 -4
  6. data/app/assets/javascripts/spotlight/reindex_monitor.js +16 -3
  7. data/app/controllers/concerns/spotlight/controller.rb +6 -1
  8. data/app/controllers/spotlight/browse_controller.rb +27 -0
  9. data/app/controllers/spotlight/catalog_controller.rb +2 -2
  10. data/app/helpers/spotlight/browse_helper.rb +0 -29
  11. data/app/helpers/spotlight/title_helper.rb +2 -2
  12. data/app/models/concerns/spotlight/custom_translation_extension.rb +23 -0
  13. data/app/models/concerns/spotlight/solr_document/atomic_updates.rb +4 -2
  14. data/app/models/spotlight/blacklight_configuration.rb +2 -2
  15. data/app/models/spotlight/exhibit.rb +1 -1
  16. data/app/views/layouts/spotlight/spotlight.html.erb +1 -0
  17. data/app/views/spotlight/dashboards/_analytics.html.erb +4 -4
  18. data/app/views/spotlight/search_configurations/_search_fields.html.erb +1 -1
  19. data/db/migrate/20180306142612_create_translations.rb +18 -0
  20. data/lib/generators/spotlight/install_generator.rb +4 -0
  21. data/lib/generators/spotlight/templates/config/initializers/translation.rb +17 -0
  22. data/lib/spotlight/engine.rb +1 -0
  23. data/lib/spotlight/version.rb +1 -1
  24. data/spec/controllers/spotlight/browse_controller_spec.rb +32 -0
  25. data/spec/controllers/spotlight/confirmations_controller_spec.rb +1 -1
  26. data/spec/controllers/spotlight/filters_controller_spec.rb +0 -1
  27. data/spec/controllers/spotlight/roles_controller_spec.rb +17 -0
  28. data/spec/controllers/spotlight/tags_controller_spec.rb +6 -1
  29. data/spec/examples.txt +1280 -1167
  30. data/spec/factories/translation.rb +6 -0
  31. data/spec/features/add_iiif_manifest_spec.rb +2 -0
  32. data/spec/features/browse_category_spec.rb +28 -0
  33. data/spec/features/edit_search_fields_spec.rb +1 -2
  34. data/spec/features/exhibit_masthead_spec.rb +2 -2
  35. data/spec/features/exhibit_themes_spec.rb +1 -1
  36. data/spec/features/exhibits/add_tags_spec.rb +1 -1
  37. data/spec/features/item_admin_spec.rb +1 -1
  38. data/spec/features/javascript/blocks/solr_documents_block_spec.rb +41 -28
  39. data/spec/features/javascript/multi_image_select_spec.rb +1 -1
  40. data/spec/features/javascript/reindex_monitor_spec.rb +1 -1
  41. data/spec/features/javascript/search_config_admin_spec.rb +16 -29
  42. data/spec/features/site_masthead_spec.rb +1 -1
  43. data/spec/features/slideshow_spec.rb +1 -2
  44. data/spec/features/translation_scope_spec.rb +24 -0
  45. data/spec/models/spotlight/ability_spec.rb +7 -10
  46. data/spec/models/spotlight/contact_email_spec.rb +1 -1
  47. data/spec/models/spotlight/contact_form_spec.rb +1 -1
  48. data/spec/models/spotlight/resources/iiif_harvester_spec.rb +3 -0
  49. data/spec/models/spotlight/solr_document/atomic_updates_spec.rb +2 -2
  50. data/spec/spec_helper.rb +12 -4
  51. data/spec/support/disable_friendly_id_deprecation_warnings.rb +8 -0
  52. data/spec/support/features/capybara_default_max_wait_metadata_helper.rb +16 -0
  53. data/spec/support/features/test_features_helpers.rb +12 -2
  54. data/spec/views/spotlight/browse/show.html.erb_spec.rb +0 -7
  55. data/spec/views/spotlight/roles/index.html.erb_spec.rb +2 -0
  56. data/spec/views/spotlight/tags/index.html.erb_spec.rb +1 -0
  57. data/vendor/assets/javascripts/Leaflet.Editable.js +22 -11
  58. data/vendor/assets/javascripts/leaflet-iiif.js +91 -23
  59. metadata +246 -227
  60. data/spec/features/curator_items.rb +0 -10
  61. data/spec/features/tags_admin_spec.rb +0 -27
  62. data/spec/features/user_admin_spec.rb +0 -29
@@ -0,0 +1,6 @@
1
+ FactoryBot.define do
2
+ factory :translation do
3
+ locale 'en'
4
+ exhibit
5
+ end
6
+ end
@@ -18,6 +18,7 @@ describe 'adding IIIF Manifest', type: :feature do
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
20
  url = 'https://purl.stanford.edu/vw754mr2281/iiif/manifest'
21
+ stub_request(:head, url).to_return(status: 200, headers: { 'Content-Type' => 'application/json' })
21
22
  visit spotlight.admin_exhibit_catalog_path(exhibit)
22
23
 
23
24
  click_link 'Add items'
@@ -30,6 +31,7 @@ describe 'adding IIIF Manifest', type: :feature do
30
31
 
31
32
  it 'returns an error message if the URL returned in not a IIIF endpoint' do
32
33
  visit spotlight.admin_exhibit_catalog_path(exhibit)
34
+ stub_request(:head, 'http://example.com').to_return(status: 200, headers: { 'Content-Type' => 'text/html' })
33
35
 
34
36
  click_link 'Add items'
35
37
  fill_in 'URL', with: 'http://example.com'
@@ -67,6 +67,34 @@ feature 'Browse pages' do
67
67
  end
68
68
  end
69
69
 
70
+ context 'in an exhibit that is configured to not show metadata in the default view' do
71
+ let(:mock_documents) do
72
+ [SolrDocument.new(id: 'abc123', language_ssm: %w[English Flemish])]
73
+ end
74
+ before do
75
+ blacklight_config = exhibit.blacklight_config
76
+ blacklight_config.index_fields.each do |_, config|
77
+ config.gallery = false
78
+ end
79
+ blacklight_config.save
80
+
81
+ allow_any_instance_of(Spotlight::BrowseController).to receive(:blacklight_config).and_return(
82
+ blacklight_config
83
+ )
84
+ end
85
+
86
+ it 'uses the appropriate view config' do
87
+ visit spotlight.exhibit_browse_path(exhibit, search)
88
+
89
+ expect(page).to have_css('#documents.gallery .document', count: 1)
90
+
91
+ within '.document' do
92
+ expect(page).not_to have_css('dt')
93
+ expect(page).not_to have_css('dd')
94
+ end
95
+ end
96
+ end
97
+
70
98
  context 'without a curator-selected view' do
71
99
  it 'renders the gallery view' do
72
100
  visit spotlight.exhibit_browse_path(exhibit, search)
@@ -27,7 +27,7 @@ describe 'Search Administration', type: :feature do
27
27
  it 'allows curators to select and unselect facets for display' do
28
28
  visit spotlight.edit_exhibit_search_configuration_path exhibit
29
29
 
30
- expect(page).to have_content 'Configuration Search Options Facets'
30
+ expect(page).to have_content "Configuration Search\nOptions Facets Results"
31
31
  expect(page).to have_button 'Save'
32
32
 
33
33
  uncheck 'blacklight_configuration_facet_fields_language_ssim_show' # Language
@@ -50,7 +50,6 @@ describe 'Search Administration', type: :feature do
50
50
  it 'updates sort options' do
51
51
  visit spotlight.edit_exhibit_search_configuration_path(exhibit)
52
52
 
53
- # #field_labeled doesn't appear to work for disabled inputs
54
53
  expect(page).to have_css("input[name='blacklight_configuration[sort_fields][relevance][enable]'][disabled='disabled']")
55
54
  expect(page).to have_css('#nested-sort-fields .dd-item:nth-child(5) h3', text: 'Date (new to old)')
56
55
 
@@ -33,8 +33,8 @@ describe 'Add and update the site masthead', type: :feature do
33
33
  click_link 'Exhibit masthead'
34
34
 
35
35
  within '#site-masthead' do
36
- expect(field_labeled('Show background image in masthead')).to be_checked
37
- expect(field_labeled('Upload an image')).to be_checked
36
+ expect(page).to have_checked_field 'Show background image in masthead'
37
+ expect(page).to have_checked_field 'Upload an image'
38
38
  end
39
39
  end
40
40
 
@@ -19,7 +19,7 @@ describe 'Update the site theme', type: :feature do
19
19
 
20
20
  click_link 'Exhibit masthead'
21
21
 
22
- expect(field_labeled('Modern')).to be_checked
22
+ expect(page).to have_checked_field 'Modern'
23
23
  expect(page).to have_xpath('//link[contains(@href, "/assets/application_modern")]', visible: false)
24
24
  end
25
25
  end
@@ -2,7 +2,7 @@
2
2
  describe 'Add tags to an item in an exhibit', type: :feature do
3
3
  let(:exhibit) { FactoryBot.create(:exhibit) }
4
4
  let(:curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
5
- let(:custom_field) { FactoryBot.create(:custom_field, exhibit: exhibit) }
5
+ let(:custom_field) { FactoryBot.build_stubbed(:custom_field, exhibit: exhibit) }
6
6
 
7
7
  before do
8
8
  login_as(curator)
@@ -34,7 +34,7 @@ describe 'Item Administration', type: :feature do
34
34
  item.click_button 'Make Public'
35
35
  end
36
36
 
37
- it "toggles the 'blacklight-private' label", js: true do
37
+ it "toggles the 'blacklight-private' label", js: true, default_max_wait_time: 5 do
38
38
  visit spotlight.admin_exhibit_catalog_path(exhibit)
39
39
  # The label should be toggled when the checkbox is clicked
40
40
  expect(page).to_not have_css('tr.blacklight-private')
@@ -1,4 +1,4 @@
1
- feature 'Solr Document Block', feature: true, versioning: true do
1
+ feature 'Solr Document Block', feature: true, versioning: true, default_max_wait_time: 15 do
2
2
  let(:exhibit) { FactoryBot.create(:exhibit) }
3
3
  let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
4
4
  let(:feature_page) do
@@ -26,7 +26,7 @@ feature 'Solr Document Block', feature: true, versioning: true do
26
26
  end
27
27
 
28
28
  scenario 'it should allow you to add a solr document to the widget', js: true do
29
- fill_in_typeahead_field with: 'dq287tq6352'
29
+ fill_in_solr_document_block_typeahead_field with: 'dq287tq6352'
30
30
  within(:css, '.panel') do
31
31
  expect(page).to have_content "L'AMERIQUE"
32
32
  end
@@ -34,7 +34,7 @@ feature 'Solr Document Block', feature: true, versioning: true do
34
34
  save_page
35
35
 
36
36
  # verify that the item + image widget is displaying an image from the document.
37
- within(:css, '.items-block') do
37
+ within(:css, '.items-block', visible: true) do
38
38
  expect(page).to have_css('.thumbnail')
39
39
  expect(page).to have_css('.thumbnail a img')
40
40
  expect(page).not_to have_css('.title')
@@ -42,22 +42,24 @@ feature 'Solr Document Block', feature: true, versioning: true do
42
42
  end
43
43
 
44
44
  scenario 'it should allow you to add multiple solr documents to the widget', js: true do
45
- fill_in_typeahead_field with: 'dq287tq6352'
46
- fill_in_typeahead_field with: 'gk446cj2442'
45
+ fill_in_solr_document_block_typeahead_field with: 'dq287tq6352'
46
+ fill_in_solr_document_block_typeahead_field with: 'gk446cj2442'
47
+ expect(page).to have_selector '.panels li', count: 2, visible: true
47
48
 
48
49
  save_page
49
50
 
50
- expect(page).to have_selector '.items-block .box', count: 2
51
+ expect(page).to have_selector '.items-block .box', count: 2, visible: true
51
52
  end
52
53
 
53
- scenario 'it should allow you to choose from a multi-image solr document (and persist through edits)', js: true do
54
- fill_in_typeahead_field with: 'xd327cm9378'
54
+ scenario 'it should allow you to choose from a multi-image solr document (and persist through edits)', js: true, default_max_wait_time: 30 do
55
+ fill_in_solr_document_block_typeahead_field with: 'xd327cm9378'
55
56
 
56
57
  expect(page).to have_css('[data-panel-image-pagination]', text: /Image 1 of 2/, visible: true)
57
58
 
58
59
  # Select the last image
59
60
  click_link('Change')
60
- find('.thumbs-list li:last-child').click
61
+ find('.thumbs-list li[data-index="1"]').click
62
+ expect(page).to have_css('[data-panel-image-pagination]', text: /Image 2 of 2/, visible: true)
61
63
 
62
64
  save_page
63
65
 
@@ -81,13 +83,13 @@ feature 'Solr Document Block', feature: true, versioning: true do
81
83
  end
82
84
 
83
85
  scenario 'it should allow you toggle visibility of solr documents', js: true do
84
- fill_in_typeahead_field with: 'dq287tq6352'
86
+ fill_in_solr_document_block_typeahead_field with: 'dq287tq6352'
85
87
 
86
88
  within(:css, '.panel') do
87
89
  uncheck 'Display?'
88
90
  end
89
91
 
90
- fill_in_typeahead_field with: 'gk446cj2442'
92
+ fill_in_solr_document_block_typeahead_field with: 'gk446cj2442'
91
93
 
92
94
  # display the title as the primary caption
93
95
  within('.primary-caption') do
@@ -97,13 +99,13 @@ feature 'Solr Document Block', feature: true, versioning: true do
97
99
 
98
100
  save_page
99
101
 
100
- expect(page).to have_selector '.items-block .box', count: 1
102
+ expect(page).to have_selector '.items-block .box', count: 1, visible: true
101
103
  expect(page).to have_content '[World map]'
102
104
  expect(page).not_to have_content "L'AMERIQUE"
103
105
  end
104
106
 
105
107
  scenario 'should allow you to optionally display captions with the image', js: true do
106
- fill_in_typeahead_field with: 'gk446cj2442'
108
+ fill_in_solr_document_block_typeahead_field with: 'gk446cj2442'
107
109
 
108
110
  # display the title as the primary caption
109
111
  within('.primary-caption') do
@@ -119,7 +121,7 @@ feature 'Solr Document Block', feature: true, versioning: true do
119
121
  save_page
120
122
 
121
123
  # verify that the item + image widget is displaying image and title from the requested document.
122
- within(:css, '.items-block') do
124
+ within(:css, '.items-block', visible: true) do
123
125
  expect(page).to have_css('.thumbnail')
124
126
  expect(page).to have_css('.thumbnail a img')
125
127
  expect(page).to have_css('.primary-caption', text: '[World map]')
@@ -128,15 +130,21 @@ feature 'Solr Document Block', feature: true, versioning: true do
128
130
  end
129
131
 
130
132
  scenario 'should allow you to optionally display a ZPR link with the image', js: true do
131
- fill_in_typeahead_field with: 'gk446cj2442'
133
+ fill_in_solr_document_block_typeahead_field with: 'gk446cj2442'
132
134
 
133
- check 'zpr_link'
135
+ check 'Display ZPR link'
136
+ # this seems silly, but also seems to help with the flappy-ness of this spec
137
+ expect(find_field('Display ZPR link', checked: true)).to be_checked
134
138
 
135
139
  save_page
136
140
 
137
- expect(page).to have_selector('.zpr-link[data-iiif-tilesource]')
138
- click_on 'Show in ZPR viewer'
139
- expect(page).to have_css('#osd-modal-container')
141
+ within '.contents' do
142
+ click_button 'Show in ZPR viewer'
143
+ end
144
+
145
+ within '.modal-content' do
146
+ expect(page).to have_css('#osd-modal-container')
147
+ end
140
148
  end
141
149
 
142
150
  scenario 'should allow you to add text to the image', js: true do
@@ -148,38 +156,43 @@ feature 'Solr Document Block', feature: true, versioning: true do
148
156
 
149
157
  # visit the show page for the document we just saved
150
158
  # verify that the item + image widget is displaying image and title from the requested document.
151
- within(:css, '.items-block') do
159
+ within(:css, '.items-block', visible: true) do
152
160
  expect(page).to have_content 'zzz'
153
161
  end
154
162
  end
155
163
 
156
164
  scenario 'should allow you to choose which side the text will be on', js: true do
157
- fill_in_typeahead_field with: 'dq287tq6352'
165
+ fill_in_solr_document_block_typeahead_field with: 'dq287tq6352'
166
+
167
+ # Select to align the text right
168
+ choose 'Right'
169
+ # this seems silly, but also seems to help with the flappy-ness of this spec
170
+ expect(find_field('Right', checked: true)).to be_checked
158
171
 
159
172
  # fill in the content editable div
160
173
  content_editable = find('.st-text-block')
161
174
  content_editable.set('zzz')
162
- # Select to align the text right
163
- choose 'Right'
175
+
164
176
  # create the page
165
177
  save_page
166
178
 
167
179
  # verify that the item + image widget is displaying image and title from the requested document.
168
180
  within(:css, '.items-block') do
169
- expect(page).to have_content 'zzz'
181
+ within('.text-col') do
182
+ expect(page).to have_content 'zzz'
183
+ end
170
184
  expect(page).to have_css('.items-col.pull-left')
171
- expect(page).to have_css('.text-col')
172
185
  end
173
186
  end
174
187
 
175
188
  scenario 'round-trip data', js: true do
176
- fill_in_typeahead_field with: 'dq287tq6352'
189
+ fill_in_solr_document_block_typeahead_field with: 'dq287tq6352'
177
190
 
178
191
  within(:css, '.panel') do
179
192
  uncheck 'Display?'
180
193
  end
181
194
 
182
- fill_in_typeahead_field with: 'gk446cj2442'
195
+ fill_in_solr_document_block_typeahead_field with: 'gk446cj2442'
183
196
 
184
197
  # display the title as the primary caption
185
198
  within('.primary-caption') do
@@ -197,7 +210,7 @@ feature 'Solr Document Block', feature: true, versioning: true do
197
210
 
198
211
  click_on 'Edit'
199
212
 
200
- expect(page).to have_selector '.panel', count: 2
213
+ expect(page).to have_selector '.panel', count: 2, visible: true
201
214
 
202
215
  # for some reason, the text area above isn't getting filled in
203
216
  # expect(page).to have_selector ".st-text-block", text: "zzz"
@@ -1,4 +1,4 @@
1
- describe 'Multi image selector', type: :feature, js: true, versioning: true do
1
+ describe 'Multi image selector', type: :feature, js: true, versioning: true, default_max_wait_time: 5 do
2
2
  let(:exhibit) { FactoryBot.create(:exhibit) }
3
3
  let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
4
4
  let(:feature_page) { FactoryBot.create(:feature_page, exhibit: exhibit) }
@@ -1,4 +1,4 @@
1
- feature 'Reindex Monitor', js: true do
1
+ feature 'Reindex Monitor', js: true, default_max_wait_time: 10 do
2
2
  let(:resources) do
3
3
  [FactoryBot.create(:resource)]
4
4
  end
@@ -3,31 +3,24 @@ feature 'Search Configuration Administration', js: true do
3
3
  let(:user) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
4
4
  before { login_as user }
5
5
 
6
- describe 'search fields' do
6
+ describe 'search fields', default_max_wait_time: 5 do
7
7
  it 'allows the curator to disable all search fields' do
8
8
  visit spotlight.exhibit_home_page_path(exhibit, exhibit.home_page)
9
9
  expect(page).to have_css 'select#search_field'
10
10
 
11
- click_link user.email
12
- within '#user-util-collapse .dropdown' do
13
- click_link 'Exhibit dashboard'
14
- end
15
- click_link 'Search'
16
-
11
+ visit spotlight.edit_exhibit_search_configuration_path(exhibit)
17
12
  expect(page).to have_css 'input#enable_feature', visible: true
18
13
  uncheck 'Display search box'
19
14
 
20
15
  click_button 'Save changes'
21
16
 
22
- expect(page).to have_content('The exhibit was successfully updated.')
17
+ expect(page).to have_css('.alert', text: 'The exhibit was successfully updated.', visible: true)
23
18
 
24
19
  expect(page).not_to have_css 'select#search_field'
25
20
  end
26
21
 
27
22
  it 'allows the curator to update search field options' do
28
- visit spotlight.exhibit_dashboard_path(exhibit)
29
-
30
- click_link 'Search'
23
+ visit spotlight.edit_exhibit_search_configuration_path(exhibit)
31
24
 
32
25
  click_link 'Options'
33
26
 
@@ -42,7 +35,7 @@ feature 'Search Configuration Administration', js: true do
42
35
 
43
36
  click_button 'Save changes'
44
37
 
45
- expect(page).to have_content('The exhibit was successfully updated.')
38
+ expect(page).to have_css('.alert', text: 'The exhibit was successfully updated.', visible: true)
46
39
  expect(page).to have_select 'Search in', with_options: ['My Title Label']
47
40
  end
48
41
  end
@@ -50,9 +43,7 @@ feature 'Search Configuration Administration', js: true do
50
43
  describe 'facets' do
51
44
  it 'allows us to update the label with edit-in-place' do
52
45
  input_id = 'blacklight_configuration_facet_fields_genre_ssim_label'
53
- visit spotlight.exhibit_dashboard_path(exhibit)
54
-
55
- click_link 'Search'
46
+ visit spotlight.edit_exhibit_search_configuration_path(exhibit)
56
47
 
57
48
  click_link 'Facets'
58
49
 
@@ -69,7 +60,7 @@ feature 'Search Configuration Administration', js: true do
69
60
  click_button 'Save changes'
70
61
  click_link 'Facets'
71
62
 
72
- expect(page).to have_content('The exhibit was successfully updated.')
63
+ expect(page).to have_css('.alert', text: 'The exhibit was successfully updated.', visible: true)
73
64
 
74
65
  expect(page).not_to have_content('Genre')
75
66
  expect(page).to have_content('Topic')
@@ -88,7 +79,7 @@ feature 'Search Configuration Administration', js: true do
88
79
 
89
80
  click_button 'Save changes'
90
81
 
91
- expect(page).to have_content('The exhibit was successfully updated.')
82
+ expect(page).to have_css('.alert', text: 'The exhibit was successfully updated.', visible: true)
92
83
 
93
84
  exhibit.reload
94
85
  expect(exhibit.blacklight_config.facet_fields['genre_ssim'].sort).to eq 'index'
@@ -97,9 +88,7 @@ feature 'Search Configuration Administration', js: true do
97
88
 
98
89
  describe 'results' do
99
90
  it 'updates search result options' do
100
- visit spotlight.exhibit_dashboard_path(exhibit)
101
-
102
- click_link 'Search'
91
+ visit spotlight.edit_exhibit_search_configuration_path(exhibit)
103
92
 
104
93
  click_link 'Results'
105
94
 
@@ -109,20 +98,18 @@ feature 'Search Configuration Administration', js: true do
109
98
 
110
99
  click_button 'Save changes'
111
100
 
112
- expect(page).to have_content('The exhibit was successfully updated.')
101
+ expect(page).to have_css('.alert', text: 'The exhibit was successfully updated.', visible: true)
113
102
 
114
103
  click_link 'Results'
115
104
 
116
- expect(field_labeled('List')).to_not be_checked
117
- expect(field_labeled('Gallery')).to be_checked
105
+ expect(page).to have_unchecked_field 'List'
106
+ expect(page).to have_checked_field 'Gallery'
118
107
 
119
- expect(field_labeled('20')).to be_checked
120
- expect(field_labeled('10')).to_not be_checked
108
+ expect(page).to have_checked_field '20'
109
+ expect(page).to have_unchecked_field '10'
121
110
  end
122
111
  it 'updates Sort field result options' do
123
- visit spotlight.exhibit_dashboard_path(exhibit)
124
-
125
- click_link 'Search'
112
+ visit spotlight.edit_exhibit_search_configuration_path(exhibit)
126
113
 
127
114
  click_link 'Results'
128
115
 
@@ -137,7 +124,7 @@ feature 'Search Configuration Administration', js: true do
137
124
 
138
125
  click_button 'Save changes'
139
126
 
140
- expect(page).to have_content('The exhibit was successfully updated.')
127
+ expect(page).to have_css('.alert', text: 'The exhibit was successfully updated.', visible: true)
141
128
 
142
129
  click_link 'Results'
143
130
 
@@ -24,7 +24,7 @@ describe 'Add and update the site masthead', type: :feature do
24
24
  click_link 'Site masthead'
25
25
 
26
26
  within '#site-masthead' do
27
- expect(field_labeled('Show background image in masthead')).to be_checked
27
+ expect(page).to have_checked_field 'Show background image in masthead'
28
28
  end
29
29
  end
30
30
 
@@ -7,13 +7,12 @@ describe 'Slideshow', type: :feature, js: true do
7
7
  exhibit.blacklight_configuration.update(document_index_view_types: %w(list gallery slideshow))
8
8
  end
9
9
  it 'has slideshow' do
10
- pending('does not work with chrome headless')
11
10
  visit spotlight.search_exhibit_catalog_path(exhibit, f: { genre_ssim: ['map'] })
12
11
  expect(page).to have_content 'You searched for:'
13
12
  within '.view-type' do
14
13
  click_link 'Slideshow'
15
14
  end
16
- find('.grid [data-slide-to="1"]').click
15
+ find('.grid [data-slide-to="1"] img').click
17
16
  expect(page).to have_selector '#slideshow', visible: true
18
17
  end
19
18
  end