blacklight-spotlight 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -4
- data/app/assets/javascripts/spotlight/blocks/link_to_search_block.js +16 -0
- data/app/assets/javascripts/spotlight/exhibits.js +16 -5
- data/app/assets/javascripts/spotlight/form_observer.js +2 -2
- data/app/assets/javascripts/spotlight/pages.js.erb +3 -2
- data/app/assets/javascripts/spotlight/sir-trevor/locales.js +6 -0
- data/app/controllers/spotlight/concerns/application_controller.rb +4 -8
- data/app/controllers/spotlight/contact_email_controller.rb +22 -0
- data/app/controllers/spotlight/searches_controller.rb +3 -1
- data/app/models/concerns/spotlight/blacklight_configuration_defaults.rb +4 -4
- data/app/models/sir_trevor_rails/blocks/browse_block.rb +7 -1
- data/app/models/sir_trevor_rails/blocks/featured_pages_block.rb +3 -1
- data/app/models/sir_trevor_rails/blocks/link_to_search_block.rb +15 -0
- data/app/models/spotlight/ability.rb +1 -1
- data/app/models/spotlight/blacklight_configuration.rb +8 -7
- data/app/models/spotlight/exhibit.rb +2 -0
- data/app/models/spotlight/resource.rb +8 -2
- data/app/services/spotlight/carrierwave_file_resolver.rb +5 -0
- data/app/services/spotlight/upload_solr_document_builder.rb +2 -2
- data/app/views/spotlight/appearances/edit.html.erb +1 -1
- data/app/views/spotlight/exhibits/_confirmation_status.html.erb +1 -1
- data/app/views/spotlight/exhibits/_contact.html.erb +15 -10
- data/app/views/spotlight/exhibits/_exhibit_card_back.html.erb +2 -2
- data/app/views/spotlight/exhibits/_form.html.erb +7 -6
- data/app/views/spotlight/metadata_configurations/edit.html.erb +1 -1
- data/app/views/spotlight/pages/_form.html.erb +1 -1
- data/app/views/spotlight/search_configurations/_facets.html.erb +1 -1
- data/app/views/spotlight/search_configurations/_search_fields.html.erb +1 -1
- data/app/views/spotlight/search_configurations/_sort.html.erb +1 -1
- data/app/views/spotlight/sir_trevor/blocks/_link_to_search_block.html.erb +23 -0
- data/config/locales/spotlight.en.yml +9 -0
- data/config/routes.rb +1 -0
- data/db/migrate/20171005231502_add_missing_indexes_on_taggings.acts_as_taggable_on_engine.rb +23 -0
- data/lib/spotlight/engine.rb +4 -3
- data/lib/spotlight/version.rb +1 -1
- data/spec/controllers/application_controller_spec.rb +1 -1
- data/spec/controllers/spotlight/about_pages_controller_spec.rb +15 -15
- data/spec/controllers/spotlight/admin_users_controller_spec.rb +4 -4
- data/spec/controllers/spotlight/appearances_controller_spec.rb +3 -3
- data/spec/controllers/spotlight/application_controller_spec.rb +1 -1
- data/spec/controllers/spotlight/attachments_controller_spec.rb +2 -2
- data/spec/controllers/spotlight/browse_controller_spec.rb +4 -4
- data/spec/controllers/spotlight/catalog_controller_spec.rb +15 -15
- data/spec/controllers/spotlight/confirmations_controller_spec.rb +1 -1
- data/spec/controllers/spotlight/contact_email_controller_spec.rb +63 -0
- data/spec/controllers/spotlight/contact_forms_controller_spec.rb +1 -1
- data/spec/controllers/spotlight/contacts_controller_spec.rb +5 -5
- data/spec/controllers/spotlight/custom_fields_controller_spec.rb +3 -3
- data/spec/controllers/spotlight/dashboards_controller_spec.rb +3 -3
- data/spec/controllers/spotlight/exhibits_controller_spec.rb +4 -4
- data/spec/controllers/spotlight/feature_pages_controller_spec.rb +12 -12
- data/spec/controllers/spotlight/featured_images_controller_spec.rb +2 -2
- data/spec/controllers/spotlight/filters_controller_spec.rb +4 -4
- data/spec/controllers/spotlight/home_pages_controller_spec.rb +5 -5
- data/spec/controllers/spotlight/metadata_configurations_controller_spec.rb +3 -3
- data/spec/controllers/spotlight/resources/csv_upload_controller_spec.rb +2 -2
- data/spec/controllers/spotlight/resources/upload_controller_spec.rb +2 -2
- data/spec/controllers/spotlight/resources_controller_spec.rb +2 -2
- data/spec/controllers/spotlight/roles_controller_spec.rb +4 -4
- data/spec/controllers/spotlight/search_configurations_controller_spec.rb +3 -3
- data/spec/controllers/spotlight/searches_controller_spec.rb +10 -11
- data/spec/controllers/spotlight/sites_controller_spec.rb +5 -5
- data/spec/controllers/spotlight/solr_controller_spec.rb +3 -3
- data/spec/controllers/spotlight/tags_controller_spec.rb +3 -3
- data/spec/controllers/spotlight/versions_controller_spec.rb +7 -7
- data/spec/controllers/spotlight/view_configurations_controller_spec.rb +3 -3
- data/spec/examples.txt +1154 -1136
- data/spec/factories/contact_emails.rb +6 -0
- data/spec/factories/contact_images.rb +1 -1
- data/spec/factories/contacts.rb +1 -1
- data/spec/factories/custom_fields.rb +1 -1
- data/spec/factories/exhibit_thumbnails.rb +1 -1
- data/spec/factories/exhibits.rb +2 -2
- data/spec/factories/featured_images.rb +1 -1
- data/spec/factories/pages.rb +2 -2
- data/spec/factories/reindexing_log_entries.rb +1 -1
- data/spec/factories/resources.rb +1 -1
- data/spec/factories/roles.rb +2 -2
- data/spec/factories/searches.rb +3 -3
- data/spec/factories/tags.rb +3 -3
- data/spec/factories/users.rb +2 -2
- data/spec/features/about_page_spec.rb +6 -6
- data/spec/features/add_contacts_spec.rb +3 -3
- data/spec/features/add_custom_field_metadata_spec.rb +4 -4
- data/spec/features/add_iiif_manifest_spec.rb +2 -2
- data/spec/features/add_items_spec.rb +4 -4
- data/spec/features/autocomplete_typeahead_spec.rb +3 -4
- data/spec/features/browse_category_admin_spec.rb +3 -3
- data/spec/features/browse_category_spec.rb +3 -3
- data/spec/features/catalog_spec.rb +3 -3
- data/spec/features/confirm_email_spec.rb +1 -1
- data/spec/features/create_exhibit_spec.rb +1 -1
- data/spec/features/create_page_spec.rb +5 -5
- data/spec/features/curator_items.rb +2 -2
- data/spec/features/dashboard_spec.rb +4 -4
- data/spec/features/edit_contact_spec.rb +4 -4
- data/spec/features/edit_search_fields_spec.rb +2 -2
- data/spec/features/exhibit_masthead_spec.rb +2 -2
- data/spec/features/exhibit_themes_spec.rb +2 -2
- data/spec/features/exhibits/add_tags_spec.rb +3 -3
- data/spec/features/exhibits/administration_spec.rb +78 -4
- data/spec/features/exhibits/custom_metadata_fields_spec.rb +2 -2
- data/spec/features/exhibits/edit_metadata_fields_spec.rb +2 -2
- data/spec/features/exhibits_index_spec.rb +3 -3
- data/spec/features/feature_page_spec.rb +9 -9
- data/spec/features/home_page_spec.rb +4 -4
- data/spec/features/import_exhibit_spec.rb +2 -2
- data/spec/features/item_admin_spec.rb +2 -2
- data/spec/features/javascript/about_page_admin_spec.rb +2 -2
- data/spec/features/javascript/block_controls_spec.rb +2 -2
- data/spec/features/javascript/blocks/featured_browse_categories_block_spec.rb +5 -5
- data/spec/features/javascript/blocks/featured_pages_block_spec.rb +4 -4
- data/spec/features/javascript/blocks/link_to_search_block_spec.rb +44 -0
- data/spec/features/javascript/{rule_block_spec.rb → blocks/rule_block_spec.rb} +4 -4
- data/spec/features/javascript/blocks/search_result_block_spec.rb +4 -4
- data/spec/features/javascript/blocks/solr_documents_block_spec.rb +5 -6
- data/spec/features/javascript/blocks/uploaded_items_block_spec.rb +3 -4
- data/spec/features/javascript/edit_in_place_spec.rb +2 -2
- data/spec/features/javascript/feature_page_admin_spec.rb +26 -7
- data/spec/features/javascript/home_page_edit_spec.rb +3 -3
- data/spec/features/javascript/metadata_admin_spec.rb +2 -2
- data/spec/features/javascript/multi_image_select_spec.rb +6 -6
- data/spec/features/javascript/reindex_monitor_spec.rb +4 -4
- data/spec/features/javascript/roles_admin_spec.rb +3 -3
- data/spec/features/javascript/search_config_admin_spec.rb +2 -3
- data/spec/features/javascript/search_context_spec.rb +6 -6
- data/spec/features/main_navigation_spec.rb +2 -2
- data/spec/features/metadata_admin_spec.rb +2 -2
- data/spec/features/report_a_problem_spec.rb +2 -2
- data/spec/features/site_admin_management_spec.rb +4 -4
- data/spec/features/site_masthead_spec.rb +1 -1
- data/spec/features/slideshow_spec.rb +4 -3
- data/spec/features/tags_admin_spec.rb +3 -3
- data/spec/features/user_admin_spec.rb +2 -2
- data/spec/helpers/spotlight/application_helper_spec.rb +2 -2
- data/spec/helpers/spotlight/crud_link_helpers_spec.rb +1 -1
- data/spec/helpers/spotlight/main_app_helpers_spec.rb +3 -3
- data/spec/helpers/spotlight/meta_helper_spec.rb +1 -1
- data/spec/helpers/spotlight/pages_helper_spec.rb +2 -2
- data/spec/jobs/spotlight/add_uploads_from_csv_spec.rb +3 -3
- data/spec/jobs/spotlight/reindex_job_spec.rb +3 -3
- data/spec/jobs/spotlight/rename_sidecar_field_job_spec.rb +1 -1
- data/spec/lib/migration/iiif_spec.rb +3 -3
- data/spec/lib/spotlight/controller_spec.rb +3 -3
- data/spec/models/sir_trevor_rails/blocks/browse_block_spec.rb +19 -1
- data/spec/models/sir_trevor_rails/blocks/featured_pages_block_spec.rb +9 -1
- data/spec/models/sir_trevor_rails/blocks/search_results_block_spec.rb +1 -1
- data/spec/models/sir_trevor_rails/blocks/solr_documents_block_spec.rb +1 -1
- data/spec/models/solr_document_spec.rb +2 -2
- data/spec/models/spotlight/ability_spec.rb +9 -9
- data/spec/models/spotlight/about_page_spec.rb +1 -1
- data/spec/models/spotlight/access_controls_enforcement_search_builder_spec.rb +1 -1
- data/spec/models/spotlight/blacklight_configuration_spec.rb +15 -1
- data/spec/models/spotlight/contact_email_spec.rb +1 -1
- data/spec/models/spotlight/contact_form_spec.rb +1 -1
- data/spec/models/spotlight/contact_spec.rb +1 -1
- data/spec/models/spotlight/custom_field_spec.rb +5 -5
- data/spec/models/spotlight/exhibit_spec.rb +20 -16
- data/spec/models/spotlight/feature_page_spec.rb +14 -14
- data/spec/models/spotlight/field_metadata_spec.rb +1 -1
- data/spec/models/spotlight/home_page_spec.rb +1 -1
- data/spec/models/spotlight/main_navigation_spec.rb +1 -1
- data/spec/models/spotlight/page_spec.rb +12 -8
- data/spec/models/spotlight/reindex_progress_spec.rb +4 -4
- data/spec/models/spotlight/reindexing_log_entry_spec.rb +8 -8
- data/spec/models/spotlight/resource_spec.rb +12 -1
- data/spec/models/spotlight/resources/iiif_harvester_spec.rb +1 -1
- data/spec/models/spotlight/resources/iiif_manifest_spec.rb +1 -1
- data/spec/models/spotlight/resources/upload_spec.rb +3 -3
- data/spec/models/spotlight/role_spec.rb +3 -3
- data/spec/models/spotlight/search_spec.rb +7 -7
- data/spec/models/spotlight/sitemap_spec.rb +6 -6
- data/spec/models/spotlight/solr_document_sidecar_spec.rb +1 -1
- data/spec/presenters/spotlight/iiif_manifest_presenter_spec.rb +1 -1
- data/spec/serializers/spotlight/exhibit_export_serializer_spec.rb +20 -20
- data/spec/services/spotlight/carrierwave_file_resolver_spec.rb +1 -1
- data/spec/services/spotlight/iiif_resource_resolver_spec.rb +1 -1
- data/spec/services/spotlight/solr_document_builder_spec.rb +3 -3
- data/spec/spec_helper.rb +4 -5
- data/spec/support/features/test_features_helpers.rb +2 -2
- data/spec/uploaders/spotlight/featured_image_uploader_spec.rb +1 -1
- data/spec/views/_user_util_links.html.erb_spec.rb +1 -1
- data/spec/views/shared/_exhibit_navbar.html.erb_spec.rb +9 -9
- data/spec/views/shared/_masthead.html.erb_spec.rb +3 -3
- data/spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb +4 -4
- data/spec/views/spotlight/browse/_search.html.erb_spec.rb +2 -2
- data/spec/views/spotlight/browse/index.html.erb_spec.rb +2 -2
- data/spec/views/spotlight/browse/show.html.erb_spec.rb +2 -2
- data/spec/views/spotlight/contacts/edit.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/dashboards/_analytics.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/dashboards/_reindexing_activity.html.erb_spec.rb +6 -6
- data/spec/views/spotlight/dashboards/analytics.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/exhibits/edit.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/exhibits/index.html.erb_spec.rb +6 -6
- data/spec/views/spotlight/feature_pages/_sidebar.html.erb_spec.rb +8 -8
- data/spec/views/spotlight/home_pages/_empty.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/metadata_configurations/edit.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/pages/_form.html.erb_spec.rb +18 -0
- data/spec/views/spotlight/roles/index.html.erb_spec.rb +2 -2
- data/spec/views/spotlight/search_configurations/_facets.html.erb_spec.rb +14 -2
- data/spec/views/spotlight/search_configurations/_search_fields.html.erb_spec.rb +9 -2
- data/spec/views/spotlight/search_configurations/_sort.html.erb_spec.rb +10 -1
- data/spec/views/spotlight/searches/_search.html.erb_spec.rb +8 -8
- data/spec/views/spotlight/searches/edit.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/sir_trevor/blocks/_browse_block.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/sir_trevor/blocks/_link_to_search_block.html.erb_spec.rb +18 -0
- data/spec/views/spotlight/sites/edit_exhibits.html.erb_spec.rb +2 -2
- data/spec/views/spotlight/tags/index.html.erb_spec.rb +3 -3
- metadata +226 -200
- data/app/assets/stylesheets/spotlight/application.scss +0 -5
- data/vendor/assets/javascripts/leaflet.js +0 -9
- data/vendor/assets/stylesheets/leaflet.css +0 -624
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
describe 'Adding custom metadata fields', type: :feature do
|
3
|
-
let(:exhibit) {
|
4
|
-
let(:admin) {
|
3
|
+
let(:exhibit) { FactoryBot.create(:exhibit) }
|
4
|
+
let(:admin) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
|
5
5
|
|
6
6
|
before do
|
7
7
|
login_as(admin)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
describe 'Editing metadata fields', type: :feature do
|
3
|
-
let(:exhibit) {
|
4
|
-
let(:admin) {
|
3
|
+
let(:exhibit) { FactoryBot.create(:exhibit) }
|
4
|
+
let(:admin) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
|
5
5
|
before { login_as(admin) }
|
6
6
|
|
7
7
|
it 'works' do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
describe 'Exhibits index page', type: :feature do
|
2
2
|
context 'with multiple exhibits' do
|
3
|
-
let!(:exhibit) {
|
4
|
-
let!(:other_exhibit) {
|
3
|
+
let!(:exhibit) { FactoryBot.create(:exhibit, title: 'Some Exhibit Title') }
|
4
|
+
let!(:other_exhibit) { FactoryBot.create(:exhibit, title: 'Some Other Title') }
|
5
5
|
|
6
6
|
it 'shows some cards for each published exhibit' do
|
7
7
|
visit spotlight.exhibits_path
|
@@ -44,7 +44,7 @@ describe 'Exhibits index page', type: :feature do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
context 'with a single exhibit' do
|
47
|
-
let!(:exhibit) {
|
47
|
+
let!(:exhibit) { FactoryBot.create(:exhibit, title: 'Some Exhibit Title') }
|
48
48
|
|
49
49
|
it 'redirects to the exhibit home page' do
|
50
50
|
visit spotlight.exhibits_path
|
@@ -1,10 +1,10 @@
|
|
1
|
-
describe 'Feature page', type: :feature do
|
2
|
-
let(:exhibit) {
|
3
|
-
let(:exhibit_curator) {
|
1
|
+
describe 'Feature page', type: :feature, versioning: true do
|
2
|
+
let(:exhibit) { FactoryBot.create(:exhibit) }
|
3
|
+
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
4
4
|
|
5
5
|
describe 'viewing the page' do
|
6
6
|
let!(:feature_page) do
|
7
|
-
|
7
|
+
FactoryBot.create(:feature_page, title: 'Parent Page', exhibit: exhibit)
|
8
8
|
end
|
9
9
|
it 'has <meta> tags' do
|
10
10
|
TopHat.current['twitter_card'] = nil
|
@@ -21,10 +21,10 @@ describe 'Feature page', type: :feature do
|
|
21
21
|
|
22
22
|
describe 'sidebar' do
|
23
23
|
let!(:parent_feature_page) do
|
24
|
-
|
24
|
+
FactoryBot.create(:feature_page, title: 'Parent Page', exhibit: exhibit)
|
25
25
|
end
|
26
26
|
let!(:child_feature_page) do
|
27
|
-
|
27
|
+
FactoryBot.create(
|
28
28
|
:feature_page,
|
29
29
|
title: 'Child Page',
|
30
30
|
parent_page: parent_feature_page, exhibit: exhibit
|
@@ -71,7 +71,7 @@ describe 'Feature page', type: :feature do
|
|
71
71
|
describe 'page options' do
|
72
72
|
before { login_as exhibit_curator }
|
73
73
|
describe 'publish' do
|
74
|
-
let!(:unpublished_page) {
|
74
|
+
let!(:unpublished_page) { FactoryBot.create(:feature_page, published: false, exhibit: exhibit) }
|
75
75
|
it 'is updatable from the edit page' do
|
76
76
|
expect(unpublished_page).not_to be_published
|
77
77
|
|
@@ -88,7 +88,7 @@ describe 'Feature page', type: :feature do
|
|
88
88
|
end
|
89
89
|
end
|
90
90
|
describe 'display_sidebar' do
|
91
|
-
let!(:feature_page) {
|
91
|
+
let!(:feature_page) { FactoryBot.create(:feature_page, display_sidebar: false, exhibit: exhibit) }
|
92
92
|
before { feature_page.update display_sidebar: false }
|
93
93
|
it 'is updatable from the edit page' do
|
94
94
|
expect(feature_page.display_sidebar?).to be_falsey
|
@@ -109,7 +109,7 @@ describe 'Feature page', type: :feature do
|
|
109
109
|
|
110
110
|
describe 'page locking' do
|
111
111
|
before { login_as exhibit_curator }
|
112
|
-
let!(:feature_page) {
|
112
|
+
let!(:feature_page) { FactoryBot.create(:feature_page, display_sidebar: false, exhibit: exhibit) }
|
113
113
|
|
114
114
|
it 'shows a lock message if someone is currently editing the page' do
|
115
115
|
# open the edit page
|
@@ -1,6 +1,6 @@
|
|
1
|
-
describe 'Home page', type: :feature do
|
2
|
-
let(:exhibit) {
|
3
|
-
let(:exhibit_curator) {
|
1
|
+
describe 'Home page', type: :feature, versioning: true do
|
2
|
+
let(:exhibit) { FactoryBot.create(:exhibit) }
|
3
|
+
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
4
4
|
before { login_as exhibit_curator }
|
5
5
|
it 'exists by default on exhibits' do
|
6
6
|
visit spotlight.exhibit_dashboard_path(exhibit)
|
@@ -58,7 +58,7 @@ describe 'Home page', type: :feature do
|
|
58
58
|
|
59
59
|
describe 'page options on edit form' do
|
60
60
|
describe 'show title' do
|
61
|
-
let(:home_page) {
|
61
|
+
let(:home_page) { FactoryBot.create(:home_page, display_title: false, exhibit: exhibit) }
|
62
62
|
it 'is updatable from the edit page' do
|
63
63
|
expect(home_page.display_title).to be_falsey
|
64
64
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'tempfile'
|
2
2
|
|
3
3
|
describe 'Allow exhibit admins to import and export content from an exhibit', type: :feature, js: true do
|
4
|
-
let(:exhibit) {
|
5
|
-
let(:user) {
|
4
|
+
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
+
let(:user) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
|
6
6
|
before { login_as user }
|
7
7
|
|
8
8
|
pending 'should allow admins to export content from an exhibit' do
|
@@ -1,6 +1,6 @@
|
|
1
1
|
describe 'Item Administration', type: :feature do
|
2
|
-
let(:exhibit) {
|
3
|
-
let(:curator) {
|
2
|
+
let(:exhibit) { FactoryBot.create(:exhibit) }
|
3
|
+
let(:curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
4
4
|
before { login_as curator }
|
5
5
|
|
6
6
|
before do
|
@@ -1,6 +1,6 @@
|
|
1
1
|
feature 'About Pages Adminstration', js: true do
|
2
|
-
let(:exhibit) {
|
3
|
-
let(:exhibit_curator) {
|
2
|
+
let(:exhibit) { FactoryBot.create(:exhibit) }
|
3
|
+
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
4
4
|
before { login_as exhibit_curator }
|
5
5
|
|
6
6
|
it 'is able to create new pages' do
|
@@ -1,6 +1,6 @@
|
|
1
1
|
feature 'Block controls' do
|
2
|
-
let(:exhibit) {
|
3
|
-
let(:exhibit_curator) {
|
2
|
+
let(:exhibit) { FactoryBot.create(:exhibit) }
|
3
|
+
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
4
4
|
before { login_as exhibit_curator }
|
5
5
|
|
6
6
|
scenario 'should be split into separate sections', js: true do
|
@@ -1,11 +1,11 @@
|
|
1
1
|
|
2
2
|
describe 'Featured Browse Category Block', type: :feature, js: true do
|
3
|
-
let(:exhibit) {
|
4
|
-
let(:exhibit_curator) {
|
3
|
+
let(:exhibit) { FactoryBot.create(:exhibit) }
|
4
|
+
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
5
5
|
|
6
|
-
let!(:feature_page) {
|
7
|
-
let!(:search1) {
|
8
|
-
let!(:search2) {
|
6
|
+
let!(:feature_page) { FactoryBot.create(:feature_page, exhibit: exhibit) }
|
7
|
+
let!(:search1) { FactoryBot.create(:published_search, exhibit: exhibit, title: 'Title1', published: true) }
|
8
|
+
let!(:search2) { FactoryBot.create(:published_search, exhibit: exhibit, title: 'Title2', published: true) }
|
9
9
|
|
10
10
|
before do
|
11
11
|
login_as exhibit_curator
|
@@ -1,8 +1,8 @@
|
|
1
1
|
|
2
2
|
describe 'Featured Pages Blocks', type: :feature, js: true do
|
3
|
-
let(:exhibit) {
|
3
|
+
let(:exhibit) { FactoryBot.create(:exhibit) }
|
4
4
|
let!(:feature_page1) do
|
5
|
-
|
5
|
+
FactoryBot.create(
|
6
6
|
:feature_page,
|
7
7
|
title: 'FeaturePage1 Title',
|
8
8
|
weight: 1,
|
@@ -10,7 +10,7 @@ describe 'Featured Pages Blocks', type: :feature, js: true do
|
|
10
10
|
)
|
11
11
|
end
|
12
12
|
let!(:feature_page2) do
|
13
|
-
|
13
|
+
FactoryBot.create(
|
14
14
|
:feature_page,
|
15
15
|
title: 'FeaturePage2 Title',
|
16
16
|
weight: 0,
|
@@ -18,7 +18,7 @@ describe 'Featured Pages Blocks', type: :feature, js: true do
|
|
18
18
|
)
|
19
19
|
end
|
20
20
|
|
21
|
-
let(:exhibit_curator) {
|
21
|
+
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
22
22
|
|
23
23
|
before do
|
24
24
|
login_as exhibit_curator
|
@@ -0,0 +1,44 @@
|
|
1
|
+
describe 'Link to Search Block', type: :feature, js: true do
|
2
|
+
let(:exhibit) { FactoryBot.create(:exhibit) }
|
3
|
+
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
4
|
+
|
5
|
+
let!(:feature_page) { FactoryBot.create(:feature_page, exhibit: exhibit) }
|
6
|
+
let!(:search1) { FactoryBot.create(:published_search, exhibit: exhibit, title: 'Title1', published: true) }
|
7
|
+
let!(:search2) { FactoryBot.create(:published_search, exhibit: exhibit, title: 'Title2', published: true) }
|
8
|
+
|
9
|
+
before do
|
10
|
+
login_as exhibit_curator
|
11
|
+
|
12
|
+
visit spotlight.edit_exhibit_feature_page_path(exhibit, feature_page)
|
13
|
+
add_widget 'link_to_search'
|
14
|
+
end
|
15
|
+
|
16
|
+
pending 'allows a curator to select from existing browse categories' do
|
17
|
+
pending('Prefetched autocomplete does not work the same way as solr-backed autocompletes')
|
18
|
+
check 'Include item counts?'
|
19
|
+
|
20
|
+
fill_in_typeahead_field with: 'Title1'
|
21
|
+
|
22
|
+
within(:css, '.panel') do
|
23
|
+
uncheck 'Display?'
|
24
|
+
end
|
25
|
+
|
26
|
+
fill_in_typeahead_field with: 'Title2'
|
27
|
+
|
28
|
+
save_page
|
29
|
+
|
30
|
+
# Documents should exist
|
31
|
+
expect(page).not_to have_css('.category-title', text: search1.title)
|
32
|
+
expect(page).to have_css('.category-title', text: search2.title)
|
33
|
+
expect(page).to have_css('.item-count', text: /\d+ items/i)
|
34
|
+
end
|
35
|
+
|
36
|
+
pending 'allows the curator to omit document counts' do
|
37
|
+
pending('Prefetched autocomplete does not work the same way as solr-backed autocompletes')
|
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
|
44
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
describe 'Horizontal rule block', type: :feature, js: true do
|
2
|
-
let(:exhibit) {
|
3
|
-
let(:exhibit_curator) {
|
4
|
-
let!(:feature_page) {
|
1
|
+
describe 'Horizontal rule block', type: :feature, js: true, versioning: true do
|
2
|
+
let(:exhibit) { FactoryBot.create(:exhibit) }
|
3
|
+
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
4
|
+
let!(:feature_page) { FactoryBot.create(:feature_page, exhibit: exhibit) }
|
5
5
|
before { login_as exhibit_curator }
|
6
6
|
|
7
7
|
it 'allows the user to select which image in a multi image object to display' do
|
@@ -1,10 +1,10 @@
|
|
1
1
|
|
2
2
|
describe 'Search Result Block', type: :feature, js: true do
|
3
|
-
let(:exhibit) {
|
4
|
-
let(:exhibit_curator) {
|
3
|
+
let(:exhibit) { FactoryBot.create(:exhibit) }
|
4
|
+
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
5
5
|
|
6
|
-
let!(:feature_page) {
|
7
|
-
let!(:alt_search) {
|
6
|
+
let!(:feature_page) { FactoryBot.create(:feature_page, exhibit: exhibit) }
|
7
|
+
let!(:alt_search) { FactoryBot.create(:search, title: 'Alt. Search', exhibit: exhibit) }
|
8
8
|
|
9
9
|
before do
|
10
10
|
login_as exhibit_curator
|
@@ -1,9 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
let(:
|
4
|
-
let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) }
|
1
|
+
feature 'Solr Document Block', feature: true, versioning: true do
|
2
|
+
let(:exhibit) { FactoryBot.create(:exhibit) }
|
3
|
+
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
5
4
|
let(:feature_page) do
|
6
|
-
|
5
|
+
FactoryBot.create(
|
7
6
|
:feature_page,
|
8
7
|
title: 'FeaturePage1',
|
9
8
|
exhibit: exhibit
|
@@ -58,7 +57,7 @@ feature 'Solr Document Block', feature: true do
|
|
58
57
|
|
59
58
|
# Select the last image
|
60
59
|
click_link('Change')
|
61
|
-
|
60
|
+
find('.thumbs-list li:last-child').click
|
62
61
|
|
63
62
|
save_page
|
64
63
|
|
@@ -1,7 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
let(:
|
4
|
-
let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) }
|
1
|
+
feature 'Uploaded Items Block', feature: true, js: true, versioning: true do
|
2
|
+
let(:exhibit) { FactoryBot.create(:exhibit) }
|
3
|
+
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
5
4
|
let(:fixture_file1) { File.join(FIXTURES_PATH, '800x600.png') }
|
6
5
|
let(:fixture_file2) { File.join(FIXTURES_PATH, 'avatar.png') }
|
7
6
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
describe 'Edit in place', type: :feature, js: true do
|
2
|
-
let(:exhibit) {
|
3
|
-
let(:admin) {
|
2
|
+
let(:exhibit) { FactoryBot.create(:exhibit) }
|
3
|
+
let(:admin) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
|
4
4
|
before { login_as admin }
|
5
5
|
describe 'Feature Pages' do
|
6
6
|
it 'updates the label' do
|
@@ -1,15 +1,15 @@
|
|
1
1
|
feature 'Feature Pages Adminstration', js: true do
|
2
|
-
let(:exhibit) {
|
3
|
-
let(:exhibit_curator) {
|
2
|
+
let(:exhibit) { FactoryBot.create(:exhibit) }
|
3
|
+
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
4
4
|
let!(:page1) do
|
5
|
-
|
5
|
+
FactoryBot.create(
|
6
6
|
:feature_page,
|
7
7
|
title: 'FeaturePage1',
|
8
8
|
exhibit: exhibit
|
9
9
|
)
|
10
10
|
end
|
11
11
|
let!(:page2) do
|
12
|
-
|
12
|
+
FactoryBot.create(
|
13
13
|
:feature_page,
|
14
14
|
title: 'FeaturePage2',
|
15
15
|
exhibit: exhibit,
|
@@ -53,21 +53,34 @@ feature 'Feature Pages Adminstration', js: true do
|
|
53
53
|
end
|
54
54
|
|
55
55
|
it 'stays in curation mode if a user has unsaved data' do
|
56
|
+
pending('Spec does not work with chromedriver')
|
56
57
|
visit spotlight.edit_exhibit_feature_page_path(page1.exhibit, page1)
|
57
58
|
|
59
|
+
# Hack to bypass alert about unsaved changes
|
60
|
+
page.evaluate_script('function observedFormsStatusHasChanged() { return false; }')
|
61
|
+
|
58
62
|
fill_in('Title', with: 'Some Fancy Title')
|
59
|
-
|
63
|
+
|
64
|
+
page.accept_confirm do
|
65
|
+
click_link 'Cancel'
|
66
|
+
end
|
60
67
|
expect(page).not_to have_selector 'a', text: 'Edit'
|
61
68
|
end
|
62
69
|
|
63
70
|
it 'stays in curation mode if a user has unsaved contenteditable data' do
|
71
|
+
pending('Spec does not work with chromedriver')
|
64
72
|
visit spotlight.edit_exhibit_feature_page_path(page1.exhibit, page1)
|
65
73
|
|
74
|
+
# Hack to bypass alert about unsaved changes
|
75
|
+
page.evaluate_script('function observedFormsStatusHasChanged() { return false; }')
|
76
|
+
|
66
77
|
add_widget 'solr_documents'
|
67
78
|
content_editable = find('.st-text-block')
|
68
79
|
content_editable.set('Some Fancy Text.')
|
69
80
|
|
70
|
-
|
81
|
+
page.accept_confirm do
|
82
|
+
click_link 'Cancel'
|
83
|
+
end
|
71
84
|
expect(page).not_to have_selector 'a', text: 'Edit'
|
72
85
|
end
|
73
86
|
|
@@ -75,6 +88,10 @@ feature 'Feature Pages Adminstration', js: true do
|
|
75
88
|
visit spotlight.exhibit_dashboard_path(exhibit)
|
76
89
|
|
77
90
|
click_link 'Feature pages'
|
91
|
+
|
92
|
+
# Hack to bypass alert about unsaved changes
|
93
|
+
page.evaluate_script('function observedFormsStatusHasChanged() { return false; }')
|
94
|
+
|
78
95
|
within("[data-id='#{page1.id}']") do
|
79
96
|
within('h3') do
|
80
97
|
expect(page).to have_content('FeaturePage1')
|
@@ -86,7 +103,9 @@ feature 'Feature Pages Adminstration', js: true do
|
|
86
103
|
end
|
87
104
|
|
88
105
|
within '#exhibit-navbar' do
|
89
|
-
|
106
|
+
page.accept_alert do
|
107
|
+
click_link 'Home'
|
108
|
+
end
|
90
109
|
end
|
91
110
|
expect(page).not_to have_content('Feature pages were successfully updated.')
|
92
111
|
# NOTE: get flash message about unsaved changes
|
@@ -1,6 +1,6 @@
|
|
1
|
-
feature 'Editing the Home Page', js: true do
|
2
|
-
let(:exhibit) {
|
3
|
-
let(:admin) {
|
1
|
+
feature 'Editing the Home Page', js: true, versioning: true do
|
2
|
+
let(:exhibit) { FactoryBot.create(:exhibit) }
|
3
|
+
let(:admin) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
|
4
4
|
|
5
5
|
before { login_as admin }
|
6
6
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
feature 'Metadata Administration', js: true do
|
2
|
-
let(:exhibit) {
|
3
|
-
let(:admin) {
|
2
|
+
let(:exhibit) { FactoryBot.create(:exhibit) }
|
3
|
+
let(:admin) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
|
4
4
|
before { login_as admin }
|
5
5
|
describe 'Select/Deselect all button' do
|
6
6
|
it 'deselects all checkboxes when all are selected' do
|
@@ -1,7 +1,7 @@
|
|
1
|
-
describe 'Multi image selector', type: :feature, js: true do
|
2
|
-
let(:exhibit) {
|
3
|
-
let(:exhibit_curator) {
|
4
|
-
let(:feature_page) {
|
1
|
+
describe 'Multi image selector', type: :feature, js: true, versioning: true do
|
2
|
+
let(:exhibit) { FactoryBot.create(:exhibit) }
|
3
|
+
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
|
4
|
+
let(:feature_page) { FactoryBot.create(:feature_page, exhibit: exhibit) }
|
5
5
|
before { login_as exhibit_curator }
|
6
6
|
|
7
7
|
it 'allows the user to select which image in a multi image object to display' do
|
@@ -29,13 +29,13 @@ describe 'Multi image selector', type: :feature, js: true do
|
|
29
29
|
|
30
30
|
within('.panel') do
|
31
31
|
expect(page).to have_content(/Image \d of \d/)
|
32
|
-
find('a', text: 'Change').
|
32
|
+
find('a', text: 'Change').click
|
33
33
|
end
|
34
34
|
|
35
35
|
expect(page).to have_css('.thumbs-list ul', visible: true)
|
36
36
|
|
37
37
|
within('.thumbs-list ul') do
|
38
|
-
all('li')[1].
|
38
|
+
all('li')[1].click
|
39
39
|
end
|
40
40
|
|
41
41
|
save_page
|